Specialize SM90 MoE communication and fix backward synchronization - #1463
Conversation
Separate local-only and IB-capable communication paths, fix split-backward producer/consumer rendezvous and cursor progress, and package the all-configuration external SM90 module with compatibility and resource-ownership safeguards. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
yueyiming2009
left a comment
There was a problem hiding this comment.
Build/module and forward-path review comments. I found one blocking correctness issue in the same-host X fallback; the other comments are non-blocking questions or test suggestions. I have not yet completed the backward-path review.
yueyiming2009
left a comment
There was a problem hiding this comment.
Requesting changes for the blocking same-host forward fallback issue identified inline. When TMA eligibility fails before src_x_ptr[] is fully populated (for example, an otherwise valid SM90 shape with hidden_dim=384, or an early descriptor-encoding failure), do_get<MayUseIb=true> can select the direct peer-copy branch and dereference an unset pointer instead of using the NVSHMEM fallback.
Please populate peer pointers independently of TMA descriptor eligibility, or guard the direct-copy path and retain getmem fallback. Add a same-host multi-GPU regression using a hidden dimension divisible by 8 but not 256, verify numerical parity, and rerun the existing dense/sparse plus TMA on/off targeted tests. The backward synchronization paths reviewed so far look coherent.
Remove the dead same-host forward copy fallback, reject cached module topology changes before schedule updates, include the specialization menu in the module fingerprint, and cover exporter rejection paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
continue.Communication semaphore counts and acquire/release semantics are preserved. The existing SM100-family GPU implementation is unchanged.
MoEBenchmark results: H200 and B300
Protocol: CUDA 12.9, BF16 routed-expert MoE MLP, eight microbatches, 250 ms per-timed-launch cooldown. The summary below uses T=8192 per rank and reports throughput in TFLOP/s per GPU. Sixteen GPUs means two hosts with eight GPUs each. Shared experts and attention are not included in the benchmark FLOP count.
Representative backend comparisons
Each cell below is forward / backward TFLOP/s per GPU for Qwen3-30B-A3B at T=8192.
This is not a claim of a uniform win across models. For example, at eight GPUs, Scout backward is 340.12 versus TE's 443.46 TFLOP/s on H200, and 714.04 versus 805.15 on B300. At sixteen B300 GPUs, Scout backward is close to TE: 647.42 versus 653.07 TFLOP/s.
Coverage and limitations
The named-model campaigns above are separate from the completed fixed
eight-GPU sweeps below.
Additional eight-GPU sweeps
T=1024/2048/4096/8192/16384. The final dataset contains 224 new attempts plus
56 accepted T=8192 rows from the immutable named-model campaign: 280 rows,
ten LaTeX tables, 63 PNG/PDF/EPS plots, and zero missing cases.
E in {8,16,32,64,128}, and K in {1,2,4,8} with K<E: 38 configurations and
304/304 finite-positive attempts. Forward includes TE, DeepEP, Comet,
FlashMoE and Liger; backward includes TE, DeepEP and Liger. Liger is fastest
in 38/38 forward rows with a 1.388x geometric-mean speedup over the fastest
comparison backend. It is fastest in 29/38 backward rows with a 1.103x
geometric-mean speedup over the fastest comparison backend.
Liger in both directions: 228/228 finite-positive attempts. Liger is fastest
in 38/38 forward rows and 38/38 backward rows, with geometric-mean speedups
of 1.880x forward and 1.406x backward over the fastest comparison backend.
Both generated tables contain only the three deployed B300 backends; Comet
and FlashMoE are omitted for the availability reasons documented above.
SM100 regression comparison
A separate, protocol-matched historical comparison uses one microbatch and 250 ms cooldown on both mainline and candidate. Across 330 numeric Liger comparisons, GPU-count/direction geometric-mean throughput ratios range from approximately 0.9955 to 1.0090. The largest individual decrease is 4.81% for eight-GPU Qwen3-30B-A3B at T8192; no individual comparison is more than 5% lower. These are single-run comparisons, not confidence intervals or a claim that every measurement improved.
The candidate's per-host benchmark/core hashes match the SM100 artifacts used for the final campaign. Both sides of the historical sixteen-GPU comparison used the same older four-NIC mapping; those historical values are not mixed into the corrected-affinity, eight-microbatch table above. The comparison shows no broad SM100 throughput loss, while keeping protocol changes and run-to-run variation explicit.
Testing Done
Hardware: NVIDIA H200 (SM90) and NVIDIA B300 SXM6 (SM100-family,
sm_103a).eight-GPU parameter grids completed with the coverage above.
test_cute_build.pyandtest_export_nonrdc_nvshmem_ptx.py: thirteen tests passed,including duplicate-symbol, missing-SETMAXNREG, and identical-path rejection coverage.
test_moe_bindings.py: six tests passed and the explicit NVSHMEM-runtime placeholderremained skipped; changed topology is rejected before either schedule is rewritten.
test_moe_fwd_bwd_cuda_graph: dense and sparse routing passed with TMA enabled andwith the IB-capable getmem fallback forced (four cases total, two H200 GPUs).
12.9 Release flags in 44m16s. It removes the dead same-host forward copy path,
validates cached topology before schedule updates, and fingerprints the selected
specialization menu.
Repository-wide checklist:
make test: not rerun; targeted native/CUDA/reference coverage is listed above.make checkstyle: targeted non-mutating Ruff checks were used instead of the repository-wide auto-fixing target.make test-convergence: not run; this change concerns the native MoE implementation, not the Transformers integration.