CursorStuart SulBenchmark
1.5x faster MoE training with custom MXFP8 kernels
Summary
An upgrade from Hopper H100s to Blackwell B200s exposed the Mixture-of-Experts (MoE) layer, implemented with MegaBlocks, as a major training bottleneck: it consumed nearly 53% of forward-pass time and 27% of backward-pass time. The team rewrote the layer at the GPU-kernel level using CUDA, PTX, and some ThunderKittens, while moving from BF16 to microscaled FP8 (MXFP8) with nearly zero loss in training quality. The implementation addresses Blackwell-specific tensor memory constraints and quantization overhead, including custom MXFP8 quantization that sustains more than 6.2 TB/s and emits scale matrices directly compatible with tcgen05.mma. On an internal model, MoE execution became 3.5x faster in both passes, producing a 1.5x end-to-end speedup on Blackwell and 2x versus the original Hopper setup, measured in tokens per second per GPU.
Context
Training the largest internal models can take weeks on tens of thousands of GPUs, making it computationally expensive and slowing the pace at which improvements reach users. During the upgrade from Hopper H100s to Blackwell B200s, profiling identified the MegaBlocks-based Mixture-of-Experts layer as a major bottleneck.
Approach / What changed
The team rewrote the MoE layer at the GPU-kernel level using CUDA, PTX, and some ThunderKittens, replacing BF16 computation with MXFP8 where applicable. The implementation includes custom Blackwell kernels that account for tensor memory behavior, optimize quantization, produce tcgen05.mma-compatible scale layouts, and fuse quantization or dequantization with other operations.
Takeaways
On Blackwell, tensor-core results accumulate in tensor memory rather than registers, so custom arithmetic requires transfers between tensor memory and registers; the asynchronous movement can create tensor-core pipeline bubbles and reduce occupancy.
The implementation fused MXFP8 quantization to produce both non-transposed and transposed outputs for forward and backward passes, and attached quantization or dequantization logic to the prologue and epilogue of the fused MXFP8 SwiGLU kernel.
For the internal model, Blackwell MXFP8 reduced MoE forward time from 25.96 ms to 9.45 ms and backward time from 59.17 ms to 17.04 ms; the resulting end-to-end throughput was 24k TPS/GPU, versus 16k for Blackwell BF16.
Source and freshness
- Source
- cursor.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.