← Back to Pull requests

[Perf][MiniCPM-o] Replay the Talker K-step CUDA graph on native duplex steps #10432

Open
ischencheng opened this pull request with 328 lines diff across 3 files
View on GitHub
ischencheng ischencheng commented on Nov 16, 2026 03:54 UTC
Author

Part of #9508 (2.1.4, Talker K-step on CUDA). Follow-up to #10288, which turned the Talker K-step on in minicpmo_4_5.yaml for both session modes.

Contributor intent (required human answers)

1. What outcome do you want to achieve?

MiniCPM-o 4.5 full duplex on CUDA gets the K-step speedup on its speaking chunks, instead of being slower than with the K-step off.

2. What is the highest-leverage variable for that outcome?

Host time per Talker step on duplex. prepare_cuda_kstep declines every native duplex row, so since #10288 each duplex Talker step runs the K-step frame loop eagerly. At 8 frames that is about 2,900 kernel launches and 50-120 syncs per step, with the GPU busy 4-6% of the step (torch trace, 1x H100, c8); #10331 has since raised the CUDA K-step to 16 frames.

3. How will this work move that variable?

Let native duplex rows bind to the fused K-step workspace, so a duplex step replays one CUDA graph for all its frames like a turn step does. The commit reports the per-request duplex step metadata that the frame loop reports today. Turn-end drain conditions keep the frame loop.

4. Whose customer or user needs does this address, and what are those needs?

People serving MiniCPM-o 4.5 as a full-duplex voice assistant on CUDA with the default minicpmo_4_5.yaml. Their users hear the speaking-chunk time as the delay before and between audio pieces.

Purpose

Before: on the CUDA MRv2 duplex profile the Talker K-step is armed, but prepare_cuda_kstep returns None for any native_duplex row (the fused path came in #9733 for turn serving). Every duplex K-step step falls back to the per-frame eager loop. The server log shows [kstep-cuda-narrow] declined reason=fused:kstep-workspace and no [kstep-cuda-graph] replay.

After:

  • prepare_cuda_kstep no longer declines a row for being native duplex. The existing checks stay (non-dict rows, spans, turn-end drain, repetition detection, min_p and the other unsupported sampling settings), so a duplex turn-end condition still drains on the frame loop.

  • commit_cuda_kstep adds native_duplex, duplex_epoch, duplex_turn_id, streaming_condition_seq, llm_output_text_utf8, turn_end, speech_flush and text_without_audio to its meta, the per-request lists the frame loop reports and merge_frame_outputs keeps from the last frame. The frame loop, the MRv2 single-frame path and the commit now build it with one helper, _native_duplex_meta_outputs.

  • Turn serving is unchanged: a commit with no duplex row carries no duplex keys.

  • The fused host update keeps a request's last 104 confirmed codec frames (one turn-end condition) instead of only the 16-frame penalty window. Native duplex prompt recompute at Talker context capacity rebuilds the next prompt from every frame confirmed since the current one (25 on a normal chunk); with the 16-frame trim the first rollover after a fused chunk failed.

  • With the 16-frame CUDA K-step from #10331, a 25-frame duplex chunk is one full step plus one with 9 valid frames.

  • Doc: one sentence in the CUDA MRv2 Talker K-step section of docs/design/minicpm_o45_mrv2_performance.md.
  • Test Plan

    vLLM Version: 0.34.0 (vllm/vllm-openai:v0.34.0) for c89f0f43c and 1bb3aaa5d; 0.33.0 for the runs on 53ba0a311.

    vLLM-Omni Commit: 1bb3aaa5d (main 8f4562395 merged in, after #10976). The unit, rollover, serving A/B and accuracy runs below are on 53ba0a311 (main 0781f0f9a, 16-frame CUDA Talker K-step); the last two sections are on c89f0f43c and 1bb3aaa5d.

  • Unit: pytest tests/model_executor/models/minicpmo_4_5 tests/worker/test_talker_cuda_graph.py in a CPU-only container at 53ba0a311; the new rollover case also against an earlier head 34658fa36. Earlier: 1922 passed on 1x H100 at 8e630e491.

  • Rollover: the same deploy config with the Talker max_model_len cut from 4096 to 384, so native duplex prompt recompute starts within a few speaking chunks. 1x H100, 8 sessions at c1 on 34658fa36, then 8 at c1 and 8 at c4 on 53ba0a311, nightly C8 ids.

  • Serving: 1x H100, one container, three servers one after another: main 0781f0f9a, this branch, and main with the #10288 no-K control (CUDA stage 1 speculative_config: null, stop_token_ids: []). Each server: vllm serve openbmb/MiniCPM-o-4_5 --omni --deploy-config <minicpmo_4_5.yaml + duplex_session.collect_stats> (max_sessions 16 kept), one 8-session c8 pass to warm it, then vllm bench serve --omni --backend openai-realtime-duplex --dataset-name omni-duplex-eval --duplex-eval-mix soundtrack on the nightly C8 sample ids at c1 (8 sessions), c4 (16) and c8 (16). Per-chunk times come from session.stats.
  • Test Result

    Unit (CPU-only container, 53ba0a311): 1787 passed; the 46 failures are cases that need a GPU (Found no NVIDIA driver, Failed to infer device type, triton.language without extra), the same 46 as at 34658fa36. test_fused_duplex_steps_keep_every_frame_a_prompt_recompute_reads fails on 34658fa36 (the confirmed history ends at the last 16 frames) and passes on 53ba0a311. The GPU unit run was not repeated on 53ba0a311.

    Rollover at a 384-token Talker context: on 34658fa36 the first recompute raised K-step streaming prompt recompute is missing confirmed codec frames: history=16, confirmed=25, the Talker engine died and 0/8 sessions finished. On 53ba0a311 the Talker rebuilt its prompt 6 times (25 confirmed codes each, up to condition 26) and 16/16 sessions finished with no errors.

    Speaking chunks (the chunks where the Talker worked), from accepting the chunk to the end of its stage work, p50 / p90 in ms, and first PCM of a response (from accepting its first chunk) p50:

    | Concurrency | Branch | main | main, no K-step |
    | --- | --- | --- | --- |
    | c1 | 251 / 374 (n=108), 294 | 440 / 698 (n=98), 477 | 288 / 422 (n=104), 324 |
    | c4 | 293 / 464 (n=193), 336 | 484 / 730 (n=172), 505 | 345 / 501 (n=205), 390 |
    | c8 | 334 / 659 (n=138), 390 | 566 / 863 (n=165), 616 | 380 / 743 (n=166), 427 |

    Share of speaking chunks over 500 ms: c1 3.7% / 21.4% / 0%, c4 6.2% / 43.0% / 11.2%. Listening chunks barely move (p50 84 / 84 / 83 ms at c1). Graph use on the branch server: [kstep-cuda-graph] rows=1 frames=16 captures=1 replays=750 eager=1600 at the end (eager counts frames, so about 100 eager steps), plus captures for 2, 3 and 4 rows; main logs declined reason=fused:kstep-workspace and no replay.

    The c8 p90 and tail are not comparable: after the warm pass the branch and no-K servers still hit first-shape Stage-0 stalls at c8 (4 incidents each; 15 and 34 chunks dropped from the rows above), main none. All sessions finished in every arm.

    Omni-DuplexEval, nightly C8 case (66 samples at c8, max_sessions: 8, collect_stats, judge Qwen/Qwen2.5-VL-7B-Instruct on the second GPU, all samples evaluated). Four same-container rounds of main 0781f0f9a and the branch 53ba0a311, one on 2x H100 and three on 2x A100. CI floors are 1.8 / 1.4 / 0.28:

    | Run | RTD content, main / branch | RTD temporal, main / branch | PR all-success, main | PR all-success, branch |
    | --- | --- | --- | --- | --- |
    | 2x H100 | 2.04 / 2.06 | 1.45 / 1.73 | 14/36 (7) | 7/36 (7) |
    | 2x A100 #1 | 1.98 / 2.03 | 1.78 / 2.07 | 12/36 (12) | 8/36 (8) |
    | 2x A100 #2 | 2.11 / 2.03 | 1.68 / 1.78 | 14/36 (6) | 9/36 (9) |
    | 2x A100 #3 | 1.86 / 2.11 | 1.71 / 1.77 | 7/36 (7) | 9/36 (9) |

    In parentheses: all-success samples whose every event has a non-empty reply.

    The branch is below the 0.28 PR floor in all four runs, while main clears it in three of four, so merging this alone would likely fail the PR all-success check of the H100 nightly. The gap is on PR_correction. In main's H100 run and A100 #2 the model said nothing in 8 and 9 of the 13 correction sessions. The correction path of vllm_omni/benchmarks/duplex/omni_duplex_eval_eval.py still sends that empty reply to the judge (an empty reminder window scores 0), and the judge scored 15 of those 17 as successes. The branch had no empty correction reply in its four runs. Counting only all-success samples with a reply in every event, main has 32/144 and the branch 33/144, about 0.22 each, so main is under 0.28 on that count too.

    #9969 makes an empty correction reply score 0 (94c2c04b0), and the numbers in parentheses are that rule applied to these runs. All four rounds used the soundtrack mix; #9969 also moves the CI case to question. A 2x A100 run of the branch without 3633a4595 scored 2.07 / 1.70 / 12/36, with 9 of its 12 passes from empty correction replies.

    Head c89f0f43c (main 3f7af97b9 merged in). The merge conflicted with #10461, which removed the V1 single-frame output this PR had moved onto the helper; the resolution keeps that removal and nothing else changed by hand. Since 53ba0a311 the merge also brings in vLLM 0.34 (#10365).

  • Unit, CPU-only container on vllm/vllm-openai:v0.34.0, c89f0f43c and main 3f7af97b9 side by side: tests/model_executor/models/minicpmo_4_5/ 1726 passed, 49 failed on c89f0f43c, and all 49 also fail on main (GPU-only cases). test_fused_duplex_steps_keep_every_frame_a_prompt_recompute_reads passes.

  • Rollover smoke, 1x H100, the same 384-token Talker context as above: 8 sessions at c1 and 8 at c4, all finished, no error or traceback in the server log, 98.8 s and 81.0 s of reply audio. One c4 session (sample 2) gave no reply audio. The fused graph replayed on duplex steps ([kstep-cuda-graph] rows=1 frames=16 captures=1 replays=250 eager=560, plus a 2-row capture). This run does not log how many times the prompt was rebuilt.
  • Head 1bb3aaa5d (main 8f4562395 merged in). The merge conflicted with #10976, which added speech_flush and text_without_audio to the per-row duplex metadata of the frame loop and the MRv2 single-frame path. Both keys now come from _native_duplex_meta_outputs, so the fused commit reports them too (tts2code2wav_async_chunk reads them), and test_model_binding_fuses_native_duplex_rows_with_step_metadata checks them.

  • Unit, CPU-only container on vllm/vllm-openai:v0.34.0, 1bb3aaa5d and main 8f4562395 side by side: tests/model_executor/models/minicpmo_4_5/ plus tests/model_executor/models/realtime_venus/ give 2002 passed, 50 failed on 1bb3aaa5d, and all 50 also fail on main.

  • Rollover smoke, 1x H100, the same 384-token Talker context: 8 sessions at c1 and 8 at c4, all finished with reply audio (86.5 s and 74.4 s), no error or traceback in the server log. The fused graph replayed on duplex steps ([kstep-cuda-graph] rows=1 frames=16 captures=1 replays=250 eager=736).
  • Not run on 1bb3aaa5d or c89f0f43c: the A/B and Omni-DuplexEval rounds (the tables above are from 53ba0a311 on vLLM 0.33) and the GPU unit run. Not run at all: speech quality (WER) on duplex output, NPU, ROCm and the H200 duplex overlay.

    AI assistance: used Claude Code for the code, tests, benchmark scripts and write-up.

    Diff: 328 lines (+248 / -80) across 3 files Reviewer: amy-why-3459 Review duration: 27979m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.41) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.41 · 328 lines diff across 3 files
    0.41
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.93 · 5 substantive comment(s)
    0.93
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    88%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Real PR Conversation Timeline
    23 items
    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 16, 2026 03:54 UTC
    Bot

    Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
    Credits must be used to enable repository wide code reviews.

    amy-why-3459 amy-why-3459 commented on Nov 16, 2026 04:18 UTC
    Reviewer

    Thanks for the clear write-up, and for keeping duplex turn-end drain on the per-frame path.

    This change fits the existing CUDA K-step bind/commit path rather than adding a second mechanism. Lifting _native_duplex_meta_outputs so the eager, single-frame, MRv2, and fused commit paths share one helper is appropriate. The four new tests in tests/model_executor/models/minicpmo_4_5/test_talker_cuda_state.py cover distinct behaviors (fused binding and step metadata, rebinding a new condition on the same request, turn-mode commits without duplex keys, and turn-end drain staying eager). I do not see redundant production changes or redundant tests in this diff.

    Two items to address on this head (34658fa364d8):

    1. Output metadata alias on the fused path. In make_omni_output_mrv2, the helper result is applied and then native_duplex_segment_text is still set as an alias of llm_output_text_utf8, with the comment that this matches Stage 2 and tts2code2wav_async_chunk expectations. commit_cuda_kstep only does meta_outputs.update(duplex_meta) and does not set that alias, and the new fused-binding tests assert only llm_output_text_utf8. The current Stage 2 extractor in vllm_omni/model_executor/stage_input_processors/minicpmo_4_5_omni.py already reads output_meta.get("llm_output_text_utf8"). Please confirm that no remaining consumer of a fused duplex commit still requires native_duplex_segment_text on the Talker output; if one does, add the same alias on the commit path. If none does, the MRv2-only alias may be leftover.

    2. Performance and quality evidence on the reviewed head. The speaking-chunk numbers (1x H100, 8-frame K-step, this branch at cd9bfadff vs main 7873c0b35 vs a no-K-step control) show a clear p50 improvement at c1 (256/373 vs 419/641 vs 361/538 ms) and c4 (302/461 vs 463/664 vs 444/616 ms). That is useful, but it is not a comparison on this head: #10331 has since moved the CUDA profile to 16 frames, 34658fa merges main 0ac1fd4f3, and the description states that the GPU unit run and the serving run were not repeated on the merged head. The c8 p90 (1008 vs 812 vs 747 ms) is also not comparable because of first-shape stalls and because no rows>=3 graph was captured in that run. Please post speaking-chunk p50/p90 (and first-PCM p50) on 34658fa with the current 16-frame CUDA profile, same C8 mix, versus main and the no-K control, and note any remaining stall filtering. Accuracy/quality comparisons (Omni-DuplexEval or WER on duplex output) are also not included for this head; if graph replay can change Talker samples relative to the eager loop, please post a quality check against the same baseline on this head.

    vllm-omni-review-bot vllm-omni-review-bot commented on Nov 16, 2026 05:49 UTC
    Bot

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

    Module owners: @tzhouam @fake0fan @Gaohan123

    Routing: @tzhouam via module of the changed files, CODEOWNERS; @fake0fan via module of the changed files; @Gaohan123 via module of the changed files

    @ischencheng, 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.

    <!-- omni-reviewbot:assignment:v1 repo=vllm-project/vllm-omni pr=10432 -->

    linyueqian linyueqian commented on code on Nov 16, 2026 18:19 UTC
    Code Review
    vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_tts.py:1
    @@ -2753,7 +2762,7 @@ def prepare_cuda_kstep(self, hidden: torch.Tensor, frames: int, **kwargs: Any) -
             eligible = kwargs.get("request_sample_eligible", [True] * len(infos))
             if not infos or len(spans) != len(infos) or not all(eligible):
                 return None
    -        if any(not isinstance(info, dict) or info.get("native_duplex") for info in infos):
    +        if any(not isinstance(info, dict) for info in infos):

    [important] With duplex rows admitted here, fused host bookkeeping in _apply_cuda_kstep_host_frames trims _request_codec_history to HISTORY_WINDOW (16) after every step (line 756), while eager K-step paths keep every confirmed frame. Duplex rollover in _build_streaming_recompute_embeddings needs all frames confirmed since the current prompt (a normal chunk is 25) and raises K-step streaming prompt recompute is missing confirmed codec frames when history is shorter. The default minicpmo_4_5.yaml Talker uses full attention with max_model_len 4096 and rolls over at capacity, so a long duplex session on CUDA reaching the limit after a fused chunk fails instead of rolling over. The new rebind test seeds one codec and never runs a recompute. Please keep the confirmed ledger separate from the 16-frame sampling window (or skip the trim for duplex rows), and add a fused-then-recompute test with more than 16 confirmed frames.

    linyueqian linyueqian requested changes on Nov 16, 2026 18:19 UTC
    Changes Requested Reviewer

    Thanks for the write-up and for keeping turn-end drain on the frame loop. Sharing _native_duplex_meta_outputs across the eager, single-frame, and fused paths is a good cleanup.

    One issue needs a fix before this lands, inline: once duplex rows take the fused path, the confirmed codec history is cut to 16 frames, but duplex prompt rollover needs every frame confirmed since the current prompt. I traced this in code at 34658fa3. I did not run a duplex session long enough to reach the 4096-token Talker limit.

    I agree with amy-why-3459 that the speedup should be shown on this head with the current 16-frame CUDA profile against main and the no-K control.

    twu3202 twu3202 commented on Nov 17, 2026 02:34 UTC
    Contributor

    I reproduced the rollover failure on 34658fa3 with real weights in a local native-duplex CUDA deployment using K=16. With the 4096-token Talker context, the first rollover failed with history=16, confirmed=25.

    Matched results at that context limit:

    | Revision | Rollover result |
    | --- | --- |
    | Base 0ac1fd4f | Crossed conditions 116 and 228 |
    | Head 34658fa3 | Failed at condition 116 |
    | Head with a local ledger-retention patch | Crossed conditions 116 and 228 |

    The base and patched runs continued until I cancelled after 240 seconds of streamed input. A smaller 768-token context reproduced the same failure at condition 20, while the base and patched runs completed.

    The fused host update trims the confirmed-code ledger to the 16-code penalty window, but recomputation needs all 25 codes from the previous condition. The local patch confirms the rollover behavior; it retains a growing ledger and is not a production memory fix. Base and patched PCM differ, so this does not establish output equivalence or a performance result.

    ischencheng ischencheng commented on code on Nov 17, 2026 05:54 UTC
    Code Review
    vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_tts.py:1
    @@ -2753,7 +2762,7 @@ def prepare_cuda_kstep(self, hidden: torch.Tensor, frames: int, **kwargs: Any) -
             eligible = kwargs.get("request_sample_eligible", [True] * len(infos))
             if not infos or len(spans) != len(infos) or not all(eligible):
                 return None
    -        if any(not isinstance(info, dict) or info.get("native_duplex") for info in infos):
    +        if any(not isinstance(info, dict) for info in infos):

    fixed in 3633a4595: the fused host update now keeps the last 104 confirmed frames (a turn-end condition, which covers anything a recompute reads) instead of trimming to the 16-frame window. Added test_fused_duplex_steps_keep_every_frame_a_prompt_recompute_reads: four fused 8-frame steps confirm 32 frames, then the next condition rebuilds its prompt from the last 25. It fails on 34658fa3.

    With the Talker context cut to 384 on 1x H100, 34658fa3 failed at the first rollover (history=16, confirmed=25) and 0/8 sessions finished. 53ba0a311 rolled over 6 times and 16/16 sessions finished.

    ischencheng ischencheng commented on Nov 17, 2026 05:54 UTC
    Author

    @twu3202 thanks, fixed in 3633a4595. The old head fails the same way for me, and the new head rolls over fine (numbers in the inline thread).

    @amy-why-3459 on 1: nothing reads native_duplex_segment_text from a Talker output. tts2code2wav_async_chunk reads llm_output_text_utf8, and tts2code2wav_full_payload reads the string llm2tts puts in the request meta, so the fused commit doesn't need it. The MRv2 alias came with #8536 and test_talker_mrv2.py checks it, so I left it.

    On 2, reran on 53ba0a311 (main 0781f0f9a merged, 16-frame K-step) in one 1x H100 container: main, branch and no-K one after another, each server warmed with an 8-session c8 pass first, nightly C8 ids. Speaking chunks p50 / p90 and first PCM p50, ms:

    | | branch | main | no-K |
    | --- | --- | --- | --- |
    | c1 | 251 / 374, 294 | 440 / 698, 477 | 288 / 422, 324 |
    | c4 | 293 / 464, 336 | 484 / 730, 505 | 345 / 501, 390 |
    | c8 | 334 / 659, 390 | 566 / 863, 616 | 380 / 743, 427 |

    At c8 the branch and no-K servers still hit first-shape Stage-0 stalls after the warm pass (15 and 34 chunks dropped), main none, so the c8 p90 and tail aren't comparable. Accuracy on this head vs main is running, I'll add it to the description.

    ischencheng ischencheng commented on Nov 17, 2026 08:35 UTC
    Author

    Accuracy on 53ba0a311 vs main, Omni-DuplexEval nightly C8 (66 samples, all evaluated, judge Qwen2.5-VL-7B), two same-container runs:

    | | RTD content | RTD temporal | PR all-success |
    | --- | --- | --- | --- |
    | 2x H100, main | 2.04 | 1.45 | 0.389 (14/36) |
    | 2x H100, branch | 2.06 | 1.73 | 0.194 (7/36) |
    | 2x A100, main | 1.98 | 1.78 | 0.333 (12/36) |
    | 2x A100, branch | 2.03 | 2.07 | 0.222 (8/36) |
    | 2x A100, branch without 3633a4595 | 2.07 | 1.70 | 0.333 (12/36) |

    PR all-success is below the 0.28 floor on the branch in both runs (34658fa3 had 0.306 on 11-16). The no-fix arm finished all 66 without the rollover error, so no recompute ran there and the fix shouldn't change these samples; 36 samples is noisy. Still, this isn't parity, so I'm moving it to draft while I compare the missed correction and proactive-reminder samples against main's outputs.

    ischencheng ischencheng commented on Nov 17, 2026 20:47 UTC
    Author

    Back to ready. On the 36 PR samples the no-fix arm runs the same code as the branch (it never hit a recompute, and the other ledger reads only use the last 16 codes), yet the two differ on 10 of them in the same container, about as often as main vs main (8) and branch vs main (11 on H100, 4 on A100). The branch still lost more than it gained vs main in both runs (9/2 and 4/0), so a small drop isn't ruled out, I can rerun with more seeds if you want a bigger sample.

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 17, 2026 20:47 UTC
    Bot

    <!-- codex-pull-request-review-summary -->
    <!-- codex-review-state:v1 {"code_review":{"commit_sha":"53ba0a311377f0779d236e8ee9d4bc061a8caddb","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->

    <details>
    <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary>

    This comment shows the latest Codex review activity on this pull request.

    | Review | Status | Commit | Review trigger |
    | --- | --- | --- | --- |
    | 📝 Code Review | ❌ Failed <relative-time datetime="2026-11-17T20:47:49.900824Z">2026-11-17T20:47:49.900824Z</relative-time><br/>We couldn’t complete this review. Comment @codex review to try again. | 53ba0a3 | Draft marked ready |

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    </details>

    </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 17, 2026 20:47 UTC
    Bot

    Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
    Credits must be used to enable repository wide code reviews.

    amy-why-3459 amy-why-3459 commented on Nov 17, 2026 22:22 UTC
    Reviewer

    Thanks for the follow-up on confirmed codec history on the fused K-step path.

    _apply_cuda_kstep_host_frames now trims _request_codec_history to _CONFIRMED_CODEC_LEDGER_FRAMES = max(HISTORY_WINDOW, MINICPMO45_DUPLEX_TURN_END_CODEC_TOKENS) (max(16, 104) = 104), which covers the streaming recompute bound of TURN_END - 1. The new test_fused_duplex_steps_keep_every_frame_a_prompt_recompute_reads would have failed on the old del history[:-HISTORY_WINDOW] trim (history=16, confirmed=25). The device-side penalty window (_cuda_kstep_host_signature / request bank) still correctly uses HISTORY_WINDOW. This increment addresses the rollover failure; I have no further issues on 3633a4595 / this head.

    twu3202 twu3202 commented on Nov 18, 2026 03:52 UTC
    Contributor

    I reran the original rollover case after the fix, at 53ba0a31 on an RTX 6000 Ada (native MRv2, K=16). The 768-token Talker context crossed four rollovers and the 4096-token context crossed two. Each read 25 confirmed frames, the host ledger never exceeded 104 frames, and both runs kept producing speech until the client cancelled.

    ischencheng ischencheng commented on Nov 19, 2026 05:36 UTC
    Author

    Put four rounds per arm in the description (two more on A100). The branch stays under the 0.28 PR floor, but the gap is on PR_correction: in two of main's runs the model said nothing in 8-9 of the 13 correction sessions, and the evaluator sends that empty reply to the judge, which scored 15 of 17 as successes. With a reply in every event main has 32/144 and the branch 33/144, so I'd make an empty correction reply score 0 and recalibrate the floor, here or in a separate PR, whichever you prefer.

    ischencheng ischencheng commented on Nov 24, 2026 09:55 UTC
    Author

    Merged main in c89f0f43c. The only conflict was #10461 dropping the V1 single-frame output, so that part of the diff is gone. On vLLM 0.34 the MiniCPM-o unit tests fail only where main also fails, and the 384-context rollover smoke on 1x H100 finished 16/16 sessions with the fused graph replaying; description updated.

    ischencheng ischencheng commented on Nov 27, 2026 10:03 UTC
    Author

    Merged main in 1bb3aaa5d. #10976 added speech_flush and text_without_audio to the duplex row metadata, so they now come from _native_duplex_meta_outputs and the fused commit reports them too (the fused duplex test checks both). The MiniCPM-o and Venus unit tests fail only where main also fails, and the 384-context rollover smoke on 1x H100 finished 16/16 sessions with the fused graph replaying; description updated.

    ischencheng ischencheng commented on Nov 28, 2026 09:34 UTC
    Author

    #9969 already makes an empty correction reply score 0 (94c2c04b0), so there's no evaluator change to add here. With that rule the four rounds come to 32/144 for main and 33/144 for the branch, the numbers in parentheses in the description. All four rounds used the soundtrack mix, and #9969 also switches the CI case to question.

    linyueqian linyueqian commented on code on Dec 01, 2026 13:54 UTC
    Code Review
    tests/model_executor/models/minicpmo_4_5/test_talker_cuda_state.py:1
    @@ -482,6 +483,193 @@ def captured_frame():
         assert [flag.item() for flag in output.multimodal_outputs["meta"]["finished"]] == [True, False]
     
     
    +def _binding_model():
    +    from types import SimpleNamespace
    +
    +    return SimpleNamespace(
    +        _request_audio_states={},
    +        _request_codec_history={},
    +        _request_generators={},
    +        _codec_min_tokens=0,
    +        _codec_max_tokens=10,
    +        _codec_temperature=0,
    +        _codec_repetition_penalty=1,
    +        _codec_top_k=0,
    +        _codec_top_p=1,
    +        _codec_seed=7,
    +        _codec_eos_id=VOCAB_SIZE - 1,
    +        _codec_fused_prelude=True,
    +        _codec_fused_tail=True,
    +        _merge_request_codec_params=lambda *args, **kwargs: None,
    +    )
    +
    +
    +def _duplex_info(request_id, *, epoch, turn_id, condition_seq, text, **meta):
    +    return {
    +        "request_id": request_id,
    +        "native_duplex": True,
    +        "duplex": {"epoch": epoch, "turn_id": turn_id},
    +        "meta": {"streaming_condition_seq": condition_seq, "native_duplex_segment_text": text, **meta},
    +    }
    +
    +
    +def test_model_binding_fuses_native_duplex_rows_with_step_metadata():
    +    """Native duplex decode rows take the fused K-step and still report their duplex fence.
    +
    +    The fused commit returns one output per step, so the per-request duplex
    +    metadata the eager frame loop reports (and merge_frame_outputs keeps from
    +    the last frame) has to come from the commit itself.
    +    """
    +    from vllm_omni.model_executor.models.minicpmo_4_5.minicpmo_4_5_omni_tts import (
    +        MiniCPMO45OmniTTSForConditionalGeneration,
    +    )
    +
    +    model = _binding_model()
    +    hidden = torch.zeros(2, 4)
    +    infos = [
    +        _duplex_info("a", epoch=1, turn_id=3, condition_seq=5, text="hi"),
    +        _duplex_info("b", epoch=0, turn_id=0, condition_seq=2, text="\u4f60\u597d", text_without_audio=True),
    +    ]
    +    kwargs = {"model_intermediate_buffer": infos, "request_token_spans": [(0, 1), (1, 2)]}
    +    state = MiniCPMO45OmniTTSForConditionalGeneration.prepare_cuda_kstep(model, hidden, 2, **kwargs)
    +    assert state is not None
    +    state.sample(logits([3, 4]), 0, VOCAB_SIZE - 1)
    +    state.sample(logits([5, 6]), 1, VOCAB_SIZE - 1)
    +    output = MiniCPMO45OmniTTSForConditionalGeneration.commit_cuda_kstep(model, hidden)
    +
    +    meta = output.multimodal_outputs["meta"]
    +    assert [v.item() for v in meta["native_duplex"]] == [True, True]
    +    assert [v.item() for v in meta["duplex_epoch"]] == [1, 0]
    +    assert [v.item() for v in meta["duplex_turn_id"]] == [3, 0]
    +    assert [v.item() for v in meta["streaming_condition_seq"]] == [5, 2]
    +    assert [bytes(v.tolist()).decode("utf-8") for v in meta["llm_output_text_utf8"]] == ["hi", "\u4f60\u597d"]
    +    assert [v.item() for v in meta["turn_end"]] == [False, False]
    +    assert [v.item() for v in meta[SPEECH_FLUSH_KEY]] == [False, False]

    [suggestion] Could one of the two rows set speech_flush=True, so this test checks that the fused commit passes it through? Both rows expect False, so a commit that always reports False would still pass.

    linyueqian linyueqian commented on Dec 01, 2026 13:54 UTC
    Reviewer

    My rollover finding is fixed. Fused steps now keep the last 104 confirmed codes for each request, and the new test rebuilds the next duplex prompt from the last 25 codes after four fused steps. I tested main merged with this branch (main 4a29d9ce9). Putting the 16-code trim back makes that test fail. Putting the native-duplex check back in prepare_cuda_kstep makes three of the new tests fail, and leaving the duplex metadata out of the fused commit makes two fail.

    On CPU, I ran the MiniCPM-o and worker_v2 tests and the other test files that name this code. They fail only where main does. On one NVIDIA L20X GPU (H200-class), the MiniCPM-o, worker_v2 and test_talker_cuda_graph.py suites show the same six failures on main and on this branch. All six fail because that environment has no cosyvoice2 module.

    I did not measure latency or quality at this head. Your latency numbers are from 53ba0a311 on vLLM 0.33 with the 16-frame K-step. The speaking-chunk p50 falls from 440 to 251 ms at c1, from 484 to 293 ms at c4 and from 566 to 334 ms at c8. Your four soundtrack-mix rounds at that commit scored 47 of 144 PR all-success for main and 33 of 144 for this branch. This branch was below the old 0.28 floor in all four rounds, and main was below it in one. Counted with the rule from #9969, where an empty correction reply scores 0, main has 32 and this branch has 33. The nightly on main now uses the question mix and records the correction rate without a floor. Main has moved to vLLM 0.34 since those runs, so I read these numbers as the reason for the change and not as results for this head.

    I am ready to approve, but the current ready build cannot pass Simple Test because of a problem on main. #9839 made stage_metadata a required argument of OrchestratorBase, and five tests from #9634 in tests/engine/test_orchestrator_dit_load_lifecycle.py do not pass it. They fail in build 21499, and the main commit that this build tests has both changes. #11480 fixes them. Newer main also has #11277, which broke four cases in tests/distributed/weight_sharing/test_shared_postload.py (they fail in build 21498). My review on #11480 asks for that fix too. After both are fixed on main, please merge main into this branch so a new build can run. I will approve when that build is green.

    I left one test suggestion inline.

    vllm-omni-review-bot vllm-omni-review-bot commented on Dec 02, 2026 02:36 UTC
    Bot

    Omni ReviewBot: CI is red on this head

    @ischencheng required checks failed on 1bb3aaa5d23a:

  • buildkite/vllm-omni
  • Please fix the failure or rerun CI; this note is updated in place when the failing checks change, the head goes green, or it moves.

    <!-- omni-reviewbot:lifecycle:v1 repo=vllm-project/vllm-omni pr=10432 head=1bb3aaa5d23ae8961395c6c93bdbaf90476a3bec kind=ci_failed -->
    <!-- omni-reviewbot:quality-note-head:1bb3aaa5d23ae8961395c6c93bdbaf90476a3bec -->
    <!-- omni-reviewbot:quality-note-state:live -->

    ischencheng ischencheng commented on Dec 04, 2026 11:43 UTC
    Author

    @linyueqian the main merge and the speech_flush row are ready locally. While re-checking them I found that the fused path keeps the previous turn's last codes in the penalty window on the first step of a new duplex turn, where the MRv2 path and the host sampler clear it. I'll fix that with a turn-boundary test and push it together with the merge.

    Reviewers
    Assignees
    ischencheng ischencheng
    Labels
    risk: low confidence: 88.4% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.6% (MEDIUM) · Higher = larger blast radius
    40.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88.4% · Lower = rushed or shallow review
    88.4%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.7% · Safe to merge
    4.7%