Manuscript Offprint

arXiv:2611.04222

GC-MoE: Overlapping Expert-Parallel Token Dispatch with FP8/FP4 Grouped GEMM via CUDA Green Contexts

Yong Li, Kan Liu, Tao Lan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Mixture-of-experts (MoE) models are standard for large language model (LLM) serving, and expert parallelism (EP) makes all-to-all token dispatch, grouped GEMMs, and the combine step recurrent costs in every layer. In decode, each rank typically holds only 1–256 tokens, so dispatch latency and weight traffic dominate while tensor-core utilization is inherently low; because the grouped GEMM is bandwidth-bound, a decode layer does not need all SMs for arithmetic. In state-of-the-art fused operators such as DeepGEMM's Mega MoE, dispatch and computation overlap only by sharing every SM: a few dispatch warps per SM compete with the TMA/MMA and epilogue warps for registers, shared memory, and issue slots, every phase is bound to one CTA's combined resource budget, the synchronization domain spans the entire SM array, and every replay ends with a workspace-clean pass and a cross-rank tag-2 barrier. This paper presents 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 at the driver level into a small communication partition and a large compute partition. The split gives each role its own kernel, resource budget, and synchronization domain, so dispatch and GEMM can be tuned independently. A three-node CUDA Graph (four nodes on Hopper with fused shared experts) launches the dispatch and grouped-GEMM kernels as concurrent roots on the two partitions; a token-ring handshake lets computation start 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 fused shared experts. On eight H20 GPUs GC-MoE accelerates DeepSeek-V4.1-Flash decode by 1.188×1.188\times on average on both the routed and shared-expert suites (peaks 1.296×1.296\times and 1.353×1.353\times, respectively); on eight B300 GPUs it accelerates GLM-5.2 and DeepSeek-V4.1-Flash by 1.106×1.106\times on average without shared experts and 1.123×1.123\times with fused shared experts (peak 1.209×1.209\times), outperforming DeepGEMM's Mega MoE at all 54 measured points at matched numerical accuracy (the nine H20 shared-expert points compare against an unfused shared-expert baseline). GC-MoE reserves only 20 of 148 SMs on B300 for dispatch.

1 Introduction

Mixture-of-experts (MoE) architectures have become the dominant way to scale large language models without proportionally scaling inference cost (Shazeer et al., 2017; Lepikhin et al., 2020; Fedus et al., 2022; Jiang et al., 2024; DeepSeek-AI, 2024a,b). In production serving, MoE layers are sharded with expert parallelism (EP): each GPU owns a subset of experts, and every layer routes each token to its top-kk experts through an all-to-all token dispatch, computes the routed experts locally, and combines the partial outputs back to the source ranks. Decode dominates the serving cost of interactive applications, and in decode each rank typically processes only a handful to a few hundred tokens per layer. Under such small batch sizes, the MoE layer is not tensor-core bound: its cost is dominated by cross-rank token movement and by streaming quantized expert weights from HBM.

Because of this cost structure, kernel-level MoE optimization has converged on fused, persistent operators. DeepGEMM's Mega MoE is the state of the art on NVIDIA Blackwell (and, via a reference SM90 port, on Hopper): a single fused kernel performs the expert-parallel dispatch, the FP8×FP4 grouped GEMMs with SwiGLU fused into the first epilogue, and the combine, with warp specialization inside one kernel and block-scaled tensor-core instructions (DeepSeek-AI, 2026b, 2024b). It already overlaps dispatch with computation, but only by sharing every SM (streaming multiprocessor): four dispatch warps per SM pull tokens into a per-block ring while two TMA-load warps (TMA: tensor-memory-accelerator copy engine), one MMA-issue warp (MMA: matrix multiply-accumulate), a scheduler warp, and eight epilogue warps consume ring blocks, run the GEMM, and perform the combine. The compute warps therefore never own the whole SM—the dispatch warps and their staging buffers are carved out of each SM's register file and shared memory—and every replay ends with a workspace-clean pass followed by a cross-rank tag-2 barrier. The clean overlaps the combine, but the barrier is still a cross-rank round trip paid on every replay. The kernel's synchronization domain is the whole device: its prologue and tail grid syncs include every SM of the device (148 on B300), so each phase waits for the slowest CTA (cooperative thread array), and the same CTA budget must host all phases, so a local change to one phase is a change to the whole kernel. These effects inflate decode latency at 1–256 tokens per rank.

