perf(musa): optimize Qwen2 decode for CosyVoice3#117
Merged
Conversation
yeahdongcn
marked this pull request as ready for review
July 24, 2026 06:01
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.
Summary
Triton launch;
strings remain outside Inductor graphs and compiled pieces stay reusable;
and tensor-layout paths on the existing implementation.
This PR changes vLLM-MUSA only. vLLM-Omni is an integration test path, not an
implementation dependency or patch target.
Why the rewrite is pre-split
The first post-grad prototype fused correctly but caused about 95.6 seconds of
cold compilation because 24 layer-name strings produced non-reusable pieces.
The accepted raw-FX rewrite requires all 24 exact sites to match before any
mutation, adds the fused outer op as a split, and retains the original KV split
as a fail-closed fallback.
The accepted path restores compile plus initial warmup to 5.90 seconds on the
development container and produces only four reusable compile artifacts. It is
exact-gated and default-on; no serving flag is required. The environment switch
is retained only as an A/B and emergency-disable escape hatch.
Performance
Single S5000, BF16, FlashAttention-3, normal vLLM compile/FULL graph capture,
357 input tokens, fixed 1024 output tokens (40.96-second audio proxy),
temperature 1.0, repetition penalty 1.0001. Two alternating same-host rounds,
three measured requests per cell after one warmup:
Combined mean gain: 2.94%; combined median gain: 2.88%. Both paired rounds are
positive. A deterministic token-identical A/B improves mean RTF from 0.077270
to 0.067954 (12.06%), isolating launch-heavy LLM decode from sampling cost.
A candidate MUPTI activity trace confirms the production path retains all
three native BF16 TCE GEMM families with the expected 2:1:1 call ratio. The
accepted fused kernel averages 4.445 us over the captured startup, graph,
warmup, and measured-request scope. Generated Inductor artifacts use external
addmm/mm kernels and do not Triton-lower the GEMMs.
Validation
fallback, and completed 256 deterministic decode tokens with checksum
953984;
in all six measured requests;
unrelated FP8-MoE/format-patch failures reproduce from the pre-overlay source
archive;
baseline findings in flash_attn.py.
Not run / Draft status
downstream CosyVoice integration provider;
Keep this PR in Draft until those external gates complete.