Repository navigation
[DSV4.1] Reduce mHC, metadata and small-batch router overhead - #39704
Conversation
|
/rerun-test test/registered/e2e/models/test_gpt_oss_sm120.py |
|
Results for 🚀 |
|
/rerun-test test/registered/moe/test_fused_moe.py |
|
Results for 🚀 |
|
/rerun-test test/registered/moe/test_fused_moe.py |
|
Results for 🚀 |
|
/rerun-test test/registered/kernels/ops/attention/test_fp4_indexer.py test/registered/kernels/ops/layernorm/test_mhc_kernels.py test/registered/kernels/ops/moe/test_moe_fused_gate.py test/registered/kernels/ops/communication/test_custom_all_reduce.py test/registered/spec/dspark/test_dspark_kernel_parity.py test/registered/unit/model_executor/test_compensated_mhc_update_guard.py test/registered/unit/models/test_deepseek_v4_shared_expert_fusion.py test/registered/unit/models/test_deepseek_v4_mxfp4_shared_expert_requant.py |
|
Results for 🚀 🚀 🚀 🚀 |
|
/rerun-test test/registered/moe/test_fused_moe.py |
|
Results for 🚀 |
|
/rerun-test test/registered/unit/layers/test_layer_communicator_fusion_gate.py |
|
Results for 🚀 |
|
/rerun-test test/registered/kernels/ops/attention/test_fp4_indexer.py test/registered/kernels/ops/layernorm/test_mhc_kernels.py test/registered/kernels/ops/moe/test_moe_fused_gate.py test/registered/kernels/ops/communication/test_custom_all_reduce.py test/registered/spec/dspark/test_dspark_kernel_parity.py test/registered/unit/model_executor/test_compensated_mhc_update_guard.py test/registered/unit/models/test_deepseek_v4_shared_expert_fusion.py test/registered/unit/models/test_deepseek_v4_mxfp4_shared_expert_requant.py test/registered/unit/managers/test_disagg_idle_step_counters.py |
|
Results for 🚀 🚀 🚀 🚀 |
Motivation
DeepSeek-V4.1 DSpark verify batches at concurrency 32/64 contain up to 192/384 rows. This reduces mHC boundary, communication, indexer quantization and speculative metadata overhead for those workloads without changing the deployment command.
Modifications
This builds on #39370. Compensated mHC and existing small-row paths are retained. There are no new environment variables or CLI flags, and no attention arithmetic changes. The experimental medium RMSNorm/MXFP8 fusion is excluded from this PR.
Accuracy Tests
Unset both
SGLANG_SIMULATE_ACC_*variables before launching each evaluation server; their absence is also verified in the serving process environment. All other deployment settings remain identical. Frozen prompts/datasets/clients are shared between arms. GSM8K: 1,314 held-out test problems after excluding five few-shot examples, temperature 0, seed 0, max output 4,096. AIME 2026: all 30 problems. GPQA Diamond: all 198 problems. AIME/GPQA: thinking enabled, reasoning effort max, temperature 0, seed 0, top_p 0.95, max output 65,536. Client concurrency is 64 (AIME has only 30 distinct requests). Two independent starts per arm, with all scores, truncations, request errors and per-question transitions retained.Correct answers from both fresh-server runs (a / b):
All evaluation requests completed without errors. Output-limit truncations (a / b):
The GPQA paired difference reverses from −8 to +6 questions; its two-run mean is one question lower, while the baseline itself varies by nine questions. This does not establish accuracy equivalence. Per-question inspection found 11 losses / 3 gains in pair a and 1 loss / 7 gains in pair b. GPQA question 8 was lost in both pairs with candidate truncation; two nontruncated wrong choices in pair a (85 and 127) are correct in candidate run b. All counts, including truncations, remain in the reported scores. All 198 GPQA problems are included in each run.
Additional real-acceptance control: submit the same frozen 4,096-token input IDs in one native
/generatebatch, temperature 0 / sampling seed 0, flush between two 1,024-token replays. Exact full-sequence matches:The cross-version mismatch count is comparable to within-version variation in this control. Among sequences that are identical across both replays within each arm (25 at BS32 and 42 at BS64), none differ between arms. Grouped input reduces arrival differences but does not force identical physical batches at every decoding step; this is a token-sequence diagnostic on a frozen corpus, not an additional accuracy benchmark or proof of equivalence.
The earlier rebased head
c797adea1epassed all 397 retained GPU test cases and a fresh-server real-acceptance check: BS32 and BS64, two grouped 1,024-token replays each, all requested prompts/output lengths verified and full-batch decode observed. Conflict-file pre-commit, syntax and CI registry checks also passed. The frozen A/B scores above are not relabeled as measurements of this rebased commit.Speed Tests and Profiling
Output throughput, tokens/s; both measurements are retained:
Every run completed all 1,024 requests and generated 1,048,576 output tokens. Even the slowest candidate exceeds the fastest baseline by 4.98% at C32 and 5.48% at C64.
Original CPU+GPU profiler traces were checked on all four ranks using launch correlation and 80 mHC sinkhorn anchors to identify a complete target graph. Kernel counts per target launch fall from 1,835 to 1,581 at C32 and from 1,834 to 1,580 at C64. Active CUDA streams stay 5 → 5 on every rank. The two profiled MoE BMM kernel names and their 40 calls each also match between arms. Profiled graph wall time is not used as serving latency.
Performance protocol and command
TP4/EP4/DP1, unchanged static DSpark block size 5, simulated acceptance length 5.4. 1,024 measured requests, each 4,096 input / 1,024 output tokens, concurrency 32 or 64, matching warmup count, all output tokens required. Two fresh starts per arm/batch with reversed order on the repeat; retain every measurement. These throughput results use simulated acceptance and are separate from the real-acceptance accuracy evaluations.
Server (both arms):
The measured runs use a frozen token-ID corpus (SHA256
1f8e67cba16f9fa16573286775db9a2353fc4c42006695ba63c3515c7b2401f3) and a pinned official client with only dataset loading and timing recording replaced. A comparable standard random benchmark uses:Validation Environment and Commit Provenance
Full A/B validation: base
6cf7203cab34831740f560e32b2413b7b70e95d2, candidatee289b1ebec43150de9530bf46d5c907013d3964d.Current PR head:
74b97e796d10aca41ac76274259a82bdf99f7ea5, rebased ontodsv4.1commitd71c438fdd0673185ae58fb2fc11263d7bd689f3.This conflict resolution retains upstream's
row_argmax(x)API andMoeFinalizeAllReduceParams/RowClusterTraitnames. PR-specific prefill-stats, medium-page-table and combine/all-reduce tests now live in dedicated modules; upstream-deleted generic tests are not restored. The multi-GPU test's precompile hook now calls the existing JIT entry point because upstream removed the old helper. Across all 13 production files, the patch's added/removed lines match the previous PR after accounting for upstream symbol/module renames; all five argmax kernel function ASTs are unchanged. Upstream import consolidation, padding metadata and prefill-autotune changes are preserved.Conflict-repair validation on 4×GB300: 202 targeted GPU test cases passed: 26 medium-argmax, 42 medium-page-table, 69 small-metadata, 3 post/combine test methods, 6 prefill-statistics and 48 FP4-indexer cases, plus 8 graph-replay combine/all-reduce cases across all four ranks. The first six groups ran on
6e7793c2736c383c62e1cd96e2da25da987185b1; the final head differs only in the communication test's precompile hook, and its four-rank group passed on74b97e796d. Changed-file pre-commit checks passed. The initial communication test attempt stopped before kernel execution because of the removed precompile helper; it passed after that test-only adaptation.The throughput and full accuracy tables retain their frozen A/B commit provenance above; full serving throughput, benchmark-suite accuracy and the real-acceptance serving control were not rerun as part of this conflict repair.
Hardware: 4×GB300, SM103, 2070 MHz / 1400 W. Same checkpoint revision
dba1be0a40aa45a94ad051997016db3960a90277, torch 2.13.0+cu130, Triton 3.7.1, FlashInfer 0.6.18, sglang-kernel 0.4.7, sgl-deep-gemm 0.2.0. Each arm uses a clean checkout and fresh server, with all eight target/draft autotune cache files restored before each run. GPU jobs are serial.All 415 targeted GPU test cases passed on the frozen candidate commit: 5 mHC boundary/normalization methods, 57 compensated-mHC cases, 128 finalize/all-reduce cases on each of four ranks, 135 metadata cases, 42 argmax cases and 48 FP4 indexer cases. Changed-file pre-commit passed.
The added tests cover BF16 representation equality at post/combine boundaries, comparison with the actual prefill model path, changed-input CUDA Graph replays, delayed ranks and interleaved communicator counters, existing compensated mHC, metadata tails, argmax ties/NaNs/Infs and exact FP4 codes/scales.
Checklist
CI States
Latest PR Test (Base): 🚫 Run #35437055512
Latest PR Test (Extra): ✅ Run #35442191059
Latest PR Test (AMD ROCm 10): 🚫 Run #35437055355