GC-MoE: Overlapping Expert-Parallel Token Dispatch with FP8/FP4 Grouped GEMM via CUDA Green Contexts
Abstract
Under expert parallelism, mixture-of-experts (MoE) layers pay all-to-all token dispatch, grouped GEMMs, and a combine step in every layer. In decode each rank holds only 1-256 tokens: dispatch latency and weight traffic dominate while tensor-core utilization is inherently low. In fused operators such as DeepGEMM's Mega MoE, dispatch and computation overlap only by sharing every SM: dispatch warps compete with TMA/MMA and epilogue warps for registers, shared memory, and issue slots; every phase shares one CTA resource budget, synchronization spans the whole SM array, and every replay ends with a workspace-clean pass and a cross-rank barrier. We present GC-MoE, an open-source FP8/FP4 MoE inference operator for NVIDIA Hopper and Blackwell GPUs that uses CUDA Green Contexts to split the device into a small communication partition and a large compute partition. Each role gets its own kernel, resource budget, and synchronization domain, so dispatch and GEMM tune independently. A three-node CUDA Graph (four on Hopper with fused shared experts) launches the dispatch and grouped-GEMM kernels as concurrent roots; a token-ring handshake starts computation on the first filled ring blocks, and double-buffered receive counters remove the trailing cross-rank barrier between replays. The compute partition runs operand-swapped tcgen05 block-scaled MMA on Blackwell and register-A WGMMA with in-register FP4 decoding on Hopper, with fused SwiGLU, requantization, and optional shared experts. On 8 H20 GPUs GC-MoE accelerates DeepSeek-V4.1-Flash decode by 1.188x on average on both the routed and shared-expert suites (peaks 1.296x and 1.353x); on 8 B300 GPUs it accelerates GLM-5.2 and DeepSeek-V4.1-Flash by 1.106x (1.123x with fused shared experts, peak 1.209x), beating Mega MoE at all 54 measured points at matched accuracy. GC-MoE reserves only 20 of 148 SMs on B300 for dispatch.
Figures & tables
| Role | Function | Green context | Grid | Threads | Cluster |
|---|---|---|---|---|---|
| role1 | token dispatch (all-to-all pull) | communication | dispatch_sms | 256 or 384 | – |
| role2 | FP8 FP4 grouped GEMM + SwiGLU | compute | compute_sms | 384 | (2,1,1) |
| role3 | signal reset + combine | compute | finalize_sms | 384 | – |
| Blackwell (SM103, B300) | Hopper (SM90, H20) | |
|---|---|---|
| Compile target | sm_103f | sm_90a |
| MMA | tcgen05 mxf8f6f4.block_scale , 2-CTA | register-A WGMMA m64nNk32 , E4M3 |
| Weight format | packed FP4 with UE8M0 K32 scales | MXFP4, window-repacked with per-expert factor |
| Activation format | E4M3 with packed UE8M0 K32 scales | E4M3FN with FP32 K128 scales |
| FP4 handling | native E2M1 operand (format 5) | in-register decode FP4 E4M3 |
| Scale application | UTCCP to TMEM; hardware block scale | per-K32 FMA outside MMA; headroom |
| GPUs | 8 NVIDIA H20 (Hopper, sm_90a ); 8 NVIDIA B300 (Blackwell, CC 10.3) |
| CUDA / assembler | CUDA 13.2, ptxas 13.2.78 |
| PyTorch | 2.11.0 (cu130) |
| Kernel DSL | NVIDIA CUTLASS DSL (CuTe) 4.8.1 |
| Baseline | DeepGEMM 2.8.2+ fcad603 ( fp8_fp4_mega_moe on B300, fused shared experts when enabled; our SM90 reference port sm90_fp8_fp4_mega_moe on H20) |
| Proposed | GC-MoE 0.3.1 (commit 9bdb81f ) |
| Execution | one process per GPU; PyTorch symmetric memory over NVLink; CUDA Graph replay |
| Model | top- | shared experts | shared K group | |||
|---|---|---|---|---|---|---|
| GLM-5.2 | 6144 | 2048 | 256 | 8 | 1 | 128 |
| DeepSeek-V4.1-Flash | 5120 | 2304 | 384 | 6 | 1 | 32 |
| Tokens/rank | Total tokens | Mega ( s) | GC-MoE ( s) | Speedup |
|---|---|---|---|---|
| 1 | 8 | 120.061 | 115.161 | 1.0425 |
| 2 | 16 | 169.340 | 144.259 | 1.1739 |
| 4 | 32 | 256.018 | 202.589 | 1.2637 |
| 8 | 64 | 368.254 | 284.310 | 1.2953 |
| 16 | 128 | 442.722 | 341.689 | 1.2957 |
| 32 | 256 | 472.090 | 373.393 | 1.2643 |
| Model | Tokens/rank | Total tokens | Mega ( s) | GC-MoE ( s) | Speedup |
|---|---|---|---|---|---|
| GLM-5.2 | 1 | 8 | 64.184 | 58.601 | 1.0953 |
| 2 | 16 | 87.457 | 79.228 | 1.1039 | |
| 4 | 32 | 108.085 | 98.225 | 1.1004 | |
| 8 | 64 | 125.241 | 115.041 | 1.0887 | |
| 16 | 128 | 131.652 | 121.385 | 1.0846 | |
| 32 | 256 | 133.215 | 121.493 | 1.0965 |
| Tokens/rank | gc-se ( s) | gc-unfused ( s) | unfused/se | mega-unfused ( s) | mega/se |
|---|---|---|---|---|---|
| 1 | 145.171 | 156.866 | 1.0806 | 161.804 | 1.1146 |
| 2 | 179.286 | 188.566 | 1.0518 | 214.191 | 1.1947 |
| 4 | 236.353 | 248.009 | 1.0493 | 299.391 | 1.2667 |
| 8 | 302.667 | 328.262 | 1.0846 | 409.599 | 1.3533 |
| 16 | 363.640 | 384.421 | 1.0571 | 482.938 | 1.3281 |
| 32 | 428.722 | 422.456 | 0.9854 | 511.952 | 1.1941 |
| Model | Tokens/rank | Total tokens | Mega-se ( s) | GC-MoE ( s) | Speedup |
|---|---|---|---|---|---|
| GLM-5.2 | 1 | 8 | 68.739 | 59.752 | 1.1504 |
| 2 | 16 | 93.033 | 79.730 | 1.1669 | |
| 4 | 32 | 113.672 | 99.059 | 1.1475 | |
| 8 | 64 | 130.904 | 115.870 | 1.1297 | |
| 16 | 128 | 136.624 | 121.372 | 1.1257 | |
| 32 | 256 | 138.641 | 123.645 | 1.1213 |
| TFLOPS | HBM (GB/s) | NVLink (GB/s) | ||||
|---|---|---|---|---|---|---|
| Tokens/rank | Mega | GC | Mega | GC | Mega | GC |
| 1 | 28.297 | 29.501 | 7 516.4 | 7 836.2 | 5.171 | 5.391 |
| 2 | 40.125 | 47.101 | 9 770.0 | 11 468.7 | 7.424 | 8.714 |
| 4 | 53.080 | 67.079 | 11 235.5 | 14 198.7 | 9.942 | 12.564 |
| 8 | 73.805 | 95.597 | 12 814.4 | 16 598.0 | 14.076 | 18.233 |
| 16 | 122.782 | 159.087 | 14 311.1 | 18 542.7 | 23.522 | 30.478 |
| GLM-5.2 | DeepSeek-V4.1-Flash | |||
|---|---|---|---|---|
| Tokens/rank | Mega | GC | Mega | GC |
| 1 | 75.280 | 82.453 | 48.101 | 57.208 |
| 2 | 110.496 | 121.974 | 80.869 | 90.891 |
| 4 | 178.817 | 196.765 | 129.099 | 142.488 |
| 8 | 308.642 | 336.007 | 194.199 | 212.781 |
| 16 | 587.226 | 636.895 | 336.480 | 366.062 |
| Category | Cases | GC/BF16 | Mega/BF16 | GC/Mega | Max proc. diff |
| default | 9/9 | 0.977039 | 0.977039 | 0.99999976 | |
| boundary | 23/23 | 0.977672 | 0.977672 | 0.99999976 | |
| asymmetric | 15/15 | 0.977837 | 0.977837 | 0.99999976 | |
| GC: max absolute error 0.109375; max relative L2 0.00600836286321; repeat diff 0. | |||||
| Mega: max absolute error 0.109375; max relative L2 0.00600836286321. | |||||
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Constraint | Technical reason |
|---|---|
| , | W1 output tiles must fit the 64-bit l2_full_mask ; K128 tiles complete. |
| 2-CTA clusters pair N128 tiles, requiring even. | |
| , | One warp lane carries one combine slot; dispatch reads tokens per warp. |
| global, per rank, | Static per-expert signal region; lane-held per-expert counters. |
| ranks | 592-byte by-value peer descriptor with 72 offsets. |
| Routed recipe ; SwiGLU | MMA scale-factor path hard-codes K32 UE8M0; SwiGLU fused in the W1 epilogue. |
Mixture-of-Experts Inference
Mixture-of-experts inference studies how to run sparsely activated expert models efficiently while preserving their quality.
See all 189 papers