Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions benchmarks/single_node/agentic/dsv4_fp4_b300_sglang_mtp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ if [ "$DP_ATTENTION" = "true" ]; then
--dist-init-addr "127.0.0.1:$((PORT + 2000))"
--ep-size "$EP_SIZE"
--moe-a2a-backend megamoe
# sgl-project/sglang#35918 replaced SGLANG_OPT_DEEPGEMM_MEGA_MOE_USE_FP4_ACTS
# /_USE_MXF4_KIND with this flag; on newer builds the env vars only print a
# deprecation warning and forward nothing, so without it MegaMoE silently
# falls back from the FP4-acts kernel to the default FP8-acts JIT path.
--enable-w4a4-mxfp4-megamoe
--enable-deepseek-v4-fp4-indexer
--disable-flashinfer-autotune
)
Expand Down Expand Up @@ -221,8 +226,10 @@ export SGLANG_OPT_USE_CUSTOM_ALL_REDUCE_V2=1
if [ "$DP_ATTENTION" = "true" ]; then
# MegaMoE's FP4/MXF4 activation path is opt-in -- both flags default False,
# so --moe-a2a-backend megamoe alone runs a different kernel than the one
# measured. DG_USE_FP4_ACTS / DG_USE_MXF4_KIND are forwarded to DeepGEMM
# automatically from these two.
# measured. On builds predating sgl-project/sglang#35918 these two env vars
# are what forwards DG_USE_FP4_ACTS / DG_USE_MXF4_KIND to DeepGEMM; on newer
# builds they are deprecated no-ops and --enable-w4a4-mxfp4-megamoe (passed
# above) carries the forwarding. Export both so the recipe works on either.
Comment on lines +229 to +232

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 WARNING: The claim "Export both so the recipe works on either" is not accurate — the recipe does not work on pre-#35918 images.

Why it matters: --enable-w4a4-mxfp4-megamoe is passed unconditionally on the DP-attention path (line 135). On any image predating sgl-project/sglang#35918, argparse will reject it as an unrecognized argument and the server will refuse to start — the env exports never get a chance to matter. If someone rolls the image back (a common move in this repo when a nightly regresses), the DP lane fails at launch, and this comment tells them it's safe.

Fix: Correct the comment so a future rollback isn't attempted on the strength of it:

Suggested change
# measured. On builds predating sgl-project/sglang#35918 these two env vars
# are what forwards DG_USE_FP4_ACTS / DG_USE_MXF4_KIND to DeepGEMM; on newer
# builds they are deprecated no-ops and --enable-w4a4-mxfp4-megamoe (passed
# above) carries the forwarding. Export both so the recipe works on either.
# measured. On builds predating sgl-project/sglang#35918 these two env vars
# are what forwards DG_USE_FP4_ACTS / DG_USE_MXF4_KIND to DeepGEMM; on newer
# builds they are deprecated no-ops and --enable-w4a4-mxfp4-megamoe (passed
# above) carries the forwarding. NOTE: pre-#35918 images reject that flag at
# argparse time, so rolling the image back also requires dropping the flag;
# these exports alone are not enough.

