# Dist-MoE: Speed-of-Light Distributed Mixture-of-Experts Forward and Backward Kernels

- **ID:** 1432
- **Kind:** tool
- **URL:** https://github.com/meta-pytorch/dist_moe
- **Authors:** Meta Superintelligence Labs / Meta PyTorch. Primary author Shikai Li (core design: distributed MoE implementation, "SyncFree" execution model, activation planning/memory layers, grouped-GEMM and low-precision kernels). Open-sourced by Sanket Purandare, advised by Tianyu Liu, Natalia Gimelshein, Edward Yang. Additional contributors: Jongsoo Park, Summer Deng, Jianyu Huang, Jie Wang, Xiaozhu Meng, Vijay Thakkar, Jiecao Yu, Edward Yang, builds on earlier MXFP8 dropless CUDA-graphable MoE work by Daniel Haziza, Luca Wehrstedt, Simon Layton, Driss Guessous. Visual explainer by Shikai Li & Sanket Purandare.
- **Venue:** GitHub release (meta-pytorch org), v0.1.0 tagged 2026-10-03; repo created 2026-09-18, 11 commits, 52 stars at check — brand-new, expect rapid change.
- **Published:** 2026
- **Source:** x
- **Language:** en
- **Access:** open source
- **Added:** 2026-10-21
- **Verified:** 2026-10-21
- **Page:** https://papers.projxon.ai/entries/1432

## Summary

