flashinfer.megamoe¶
SM90 W4A8 expert-parallel MegaMoE with NVFP4 fused/split and MXFP4 fused kernels. All paths use FP8 E4M3 activations and return BF16 outputs. Execution requires NVLink-connected Hopper GPUs and a symmetric buffer allocated collectively before CUDA graph capture. NVFP4 supports four or eight ranks; MXFP4 supports power-of-two rank counts from one to 32.
Buffer and execution¶
|
Allocate symmetric input, expert-token and output-combine storage. |
|
Run NVFP4 MegaMoE using the fused or split family. |
|
Run fused MXFP4 MegaMoE with chunk-major weights and FP8 activations. |
Weight preparation¶
Return braided NVFP4 weights for both fused and split SM90 kernels. |
|
Return chunk-major MXFP4 weights for the SM90 fused kernel. |