A Triton block-scaled FP4 GEMM within 10% of CUTLASS on B200
On this page15 sections
Difficulty 31: Triton must place scale factors and drive tensor-memory MMAs without exposing them, on hardware where tile-level Python GEMMs still trail cuBLAS in BF16; harder than the H100 BF16 Triton task (27). Application value 43: open FP4 kernels in a compiler language help open 4-bit stacks, but CUTLASS and its Python DSL already cover the need. Leverage 23: limited to Blackwell low-precision kernels.
The problem
Can a Triton matrix multiply on 4-bit block-scaled numbers reach 90% of NVIDIA’s CUTLASS speed on a B200?
- 1B200 multiplies 4-bit blocks natively
- 2CUTLASS and its Python DSL are fast
- 3Triton hides layouts from the programmer
- 4Compiler must place scales correctly
- 590% of CUTLASS on every shape
What is asked. NVIDIA's Blackwell GPUs (the B200) can multiply matrices of 4-bit numbers directly. The numbers come in blocks of 16 (NVFP4) or 32 (MXFP4), each block with its own scale factor (see the microscaling entry). NVIDIA's CUTLASS library has fast kernels for this, written in C++ templates. The problem asks for the same operation written in Triton, a Python-level tile language, using only features in a released version (such as tl.dot_scaled). It must reach at least 90% of CUTLASS speed on every matrix shape in a list taken from real models, with from 1 to 16384. NVIDIA's own CuTe Python DSL is excluded, because it exposes the same low-level controls as CUTLASS. The question is whether a compiler that hides those details can still reach vendor speed.
Why it is hard. In a block-scaled product, each 4-bit value stands for , where is its block's scale. The B200's tensor cores apply the scales inside the multiply instruction, but only if the scales sit in memory in one particular arrangement. The matrices must also be fed through a new on-chip "tensor memory". In CUTLASS, the programmer spells out these layouts by hand. In Triton, the compiler must choose them from a much higher-level description. Getting it slightly wrong forces extra shuffling of data, which can cost a large share of the speed. The analogy is a translator who must produce not just the meaning but the exact page layout a printer demands. It breaks because the compiler is improved once and then serves every kernel, whereas a translator starts over each time.
State of the art. CUTLASS ships block-scaled kernels for Blackwell. Its CuTe Python DSL includes NVFP4 and MXFP4 examples, and NVIDIA reports its dense matrix multiplies on par with C++. Triton has a block-scaled matrix-multiply tutorial that benchmarks against cuBLAS but publishes no numbers. The only independent B200 comparison of tile-level Python kernels against the vendor library found is for BF16, where they ran well below cuBLAS on several model shapes. No source compares a Triton FP4 kernel with CUTLASS across a range of shapes.
What a solution looks like. A Triton kernel at a pinned release, timed on one B200 against CUTLASS's best kernel for each shape. It must reach 90% or more on every shape, match a 32-bit reference within tolerance, and be reproduced independently.
Go deeper
The full technical text.
Write a GEMM for NVFP4 and MXFP4 operands with block scales (BF16 output) in the Triton language, using tl.dot_scaled or other features of a released upstream Triton (no inline PTX and no Gluon), that on one B200 reaches at least 90% of the throughput of the corresponding CUTLASS block-scaled kernel on every LLM projection shape in the sweep (M from 1 to 16384), and matches a dequantised FP32 reference within the specified tolerance. NVIDIA's own CuTe Python DSL is excluded because it exposes the same primitives as CUTLASS and ships block-scaled GEMM examples; the question is whether a tile-level compiler that hides layouts and scale-factor placement can reach vendor speed.
Words on this page (10)
- Triton
- A Python-embedded language in which a GPU kernel is written for whole tiles; its compiler handles the low-level details.
- CUTLASS
- NVIDIA's open-source C++ template library of fast matrix-multiply building blocks.
- block scaling (MX, NVFP4)
- Sharing one scale factor across a small block of 16 or 32 narrow numbers so each block uses the format’s range well.
- FP4 (E2M1)
- A 4-bit floating-point number with 2 exponent bits and 1 mantissa bit: only 16 possible values.
- scale factor
- A multiplier applied before rounding to a narrow format so values fit its range, divided out afterwards.
- Blackwell (B200)
- NVIDIA's GPU generation after Hopper, with native 4-bit and block-scaled matrix instructions.
- tensor core
- A unit inside each GPU core that multiplies small matrix tiles in one instruction, much faster than ordinary arithmetic.
- compiler
- A program that translates code from one language into machine instructions.
- GEMM
- General matrix multiply, C = A·B: the operation that takes most of the arithmetic in neural networks.
- kernel (GPU)
- A function that runs on the GPU, executed by thousands of threads in parallel.
New to this? Read first (3)
- Triton tutorial: block-scaled matrix multiplicationThe starting point: a Triton FP4 matrix multiply with tl.dot_scaled.
- Wikipedia: MinifloatWhat 4- and 8-bit floating-point numbers look like.
- Simon Boehm: How to optimize a CUDA matmul kernelA step-by-step walk from a naive to a fast matrix multiply, showing what a compiler must automate.
Built from
earlier problems → this oneThe earlier problems this one is built from. “Builds on” means it needs their progress or tools. “Generalizes” means they are special cases that come first. “Implies” means they are weaker results on the way. On the right is what builds on this problem.
- Start with
- A Triton block-scaled FP4 GEMM within 10% of CUTLASS on B200This problem
- Then
- An open 4-bit pretraining recipe matching BF16 loss at 1B parametersLow-Precision Numerics · D30
Path to understanding
foundations → problemThe research entries this problem rests on, in the order to read them. Each links to its explainer.
- Start with
- Step 2
- Step 3
- Step 4
- Microscaling (MX) and block-scaled 4-bit formatsTheory · host
- Then
- A Triton block-scaled FP4 GEMM within 10% of CUTLASS on B200The problem
State of the art
CUTLASS ships block-scaled kernels for Blackwell, and its CuTe Python DSL includes block-scaled (NVFP4 and MXFP4) GEMM examples; NVIDIA reports CuTe DSL dense GEMMs on par with C++. Triton has a block-scaled matmul tutorial (10-block-scaled-matmul.py, using tl.dot_scaled) that benchmarks against cuBLAS but publishes no numbers. The only independent Triton-versus-vendor GEMM figures on B200 found are for BF16, where an evaluation of CUDA Tile (arXiv:2604.23466) reports tile-level Python kernels well below cuBLAS on several LLM shapes. No source benchmarks a Triton FP4 GEMM against CUTLASS across a shape sweep.
Realistic applications
Efficient open 4-bit kernels are a prerequisite for open 4-bit training and inference stacks that do not rely on vendor libraries.
What counts as solved
A public kernel meeting the 90% bar on all shapes on B200, reproduced independently.
How it gets verified
To verify: GPU benchmarkA kernel run and timed on stated hardware against a baseline.
Hardware: one NVIDIA B200 (HBM3e) with the CUDA 12.8 or later toolkit supporting its block-scaled instructions. Dtypes: NVFP4 (E2M1 elements, 16-element blocks, E4M3 block scales, FP32 tensor scale) and MXFP4 (E2M1, 32-element blocks, E8M0 scales), BF16 output. Shapes: M in {1, 16, 128, 1024, 4096, 16384}, N and K from Llama-3 70B and DeepSeek-V3 projection sizes. Candidate: Triton kernel at a pinned upstream Triton release. Baseline: CUTLASS block-scaled GEMM (cutlass_profiler, best kernel per shape) at a pinned CUTLASS release. Metric: median TFLOP/s over at least 100 iterations after warmup; pass if at least 90% of the CUTLASS baseline on every shape. Correctness: max relative error versus FP32 GEMM of the dequantised inputs no more than 1.1x the baseline's. Harness: public script at a pinned commit.
Claims
No claimed results on this problem.
Where the work is
Kernel and compiler engineering on new hardware.
Connected problems
- This problem is needed by An open 4-bit pretraining recipe matching BF16 loss at 1B parametersFast training depends on an efficient open block-scaled GEMM kernel.