A library of fused communication-and-compute kernels for expert-parallel (EP) MoE on NVIDIA SM100+ (Blackwell) GPUs. The caller supplies top-k expert IDs and scores (routing itself is out of scope); a reusable context owns symmetric, peer-addressable HBM dispatch/combine buffers (NVLink) and executes dispatch → grouped expert GEMM (W13 → SwiGLU → W2) → combine as one ordered operation, with forward and backward (FPROP/DGRAD/WGRAD) kernels throughout. Precision/pipeline matrix: BF16 "standard" (training + inference); MXFP8 E4M3 in Staged (separate W13 and SwiGLU/W2 kernels) or Mega (both projections fused into one chunk-pipelined kernel with chunk-local readiness) pipelines (training + inference); NVFP4 in Staged or Mega, inference only, prepared weights. Kernels are CuTe/CUTLASS-DSL; validated stack is Linux ARM64, PyTorch 2.14 + CUDA 13.0, NCCL 2.30.7; no CPU fallback. Two mechanisms distinguish it from DeepEP (dispatch/combine comms only, no fused expert compute), MegaBlocks, DeepSeek's Mega MoE/DeepGEMM (fused forward only, no fused training backward), ByteDance Comet/Flux (no CUDA graphs on the dynamic-routing path, no packing policy), and Cursor's Mixture-of-Kittens (MoK): (1) dynamic activation packing — a planner packs saved forward state from all layers sharing an activation slot into one bounded buffer instead of reserving a per-layer budget, and it works during CUDA-graph replay; (2) dynamic, capacity-driven recompute — when the slot budget is exhausted the planner keeps mandatory layer inputs and rebuilds the remaining intermediates in backward, decided by device predicates so the host launches one fixed, graph-stable sequence (soft limit; scratch overflow without VMM host-backed overflow is a hard error). Also: full CUDA-graph support and non-strict make_fx (full torch.compile/strict export explicitly NOT supported), fused post-expert RMSNorm + score weighting + top-k reduction, clamped SwiGLU, in-place WGRAD accumulation into standard parameter.grad, and no shared-expert branch required — routed-only execution, -1 expert ID disables a route (MoK's reviewed API, by contrast, requires shared-expert weights). TorchTitan integration: a DistMoeTransform swaps stock RoutedExperts for the Dist-MoE backend in place (same GroupedLinear parameter layout, so FSDP/optimizer/checkpoint ownership is unchanged; requires mixed_precision_param="bfloat16"), plus a rank-wide DistMoeRuntime.Config (scratch/activation-slot capacity factors, VMM factor, pipeline-parallel slot policy); verified 671B DeepSeek-V3 recipes ship in torchtitan_recipes, MXFP8 Mega fused inference is wired for RL generators, and NVFP4 inference is in the library but not yet exposed by TorchTitan. Benchmarks — ALL Meta-reported, GB300 NVL72, no independent replication: "useful" throughput counts only real GEMM FLOPs (fwd = 6·T·K·D·F per GPU; bwd = 2× fwd), excluding padding and replay work, divided by whole-layer iteration time (median of five 30-iteration CUDA-graph windows, slowest rank; comm/quantization/padding time stays in the denominator). Headline MoK comparison (both implementations given one BF16 shared expert, D=7,168, 384 experts, top-6, 2,048 tokens/GPU, CUDA graphs on): up to 1.40× over MoK — specifically the synthetic ten-layer packing training workload under per-layer routing imbalance (MXFP8, EP64), where Dist-MoE packed all ten layers' saved state at capacity factor 2.5 with zero capacity-induced recompute (peak allocation 49.73 GiB vs MoK 48.37 GiB); Meta notes the experiment does not isolate how much of the gain is avoided recompute alone. MoK was chosen as baseline because Cursor's published single-layer NVL72 results lead the other OSS stacks (DeepEP+PyTorch, DeepEP+TransformerEngine, HybridEP+Megatron). Separate standalone suite (zero shared experts, one routed layer): 3.09 useful PFLOP/s per GPU NVFP4 Mega inference (EP16), 1.86 MXFP8 Staged training (EP64), 1.27 BF16 training (EP64) — vs dense datasheet peaks of 15/5/2.5 PFLOP/s respectively. Imbalance scaling is sub-linear: NVFP4 inference EP16, 8× received rows on the busiest GPU → 4.82× iteration time (~40% lower time per received row). Stated limitations: SM100+ only; no NVFP4 training, MXFP8 E5M2, MXFP4, A8W4, communication quantization, or expert borrowing in this release; the explainer itself discloses that EP32/EP64 training ran at different sites, some allocations shared an NVLink fabric with unconfirmed timing overlap (not uncontended-peak evidence), and HBM byte rates are modeled, not measured.

## Research notes

- Discovery: Hudson shared @sanketpurandare's announcement post 2026-10-21. Claim hygiene: every performance number is first-party, measured on Meta's own GB300 NVL72 systems against Meta's chosen baseline; the 1.40× is a single multi-layer packing workload, not a general MoE speedup — single-layer and width/imbalance sweeps are in the explainer's downloadable CSVs for anyone re-checking. Cluster: the distributed-kernel layer under the catalog's model-level MoE entries (#43 MAI-Base-2 dropless MoE; #74 OperLoop's 3:1 SWA:full MoE eval backbone) — this is what "dropless" costs and buys at the dispatch/combine level. Precision thread: MXFP8 training + NVFP4 inference as production number formats extends the low-precision line running through #66 (Muon formula grid / fp32 caveat), #77 (batch invariance), #92 Helion/CompileIQ, and held #98 PULSE. Stack relevance: Hudson's own models are dense 3:1 SWA:full-attention hybrids, not EP MoE, so this is neighborhood reading (expert-parallel dispatch/combine fusion, block-scaled training kernels) rather than a drop-in for his stack; no Launch Helm angle. Watch at insert: repo is 11 commits old — recheck stars/API/modes before the entry hardens. Dedupe: verified 2026-10-21 against local catalog data/papers.json and queue file — no "dist-moe"/"dist_moe"/"mixture-of-kittens" match; live dedupe still owed at insert (Neon quota block): check title ILIKE '%Dist-MoE%' OR url ILIKE '%dist_moe%'. NOTE: staged Assistant Axis draft takes #78; #97–99 held for the sparsity papers (pending Hudson's decision); this entry is #108.
- License: BSD-3-Clause (verified from the repo LICENSE / GitHub license metadata — not Apache-2.0). Explainer/docs carry no separate license statement.

## Similar entries

- [Attribution-Guided and Coverage-Maximized Pruning for Structural MoE Compression (MoE-Slimming)](https://papers.projxon.ai/entries/1261) (paper, #1261)
- [EMO: Pretraining Mixture of Experts for Emergent Modularity](https://papers.projxon.ai/entries/1105) (paper, #1105)
- [Supercharging Olmo-core for Efficient and Scalable MoE Training](https://papers.projxon.ai/entries/838) (paper, #838)
- [ID Balancing: Stable Training of Extremely Sparse MoE via PID-Based Load Control](https://papers.projxon.ai/entries/833) (paper, #833)
- [LatentMoE: Toward Optimal Accuracy per FLOP and Parameter in Mixture of Experts](https://papers.projxon.ai/entries/1096) (paper, #1096)
- [KohakuFA: Attention Kernel with Fixed Backward-Pass Precision](https://papers.projxon.ai/entries/1217) (code, #1217)
