perf(sampler): replace MRV2 O(B) seeded multinomial with batched Gumbel and add Qwen2.5 152064 hints #380
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.388
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #380"
general
weight: 0.35
yeahdongcn
Summary
1. Replace MRV2's
O(B)sequentialtorch.multinomialloop with batched statelessgumbel_sample(vllm_musa/v1/sample/topk_topp_sampler.py):-
sample_worker_logits_seeded_multinomialwas introduced as a v0.22 workaround when upstreamgumbel_sampleunconditionally cast totl.float64(unsupported on MUSA). Upstreamv0.32.0gumbel_sampleuses 32-bit Murmur3 (murmur3_uniform32+_log1p_neg_stable,use_fp64=False), andSamplingStatesalready populatesseeds.gpuandposfor every request.- Adds
can_use_worker_seeded_gumbel+sample_worker_logits_seeded_gumbelahead ofcan_use_worker_seeded_multinomialin_worker_sampleso all MRV2 user-seeded batches (not use_fp64_gumbel,logprobs_mode not in ("processed_logits", "processed_logprobs"),temperature > 1e-5) across all model vocabularies and dtypes run a single batched statelessgumbel_samplelaunch instead of materializing a full[B, V]FP32softmaxtensor and launchingBsequentialtorch.multinomialkernels in Python.- Includes a zero-copy
bf16fast path whennot np.any(needs_logits_processing[idx_mapping_np]), single-copy in-place filtering (preserve_processed_logits=False) otherwise, and evicts stalemusa_generatorson_sampling_states_add_requestwithout eagerly allocatingtorch.Generator(device="musa")unless the legacy fallback is entered.2. Add Qwen2.5
152064vocabulary to CPU-sidegpu_input_batch.pyhints (series/0082):- Aligns
uniform_top_kanduniform_temperaturevocab gates invllm/v1/worker/gpu_input_batch.pyfrom(151936, 248320)to(151936, 152064, 248320), matching_MUSA_QWEN_SAMPLER_VOCAB_SIZESandvllm_musa/optimization_contract/qwen.py.S5000 Hardware Evidence
2 × MTT S5000(80 GiB,mp_count=64, driver5.2.0-server), imagesh-harbor.mthreads.com/mcctest/vllm:v0.32.0-ph1-5.2.0-torch2.13.0.post1-20261126(torch 2.13.0.post1+musa5.2.0,torchada 0.1.111,mate 0.2.8.post1).256 MiBL2 flush, 46/46 bit-exact deterministic):| Vocab | Mode |
B=1Base -> Cand (Speedup) |B=16Base -> Cand (Speedup) |B=64Base -> Cand (Speedup) |B=128Base -> Cand (Speedup) ||---|---|---:|---:|---:|---:|
|
Qwen3-151936|filtered(T=0.7, top_k=50, top_p=0.95) |0.80 -> 0.47 ms(1.72x) |6.93 -> 0.76 ms(9.12x) |25.70 -> 1.01 ms(25.45x) |51.91 -> 1.61 ms(32.31x) ||
Qwen3-151936|unfiltered(T=1.0) |0.46 -> 0.036 ms(12.93x) |6.20 -> 0.069 ms(89.81x) |25.06 -> 0.24 ms(104.77x) |50.79 -> 0.47 ms(108.53x) ||
Qwen2.5-152064|filtered|0.78 -> 0.47 ms(1.67x) |6.97 -> 0.76 ms(9.18x) |25.91 -> 1.00 ms(25.81x) |52.61 -> 1.60 ms(32.81x) ||
Qwen2.5-152064|unfiltered|0.46 -> 0.036 ms(12.96x) |6.20 -> 0.068 ms(90.68x) |25.08 -> 0.24 ms(104.14x) |50.83 -> 0.47 ms(108.65x) ||
Qwen3.5-248320|filtered|1.11 -> 0.48 ms(2.31x) |11.21 -> 1.20 ms(9.33x) |41.26 -> 1.69 ms(24.42x) |84.45 -> 2.71 ms(31.21x) ||
Qwen3.5-248320|unfiltered|0.73 -> 0.036 ms(20.05x) |9.98 -> 0.10 ms(98.13x) |41.01 -> 0.38 ms(107.19x) |82.69 -> 0.76 ms(109.45x) ||
Llama3-128256|filtered/unfiltered|0.73 -> 0.47 ms(1.56x) /0.40 -> 0.036 ms(11.01x) |7.35 -> 2.32 ms(3.17x) /5.26 -> 0.060 ms(87.22x) |26.34 -> 5.84 ms(4.51x) /21.17 -> 0.20 ms(103.99x) |53.19 -> 10.78 ms(4.93x) /42.98 -> 0.40 ms(108.68x) ||
DeepSeekV2-102400|filtered/unfiltered|0.66 -> 0.47 ms(1.41x) /0.33 -> 0.036 ms(9.04x) |6.19 -> 1.95 ms(3.18x) /4.25 -> 0.052 ms(81.19x) |21.70 -> 4.75 ms(4.57x) /16.99 -> 0.17 ms(102.70x) |43.18 -> 8.74 ms(4.94x) /34.55 -> 0.32 ms(108.04x) |vllm serveA/B (Qwen3-8BBF16, TP=2,CUDAGraphMode.FULL_AND_PIECEWISE,max_tokens=192, userseedon every request):| Mode | Concurrency | Baseline (
O(B)Multinomial) | Candidate (Batched Stateless Gumbel) | Throughput Gain | Mean TPOT (Base -> Cand) ||---|---:|---:|---:|---:|---:|
|
filtered(T=0.7, top_k=50, top_p=0.95) |1|107.06 tok/s|108.84 tok/s|+1.66%|9.29 -> 9.14 ms||
filtered|16|1298.35 tok/s|1483.46 tok/s|+14.26%|12.11 -> 10.57 ms||
filtered|32|2198.37 tok/s|2759.57 tok/s|+25.53%|14.21 -> 11.26 ms||
filtered|64|3311.23 tok/s|4846.32 tok/s|+46.36%|18.79 -> 12.66 ms||
filtered|128|3986.68 tok/s|7022.86 tok/s|+76.16%|31.18 -> 17.35 ms||
unfiltered(T=1.0) |32|2292.49 tok/s|2933.73 tok/s|+27.97%|13.59 -> 10.58 ms||
unfiltered|64|3394.24 tok/s|5147.17 tok/s|+51.64%|18.27 -> 11.93 ms||
unfiltered|128|4065.01 tok/s|7260.24 tok/s|+78.60%|30.57 -> 16.75 ms|Validation & Regression Matrix
musa_sync check-series,check-series --replay,verify(219/219series clean),ruff check,ruff format --check, andgit diff --check: PASS40 passedoffline +62 passedon S5000 (test_mrv2_batched_seeded_gumbel.py,test_sampler_cpu_state_fast_paths.py,test_qwen_unit_temperature_source.py,test_qwen_sampler_model_traits_source.py,test_default_on_dispatch_parity.py): PASS-
Qwen3-8B(Dense,FLASH_ATTN): PASS (4/4seeded exact)-
Qwen3.5-35B-A3B-FP8(Hybrid GDN + FP8 MoE,FLASH_ATTN+DEEPGEMM): PASS-
DeepSeek-V2-Lite-Chat(MLA + MoE): PASS (4/4seeded exact)