Repository navigation
Conversation
DeepSeek-V4.1-Flash served with the shared expert fused into the MoE (SGLang --enforce-shared-experts-fusion) runs 385 experts / top-7 (target) and 129 / top-4 (DSpark draft) at TP4 inter 640, which had no tuned rows and fell back to the heuristic. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
| gfx950,256,16384,5120,1152,384,6,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fn,torch.float4_e2m1fn_x2,QuantType.per_1x32,1,0,128,0,1280.4706,flydsl_moe1_afp8_wfp4_bf16_t128x128x256_w3_bnt0_gui_fp8,0.0%,877.0679,flydsl_moe2_layout_afp8_wfp4_bf16_t64x256x128_atomic_sbm128,0.0%,2157.5385,0,0,0,1612.45,3265.96,0 | ||
| gfx950,256,32768,5120,1152,384,6,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fn,torch.float4_e2m1fn_x2,QuantType.per_1x32,1,0,128,0,2459.5951,flydsl_moe1_afp8_wfp4_bf16_t128x128x256_w3_bnt0_gui_fp8,0.0%,1626.4346,flydsl_moe2_layout_afp8_wfp4_bf16_t64x256x128_atomic_sbm128,0.0%,4086.0297,0,0,0,1702.84,1786.11,0 | ||
| gfx950,256,1,5120,640,385,7,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fn,torch.float4_e2m1fn_x2,QuantType.per_1x32,1,0,32,0,18.6867,flydsl_moe1_afp8_wfp4_bf16_t32x64x256_w4_gui_kw4,0.0%,10.992,flydsl_moe2_afp8_wfp4_bf16_t32x128x128_reduce_bnt2,0.0%,35.1,0,0,0,0,0,0 | ||
| gfx950,256,32,5120,640,385,7,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fn,torch.float4_e2m1fn_x2,QuantType.per_1x32,1,0,16,0,103.7206,flydsl_moe1_afp8_wfp4_bf16_t16x128x256_w4_gui,0.0%,57.0628,flydsl_moe2_afp8_wfp4_bf16_t16x128x128_reduce_persist,0.0%,135.5,0,0,0,0,0,0 |
There was a problem hiding this comment.
us1(57)+us2(135)> us(135.5)
There was a problem hiding this comment.
Fixed the inconsistent metadata in 4877cea (current head 3d91219). The three rows with contradictory stage measurements now leave us1/us2/err1/err2 blank, like the other whole-operator-measured rows. us remains the historical whole-MoE measurement; it is not the sum of those removed stage samples. I also normalized two stage-1 names to t16x128x256, which is the tile the runtime already selected for inter_dim=640.
Current-main validation on gfx950 / ROCm 10 / PyTorch 2.11 / FlyDSL 0.4:
- Configuration merge/collision test passed.
- All eight shapes passed the repository’s strict accuracy gate using synthetic weights, 64 zero-padded intermediate lanes (576→640), no bias, and SiLU limit 10. Cosine differences were 3.36e-6–6.25e-6; the elementwise 1% check did report differences, so this is the suite’s cosine-based acceptance rather than elementwise equality.
The fresh synthetic timing comparison does not reproduce the old gains consistently: three target buckets improved by roughly 1–4%, while target M=128/256 and draft M=32 were roughly 3–4% slower than today’s heuristic. Other draft buckets were essentially tied. These are short operator measurements, not the original checkpoint workload. The rows are still missing upstream, but they need a controlled retune with the production checkpoint before merge. I am keeping this open and leaving the review thread for your reassessment; the metadata correction should not be read as a new performance claim.
There was a problem hiding this comment.
Follow-up after a current-main comparison: pushed b32062ec9, removing target M=32 and M=64 and leaving six rows.
The routing pattern matters. A generic random top-k test did not consistently reproduce the original gains, but this PR targets top-6 routed experts plus an always-active shared expert (or top-3 plus shared for the draft). I repeated that routing pattern with synthetic weights, 64 zero-padded lanes, explicit FP8 activations and SiLU limit 10, on current main 1dd826c42 / gfx950 MI355X VF. Two seeds, six alternating timing rounds each, 31 graph replays per arm, ten whole-MoE calls per replay.
Target M=1/128/256 improved 1.2–3.2%; draft M=1/2/32 improved 6.0–11.2%. Target M=32 was inconclusive across seeds, and M=64 was about 3.9% slower in both, so those rows are removed. The body has the per-shape timings and retains the distinction between whole-op and per-stage measurements.
All shapes passed the repository's strict numerical criterion without NaNs in both shared-routing seeds. Final config merge/collision and retained-kernel dispatch checks passed; removed target shapes use main's heuristic again. These are operator results, not a current production-checkpoint/end-to-end claim. Human review and current-head CI remain outstanding.
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
|
Thanks for these rows. Our draft #6363 adds rows for the same DeepSeek-V4.1 MoE setting, and both PRs add an M=256 row, so they will conflict in |
|
Hi, Could we address the padding issue before enabling these three tile_n=64 configurations (E385/top7/M1 and E129/top4/M1,2)? I ran the original base (1dd826c) and PR head (b32062e) back-to-back on the same gfx950/CU256 GPU, using the public fused_moe entry and each revision’s natural configuration selection—no tile overrides. With finite inputs, zero-padded weights, and the stage1 output workspace pre-filled with Inf to expose uninitialized reads:
For inter_dim=640 and intermediate_pad=64, the new stage1 configurations write only 19 × 32 = 608 columns. The remaining a2[..., 608:640] retains the workspace contents, but quantization and stage2 still consume those columns. The resulting NaNs reach the final [M, 5120] tensor returned by fused_moe, without an exception. The base selects tile_n=128 / k_wave=1 and overwrites the full consumed width. On head, clearing only a2[..., 608:640] before quantization restores results bitwise identical to the zero-initialized control. Since the two source trees differ only in these CSV files, the new tuning rows expose an existing kernel padding bug. Please fix the GUI grid calculation or initialize the consumed padding and add a regression test. Alternatively, remove or retune these three rows before merging. Tested with PyTorch 2.10 / ROCm 7.2.4 / FlyDSL 0.4.0. This is an Inf-poison reproduction, not a claim that every ordinary invocation fails; NaN-only poisoning did not fail on this head |
|
No activity for 15 days, so this is now labelled |
Summary
Add six gfx950 TP4 A8W4 tuning rows for DeepSeek-V4.1-Flash with the shared expert fused into routed MoE: target 385 experts/top-7 at M=1,128,256 and draft 129 experts/top-4 at M=1,2,32. Each has model_dim=5120, inter_dim=640 (576 plus 64 zero-padded lanes), interleaved gate/up and SiLU limit 10. Matching untuned shapes are included.
Current SGLang explicitly uses FP8 activations for V4.1 on gfx950, so these remain applicable after the BF16-bound workaround was removed. These are different shapes from the unfused 384/6 and 128/3 rows already upstream.
Revalidation against current main
Base:
1dd826c42. Device: otherwise idle MI355X VF, gfx950 / 256 CUs, ROCm 10 / PyTorch 2.11 / FlyDSL 0.4.Use the production
fused_moedispatcher with explicit FP8 activations. The baseline is the merged main config: remove only the PR's new keys, preserving all other upstream rows and the heuristic. Identical tensors are used for both arms. Capture ten whole-MoE calls per CUDA graph; measure 31 replays per arm in each of six alternating rounds, excluding warm-up/JIT. Report the median of round medians. Repeat with seeds 42 and 123.Weights are synthetic. Routing always includes the last shared expert: top-6 among 384 routed experts plus shared, or top-3 among 128 plus shared. This matters: the earlier generic synthetic test sampled all top-k experts randomly, which did not reproduce this PR's shared-expert workload.
Dropped target M=32 (1.0% gain in one seed, tied in the other) and M=64 (about 3.9% slower in both). The six retained choices are unchanged. CSV
usvalues remain historical measurements; per-stage timing/error fields remain blank where no consistent stage measurements exist.Correctness and limits