Two further trends sharpen the problem. First, low-precision formats have moved from FP8 activations to FP4 weights: weight traffic, not arithmetic, sets the decode lower bound, and the two GPU generations expose different instruction sets for mixed FP8×FP4 computation (tcgen05 block-scaled MMA on Blackwell, WGMMA with software FP4 decode on Hopper). Second, existing MoE systems optimize communication-computation overlap across micro-batches, layers, or experts (Li et al., 2023; He et al., 2022), or rely on stream-level concurrency, but they do not isolate SM resources inside the operator: a conventional kernel launched on the full device occupies all SMs, and concurrent kernels on separate streams compete for the same SM array with no hardware guarantee of co-residency or performance isolation. CUDA Green Contexts, introduced in CUDA 12.4, provide driver-level SM partitioning with independent workqueues, i.e., exactly the primitive needed to co-schedule a communication kernel and a compute kernel deterministically. Prior systems have used green contexts for isolation between inference processes, co-located models, or prefill/decode requests (Martín et al., 2026; Quach et al., 2025; Zhang et al., 2026); to our knowledge, none uses them to overlap the communication and computation phases within a single MoE operator. Deeper fusion alone does not address the decode bottleneck: because the grouped GEMM is bandwidth-bound, extra SMs buy little arithmetic, while a fused kernel couples the phases' resource and synchronization budgets.

This paper presents GC-MoE, an open-source MoE inference operator for Hopper (SM90) and Blackwell (SM103) GPUs that reorganizes the MoE layer as a three-node CUDA Graph (four nodes on Hopper with fused shared experts) across two CUDA Green Contexts. A small communication partition (20 of 148 SMs on B300) runs the dispatch kernel; a large compute partition runs the grouped-GEMM kernel concurrently. The two kernels are independent graph roots, so the driver schedules them simultaneously on disjoint SM sets. A token-ring protocol with generation-tagged counters lets the GEMM kernel begin consuming a block of dispatched tokens as soon as that block is filled, without waiting for dispatch to finish. A finalize kernel then aggregates the top-k and shared-expert partials into the output. Double-buffered receive counters and device-persistent synchronization state remove the trailing cross-rank barrier, so consecutive CUDA Graph replays need no cross-rank rendezvous between them. Because the grouped GEMM is bandwidth-bound at decode, ceding 20 SMs to dispatch costs little compute throughput; because each role is an ordinary kernel with its own thread, register, shared-memory, and synchronization budget, the dispatch and GEMM paths can also be tuned independently. The compute kernel implements FP8-activation×FP4-weight grouped GEMM for both architectures: an operand-swapped tcgen05 block-scaled MMA path on Blackwell that services FP4 routed and FP8 shared weights with one instruction sequence, and a register-A WGMMA path on Hopper with in-register FP4→E4M3 decoding and a window-based scale repacking. SwiGLU, routing-weight application, and FP8 requantization are fused into the first GEMM epilogue; shared experts can be fused into the same task stream.

Our contributions are:

  • Decode-aware green-context decomposition. To our knowledge, GC-MoE is the first MoE operator that uses CUDA Green Contexts to give token dispatch and expert computation disjoint, driver-aligned SM partitions, so dispatch runs concurrently with the grouped GEMM on dedicated SMs instead of sharing every SM; balanced workqueues avoid implicit serialization between the two contexts. At decode the GEMM is bandwidth-bound, so the 20-SM dispatch partition costs little compute throughput, and each role is an ordinary kernel with its own resource budget and synchronization domain, which allows

the dispatch and GEMM paths to be optimized independently (Sections 3 and 4.2).

  • Fine-grained cross-partition synchronization. A token ring with generation-tagged full/empty counters and a 64-bit W1-completion bitmap carries the baseline's block-granular handshake across the partition boundary, so the compute kernel starts on the first filled ring block; double-buffered receive counters eliminate the trailing cross-rank barrier between graph replays; all synchronization state survives replay without host intervention (Sections 4.3 and 4.6).

  • Dual-architecture FP8×FP4 grouped GEMM. Operand-swapped tcgen05 block-scaled MMA with K128 tile-prepacked FP4 weights on Blackwell, and register-A WGMMA with in-register FP4 decoding and exact window-based scale repacking on Hopper, both with fused SwiGLU, requantization, and optional fused shared experts (Sections 4.4 and 4.5).

  • Systematic evaluation. On 8×H20 and 8×B300, GC-MoE outperforms DeepGEMM's Mega MoE at all 54 measured decode points: 1.188× mean on H20 (DeepSeek-V4.1-Flash, peaks 1.296× routed and 1.353× with shared experts), 1.106× mean on B300 without shared experts and 1.123× with fused shared experts (GLM-5.2 and DeepSeek-V4.1-Flash, peak 1.209×). Accuracy is matched: cosine ≥ 0.97 against BF16 everywhere and minimum cosine ≥ 0.9999997 against the baseline on both H20 suites; the nine H20 shared-expert points compare against an unfused shared-expert baseline (Section 6.3). The operator is open source.

References (24)