(Alternatively, gate the flag on a --help probe of sglang.launch_server, but fixing the comment is enough given the config pins a post-#35918 image.)

export SGLANG_OPT_DEEPGEMM_MEGA_MOE_USE_FP4_ACTS=1
export SGLANG_OPT_DEEPGEMM_MEGA_MOE_USE_MXF4_KIND=1
# Must cover the per-rank prefill budget (8192) or startup raises; the
Expand Down
4 changes: 2 additions & 2 deletions configs/nvidia-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ dsv4-fp4-b300-sglang-agentic-hicache-mtp:
image: lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1
model: deepseek-ai/DeepSeek-V4-Pro
model-prefix: dsv4
runner: cluster:b300-nv
runner: cluster:b300-dsxe
precision: fp4
framework: sglang
multinode: false
Expand All @@ -1167,7 +1167,7 @@ dsv4-fp4-b300-sglang-agentic-hicache-mtp:
- dram-utilization: 0.95
search-space:
- { tp: 8, kv-offloading: none, spec-decoding: mtp, conc-list: [1, 4, 8, 16, 32] }
- { tp: 8, ep: 8, dp-attn: true, kv-offloading: dram, kv-offload-backend: { name: hicache }, spec-decoding: mtp, conc-list: [32, 256, 384, 512, 576], router: { name: sglang-router, version: "0.3.2" } }
- { tp: 8, ep: 8, dp-attn: true, kv-offloading: dram, kv-offload-backend: { name: hicache }, spec-decoding: mtp, conc-list: [32, 64, 128, 256, 384, 512, 576], router: { name: sglang-router, version: "0.3.2" } }

# DeepSeek-V4-Pro on B300 with EAGLE/MTP speculative decoding. Recipe is
# selected inside benchmarks/single_node/dsv4_fp4_b300_sglang_mtp.sh by
Expand Down
13 changes: 13 additions & 0 deletions perf-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6921,3 +6921,16 @@
- "Pick up the latest automatic ROCm DeepSeek-V4 optimizations, including fused mHC post/pre plus RMSNorm, gfx950 C4A top-k dispatch, fused C4 compressor GEMMs, fused SWA q/kv RMSNorm plus q FP8 quantization, and medium-batch cooperative top-k tuning."
- "Keep the existing VLLM_ROCM_USE_AITER=1, VLLM_ROCM_USE_AITER_MOE=1, and --moe-backend aiter settings, and explicitly add VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=1 plus VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4 to both STP and MTP paths. The current checkpoint's shared-expert path does not satisfy the latest vLLM fusion conditions, so that fusion flag self-disables while preserving recipe parity."
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2792

- config-keys:
- dsv4-fp4-b300-sglang-agentic-hicache-mtp
scenario-type:
- agentic-coding
description:
- "Pass --enable-w4a4-mxfp4-megamoe on the DP-attention path. sgl-project/sglang#35918 (first shipped in lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1, the image pinned by #2759) replaced SGLANG_OPT_DEEPGEMM_MEGA_MOE_USE_FP4_ACTS / _USE_MXF4_KIND with this flag, and the _DeprecatedEnv entries it registered carry no replacement forwarding: on the new build the two env exports only print a deprecation warning and set nothing, so os.getenv('DG_USE_FP4_ACTS') in mega_moe.py stays unset and MegaMoE silently falls back from the FP4-acts kernel to the default FP8-acts JIT path. Confirmed in the run 33051183882 server log: 60 'Environment variable SGLANG_OPT_DEEPGEMM_MEGA_MOE_USE_FP4_ACTS is deprecated' warnings and enable_w4a4_mxfp4_megamoe: False in server_args, while the recipe exported both env vars."
- "Measured cost of the fallback, run 33051183882 (FP8-acts) vs run 32695861783 (FP4-acts), same recipe flags and same 3,630 s closed-loop window: conc 384 output throughput 5,351 -> 4,890 tok/s (-8.6%) and conc 256 -5.7%, with per-decode-step time +7.8% at c384 at identical batch size (24.3 vs 24.4 req/rank), identical accept length (2.485 vs 2.492), 100% CUDA-graph coverage, and ~95% prefix-cache hit in both runs; prefill input throughput on >=8192-token batches fell 4,659 -> 4,277 tok/s (-8.2%). The TP8 no-offload row (flashinfer_mxfp4, no MegaMoE) is unchanged within +/-0.3% at c1/c8/c16/c32 across the same two runs, isolating the regression to the MegaMoE path, and dcgm telemetry shows SM clocks within 1% (2,021 vs 2,003 MHz), ruling out the b300-019 -> b300-001 node swap."
- "The same fallback explains the conc-128 OOM that #2759 cut from the grid: FP8 activations double the MegaMoE dispatch workspace versus FP4, exhausting the 0.93 mem-fraction tier's headroom until deep_gemm fp8_fp4_paged_mqa_logits fails a 5.35 GiB allocation against 4.55 GiB free. With FP4 acts restored the workspace shrinks back, so this also restores concurrency 64 and 128 to the DEP8 hicache row, returning the search space from 10 points to 12; conc 64 had never been measured on this image, and both points are re-validated by this sweep."
- "Why the published c512/c576 points looked fine despite the fallback: per-step time rose there too (+17% at c512, +9% at c576) and prefill fell -6.5%, but both points are queue-bound (52-72 queued req/rank vs ~23 at c384), so slower steps pushed decode occupancy up (18.6 -> 23.8 req/rank at c512, full-KV usage 0.371 -> 0.473) and the larger batches absorbed the penalty; c384/c256 are admission-pinned at ~24 req/rank by the prefill-delayer / prefill-decode-interval 20 policy, so the step-time regression passed through 1:1. Restoring FP4 acts should shorten steps at every point; e2e at c512/c576 is expected to hold while occupancy floats back down."
- "Keep exporting the two deprecated env vars so the recipe still selects FP4 acts on pre-#35918 images; SGLANG_OPT_DEEPGEMM_MEGA_MOE_NUM_MAX_TOKENS_PER_RANK=8320 is still a live EnvInt on the new build and is unchanged."
- "Also retarget the lane from the decommissioned cluster:b300-nv (#2818) to cluster:b300-dsxe (#2826). The DSXE nodes expose available-cpu-dram-mib 3,977,095 vs 2,964,436 on the retired NV fleet; the HiCache ratio-3 host tier is sized off device KV, not total DRAM, so the tier stays ~2 TB and the extra budget is headroom only. All reference numbers above were measured on the NV fleet; this sweep is the first DSXE run for this key and doubles as the cluster A/B check."
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/2878
Loading