KDA 0.5 FP8 Block-Scale MoE

CuTe-DSL implementation of the MLSys 2026 FlashInfer contest definition moe_fp8_block_scale_ds_routing_topk8_ng8_kg4_e32_h7168_i2048.

The kernel fuses DeepSeek-V3-style routing with two persistent grouped FP8 GEMMs. It targets NVIDIA Blackwell SM100/SM103 GPUs and is tuned for the official contest workloads.

1.5723x geometric-mean speedup over the official FlashInfer wrapper baseline across all 19 official MoE workloads.

KDA 0.5 performance comparison on NVIDIA B200

Requirements

  • NVIDIA GPU with compute capability 10.0 or 10.3
  • CUDA 13 compatible driver
  • PyTorch 2.12.1 with CUDA 13.0 (tested)
  • nvidia-cutlass-dsl==4.6.0 (tested)

Usage

from kernels import get_kernel

moe = get_kernel(
    "humanfia-lab/moe-fp8-block-scale",
    version=1,
    trust_remote_code=True,
)

output = moe.run(
    routing_logits,
    routing_bias,
    hidden_states,
    hidden_states_scale,
    gemm1_weights,
    gemm1_weights_scale,
    gemm2_weights,
    gemm2_weights_scale,
    local_expert_offset,
    routed_scaling_factor,
)

The output is a BF16 tensor of shape [seq_len, 7168].

Fixed geometry

Parameter Value
Global experts 256
Local experts 32
Experts selected per token 8
Routing groups 8
Selected routing groups 4
Hidden size 7168
Intermediate size 2048
Activation and weight dtype FP8 E4M3FN
Output dtype BF16

Performance

Across the 19 official MoE workloads, KDA 0.5 achieves a 1.5723x geometric- mean speedup over the official FlashInfer wrapper baseline. Every result in both columns passes the benchmark correctness check.

Sequence length KDA 0.5 latency (ms) FlashInfer baseline (ms) Speedup
1 0.048597 0.118609 2.4407x
7 0.078150 0.151984 1.9448x
14 0.111825 0.184548 1.6503x
15 0.069407 0.142811 2.0576x
16 0.116053 0.192128 1.6555x
32 0.184763 0.250576 1.3562x
52 0.148032 0.221893 1.4990x
53 0.208725 0.272379 1.3050x
54 0.190822 0.260945 1.3675x
55 0.209290 0.273834 1.3084x
56 0.218276 0.281375 1.2891x
57 0.212591 0.276203 1.2992x
58 0.217348 0.280656 1.2913x
59 0.172362 0.241716 1.4024x
62 0.155285 0.236795 1.5249x
80 0.241978 0.309758 1.2801x
901 0.279956 0.400299 1.4299x
11,948 0.760259 1.745421 2.2958x
14,107 1.073683 2.365706 2.2034x
Geometric mean 1.5723x

Measurements use an NVIDIA B200 with CUPTI cold-L2 kernel-span timing, 3 warmup iterations, 50 measured iterations, and 3 trials. KDA 0.5 is measured with CUDA 13.0, PyTorch 2.12.1+cu130, and CuTe DSL 4.6.0. The FlashInfer wrapper baseline uses the contest-era stack: flashinfer-python==0.6.8.post1, PyTorch 2.12.0+cu132, and CuTe DSL 4.5.0.

Source

The implementation is published from commit 9cf7b6dedefb65704fe016ffe25653c582ee8003 of humanfia/mlsys2026-flashinfer-contest-kda0.5, file kernels/moe/kernel.py.

Available functions

  • run
Downloads last month
-
cuda
cutlass
cute-dsl
fp8
Mixture of Experts
blackwell
MIT
Supported hardwares new
CUDA
10.010.3
GPU
B300
288GB
NVIDIA SXM
B200
192GB
Kernel Builder
0.17.0-dev0