Repository navigation
[Perf][Qwen-Omni] Check audio-in-video interleaving with tensor reductions - #8629
amy-why-3459 merged 2 commits into
Conversation
…tions Both Qwen-Omni thinkers call vLLM's check_interleaved_audio_video from embed_input_ids on every step that carries multimodal placeholders. It walks every video and audio placeholder in Python and reads two positions back per token. Qwen3-Omni passes CUDA masks, so each read is a device sync: on A800, 170.87 ms per call for a request with a 6600-token video and 750 audio tokens, 342.62 ms for twice that. Qwen2.5-Omni keeps its masks on CPU, where the same loop takes 34.58 ms. Compute the same per-span result with nonzero, cumsum and scatter_reduce, reading back only the nonzero size and the final flag, and use it from the Qwen2.5-Omni and Qwen3-Omni thinkers. Co-authored-by: zijianc2 <157244773+zijianc2@users.noreply.github.com> Co-authored-by: Yifan Tian <221685243+Sendoh-code@users.noreply.github.com> Signed-off-by: MrlixiangWE <mrdanaer@gmail.com>
|
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 @MrlixiangWE, 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 routing recordAssigned Strict on cursor (cursor-grok-4.6-high) under experiment |
|
Self-review of
|
|
@amy-why-3459 PTAL ,thanks |
…tions (vllm-project#8629) Signed-off-by: MrlixiangWE <mrdanaer@gmail.com> Co-authored-by: zijianc2 <157244773+zijianc2@users.noreply.github.com> Co-authored-by: Yifan Tian <221685243+Sendoh-code@users.noreply.github.com> Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
Purpose
check_interleaved_audio_videoin the Qwen3-Omni thinker calls.item()14,698 times, each a CPU sync on the CUDA masks, and takes 171.35 ms. The same result needs only two host reads.Propose
vllm_omni/model_executor/models/common/audio_in_video.py: the same per-span result computed withnonzero,cumsumandscatter_reduce, with two host reads per call.Test Plan
vLLM-Omni Commit:
aadb0b4, on main3e705fc. Environment: vLLM 0.31.0, PyTorch 2.13.0+cu130, 2x A800 80GB (PCIe).Default deploy configs, fresh server per run, order main / this PR / this PR / main. The check alone: median of 20 calls after 3 warmups, synchronized. Answers: Daily-Omni videos with
mm_processor_kwargs={"use_audio_in_video": true},temperature=0,max_tokens=16, text output, concurrency 10. Probe: a wrapper that also runs vLLM's original on every call with both video and audio tokens and logs both results. Serving, answer and probe runs used earlier commits of this branch whose production code differs from this head only in a variable name, comments and formatting.Test Result
The check alone, one call (video, then audio as a separate item):
Qwen3-Omni-30B-A3B, Daily-Omni, concurrency 10, mean of two runs each:
Greedy answers,
use_audio_in_video=True, 100 Daily-Omni videos: