Skip to content

[Model][PersonaPlex] add per-row RingKV offsets and active rows - #7670

Merged
linyueqian merged 7 commits into
vllm-project:mainfrom
MrDongsls:perf/ring-per-row-offsets
Sep 17, 2026
Merged

linyueqian merged 7 commits into
vllm-project:mainfrom
MrDongsls:perf/ring-per-row-offsets

Conversation

@MrDongsls

@MrDongsls MrDongsls commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

PLEASE FILL IN THE PR DESCRIPTION HERE.

Purpose

W1 standalone enabler described in #7389.

This PR makes PersonaPlex Mimi streaming state row-aware so a compact batched codec can let one row skip a tick without advancing or contaminating its state:

  • Make _RingKV.end_offset and Mimi transformer position progression per-row.
  • Thread an active: Tensor[B] mask through Mimi encode/decode so inactive rows preserve their KV, transformer offset, and convolution carry state.
  • Add mixed-active pause/resume tests that compare active rows.

Test Plan

vLLM Version: 0.29.0
vLLM-Omni Commit: 6c5bd318bb70075dc6f39b141f6178408b58e4e8

  • CPU tests: pytest -q --run-level=core_model -m "core_model and cpu" tests/model_executor/models/personaplex/test_ring_per_row_offsets.py — 4 passed
  • GPU mixed-offset parity: pytest -q --run-level=core_model -m "core_model and cuda" tests/model_executor/models/personaplex/test_ring_per_row_offsets.py - 4 passed
  • Existing PersonaPlex tests: pytest -q --run-level=core_model tests/model_executor/models/personaplex --ignore=tests/model_executor/models/personaplex/test_ring_per_row_offsets.py — 41 passed
  • Fixed-workload A/B benchmark

BEFORE SUBMITTING: read CONTRIBUTING.md and run the precheck-pr skill with the code agent for a self-check against project conventions.
(anything written below this line will be removed by GitHub Actions)

Mr.Dong added 4 commits September 14, 2026 09:37
Signed-off-by: Mr.Dong <1042542469@qq.com>
…ve-row mask so a row can skip ticks while others advance.

Signed-off-by: Mr.Dong <1042542469@qq.com>
Signed-off-by: Mr.Dong <1042542469@qq.com>
Signed-off-by: Mr.Dong <1042542469@qq.com>
@hsliuustc0106

Copy link
Copy Markdown
Collaborator

This PR touches vllm_omni/model_executor/, tests/model_executor/ (3 files). Based on CODEOWNERS coverage of the changed files, the most-related reviewers appear to be:

@tzhouam @gcanlin @Sy0307

Could one of you take a look when you get a chance? Thanks!

@hsliuustc0106 hsliuustc0106 added the enhancement New feature or request label Sep 17, 2026
@MrDongsls MrDongsls changed the title Perf/ring per row offsets [WIP][Model][PersonaPlex] add per-row RingKV offsets and active rows Sep 17, 2026
Mr.Dong added 3 commits September 17, 2026 11:56
Signed-off-by: Mr.Dong <1042542469@qq.com>
Signed-off-by: Mr.Dong <1042542469@qq.com>
Signed-off-by: Mr.Dong <1042542469@qq.com>
@MrDongsls MrDongsls changed the title [WIP][Model][PersonaPlex] add per-row RingKV offsets and active rows [Model][PersonaPlex] add per-row RingKV offsets and active rows Sep 17, 2026
@MrDongsls
MrDongsls marked this pull request as ready for review September 17, 2026 07:34
@vllm-omni-review-bot

Copy link
Copy Markdown

This PR appears to belong to: docs/design/module/model_integration.md, docs/design/module/ar_runtime.md.

Module owners: @tzhouam @gcanlin @fake0fan

Routing: @tzhouam via module of the changed files, semantic router, CODEOWNERS; @gcanlin via module of the changed files, semantic router; @fake0fan via module of the changed files

@MrDongsls, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer.

Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment.

@linyueqian linyueqian added the ready label to trigger buildkite CI label Sep 17, 2026

@linyueqian linyueqian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at a89c95fb (static read against main plus the CPU and CUDA parity tests as written; nothing executed here). The change is contained to the two PersonaPlex streaming modules and is bit-for-bit the old path when every row is active: with lockstep end_offset the per-row scatter_ hits the same ring slots as the old index_copy_, the position mask is the same formula per row, the RoPE reshape to [B, 1, T, 1] collapses to the old [1, T, 1] broadcast, and _fresh & active is _fresh for an all-true mask, so the first-frame replicate padding and the transposed-conv bias skip are unchanged. active=None maps to the device-resident _all_active, so Stage 0 and Code2Wav keep calling encode_frame / decode_frame exactly as before. Inactive rows are inert where it matters: the gathered K/V slot is written back unchanged, end_offset, prev, partial and _fresh only move where active is true, and reset_slot now masks the row's own write head rather than the shared one. PersonaPlexTemporalStreaming.step has no callers inside vllm_omni yet, so making active required there is safe.

The tests are the right shape: batched rings, transformers and conv carries are compared against singletons that only step on active ticks, and inactive rows are checked against a cloned snapshot; marks match the Simple and Model Executor CUDA steps. One suggestion inline about the mask's device for the future batched callers. Base is a few days old but the merged tree is byte-identical to this head for all three files, and the general lane is green at a89c95fb. Approving.

def _normalize_temporal_active(active: torch.Tensor, reference: torch.Tensor) -> torch.Tensor:
if active.shape != reference.shape:
raise ValueError(f"active must have shape {tuple(reference.shape)}, got {tuple(active.shape)}")
return active.to(device=reference.device, dtype=torch.bool)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] Callers are told to pass bool[B], but nothing says which device. A CPU mask lands here in a blocking .to(device=...) copy on every frame (same in _normalize_active in personaplex_mimi.py), which is a host sync per tick and will fail inside CUDA graph capture when the compact batched codec from #7389 gets there. Worth stating in the docstring that the mask must already live on the model device (or accept only that and raise), so the W2 batch builder keeps a persistent device-side mask instead of discovering this under capture.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a follow-up, active is now a persistent device-side bool[B] mask and raises on device or shape mismatches.

@linyueqian
linyueqian merged commit 825ab20 into vllm-project:main Sep 17, 2026
6 of 9 checks passed
mlaneuville pushed a commit to mlaneuville/vllm-omni that referenced this pull request Sep 22, 2026
…-project#7670)

Signed-off-by: Mr.Dong <1042542469@qq.com>
Co-authored-by: Mr.Dong <1042542469@qq.com>
Signed-off-by: Matthieu Laneuville <matthieu.laneuville@surf.nl>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm-omni that referenced this pull request Sep 25, 2026
…-project#7670)

Signed-off-by: Mr.Dong <1042542469@qq.com>
Co-authored-by: Mr.Dong <1042542469@qq.com>
Sendoh-code added a commit to Sendoh-code/vllm-omni that referenced this pull request Oct 2, 2026
… out of the per-layer loop

Build the per-row RoPE cos/sin tables ([B, 1, T, D/2]) and the RingKV write
indexes ([B, T]) / pre-mask position table ([B, capacity]) once per step() in
PersonaPlexTemporalStreaming and _MimiStreamingTransformer, and thread them
through every layer instead of rebuilding them per layer. The per-row
start_offset mask and the active-row write guard stay inside
_RingKV.complete(); complete() still builds its own tables when called
standalone.

Rebased onto the per-row offsets / active-mask API from vllm-project#7670.

Signed-off-by: Yifan Tian <Yifan.Tian@colorado.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants