Perf(qwen3-tts): fuse CodePredictor RoPE and reuse decode masks - #204
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Optimizes the Qwen3-TTS autoregressive generation path.
apply_rope_pos_idskernel.suppress_eosflag into the CUDA Graph.On an NVIDIA H20, CodePredictor CUDA Graph latency decreased by 35.8-36.9%, end-to-end latency decreased by 4.1-4.4%, and worker GPU memory decreased by about 1.5%.
How was it tested?
.venv/bin/ruff check ..venv/bin/pytest -q test/modular/test_qwen3_tts_model.py(35 passed)CUDA_VISIBLE_DEVICES=0 HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 .venv/bin/pytest -q test/integration/test_qwen3_tts_real_weights.py(5 passed)Performance results
Measured with
Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoiceon one NVIDIA H20:The CodePredictor improvement was 35.8-36.9% across BS=1/2/4/8. At concurrency 2, throughput improved by 2.9%; concurrency 4 and 8 were saturated and showed no statistically clear gain or regression. Three natural-EOS requests produced non-empty audio and stopped before
talker_max_tokens.Checklist
ruff check .passes