Repository navigation
[Bugfix] Fix Qwen3-Omni streaming crops in mixed-length batches - #7340
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Self-review:
Scripts and measured data. AI assistance is disclosed in the PR body. |
|
This PR appears to belong to: docs/design/module/model_integration.md, docs/design/module/ar_runtime.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 @dshah1333, 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 triage noteAutomated triage of commit
These are automated triage suggestions only — the final decision belongs to the maintainers. |
483efc0 to
3a201c0
Compare
A shorter Code2Wav row inferred its right-edge trim from the padded batch output length. That made the trim zero, shifted the overlap boundary and retained padded samples. Measure the trim from the decoded batch window and use each request's valid end. Validation run c2w-0909a on two A100-80GB GPUs reproduced a 7680-sample first chunk instead of 7125. The candidate passed 48 fixed-shape pretrained prefix checks, preserved all eight singleton PCM outputs, and completed the 16-request serving check with correct chunk counts. The regression fails 22 cases on the old crop and passes all 48 with the correction. Related model and graph tests pass 126/126. GPU evidence was collected before the content-identical update to 6fb7b0a. Fresh extracted-method red/green and changed-file hooks pass after the update. No general speech-quality or cross-shape numerical parity claim is made. AI assistance: Codex developed the fix, tests, and validation material. Signed-off-by: Deep Shah <deep@socratic.co>
3a201c0 to
3f238fe
Compare
linyueqian
left a comment
There was a problem hiding this comment.
Approving at 3f238fe6. The old slice measured each row's decoder trim as code_seq_len * upsample - batch_wav.shape[-1], which is only right for the row that spans the whole decoded window; a shorter row padded with codec zeros got a smaller or zero trim and an end index past its valid samples, so in a mixed-length streaming batch the shorter request's chunk was shifted and included samples decoded from padding. Measuring the trim once from the decoded window and slicing each row to [left_context * upsample - tail, code_seq_len * upsample - tail] gives every row the same treatment a singleton decode gets, and the parametrised test compares batched rows against independent decodes by value across eager and CUDA-graph paths, both trims, both orderings and several context sizes, which is the right oracle. Singleton and equal-length batches are unchanged. Reviewed statically; fork head, no PR code executed. No lane had run on this head, so I added ready; merge on green.
…-project#7340) Signed-off-by: Deep Shah <deep@socratic.co> Signed-off-by: Matthieu Laneuville <matthieu.laneuville@surf.nl>
…-project#7340) Signed-off-by: Deep Shah <deep@socratic.co>
Purpose
Fix the audio interval selected for shorter Qwen3-Omni requests in a padded streaming batch.
chunked_decode_streamingcalculates each request's decoder trim by subtracting the whole batch's waveform length from that request's nominal length. When another request has a longer codec window, the subtraction becomes negative and clamps to zero. The shorter request then discards too much overlap and retains samples produced from padding.For the pinned Qwen3-Omni checkpoint, the decoder returns
frames * 1920 - 555samples. A 29-frame request with four context frames, batched beside a 50-frame request, currently selects[7680:55680]instead of[7125:55125]. Both slices have 48,000 samples, so a duration-only check misses the shift.Measure the trim from the decoded batch window, then use each request's valid start and end. Singleton and equal-length slices stay unchanged. Non-async decoding, the shared graph wrapper, sampling, and deployment defaults are untouched.
This follows the tail compensation in #4706. #4525 fixed graph-bucket padding, while this fixes padding between requests. The old batch test assumed padding supplied valid future context. The replacement checks values, lengths, output count, batch order, and a singleton → mixed batch → singleton schedule.
Reproduction
In a matching Linux vLLM-Omni development environment:
With the final tests and only the production crop restored to baseline: 22 failed, 26 passed. With this fix: 48 passed. The regression needs the normal runtime imports but no model weights or GPU computation.
Test Plan
vLLM Version:
0.28.0, Torch2.13.0+cu130, Transformers5.14.1, NVIDIA driver580.173.02, 2x A100-80GB.vLLM-Omni Commit:
99d0a5602bb22aa64ce886ab3434c14179ac9b50, based on6fb7b0a0. Linux imported-module and GPU results were collected at9464231fagainstab561485before updating the submission branch. The patch and affected model, packer, stage processor, graph wrapper, generation runner and test files are unchanged. Fresh extracted-method red/green checks and changed-file hooks passed after the update. Linux/GPU runs were not repeated after it.Test Result
The actual baseline server emitted a 7,680-sample first chunk instead of 7,125, an extra 555 samples at 24 kHz. All candidate first chunks contained 7,125 samples. The controlled GPU test holds packed width at 50 and uses width 64 for graph capture, comparing a short request with the valid prefix of a full-width decode containing genuine future frames. Constructor/dispatch scaffolding is lightweight, while the real imported packer and fully weighted decoder execute.
All applicable changed-file pre-commit hooks passed. A separate read-only Codex review found no introduced blocker after checking trim arithmetic, final chunks, graph double trimming, metadata fallback, dtype/lifetime and retained evidence. The test counts overlap and should not be added together.
Reproduction scripts, measured results, and full qualifications
Additional controls and limits
AI assistance: Used Codex for the fix, regression tests, validation scripts, and PR text, plus a separate read-only Codex review.