Skip to content
DARC
■ Change #50 · wiki.edited

Microscaling (MX) and block-scaled 4-bit formats: Normalize Markdown to canonical form

by DARC wiki2026-10-22 20:31:02 UTCOpen the page →
explainer.student
**The problem.** With a single scale factor for a whole tensor (see the FP8 entry), one large value forces a scale that pushes the small values towards zero. Going below 8 bits makes this much worse. A 4-bit float such as E2M1 (2 exponent bits, 1 mantissa bit) has only 16 bit patterns, and its non-negative values are 0, 0.5, 1, 1.5, 2, 3, 4 and 6.
**Microscaling.** Give each short block of numbers its own scale. The OCP Microscaling (MX) specification (v1.0, 2023) groups 32 elements into a block that shares one 8-bit scale, which is a pure power of two (format E8M0: exponent bits only). The elements themselves are stored in FP8, FP6, FP4 or INT8. A block is decoded as
− $$x_i \approx 2^{k}\, q_i, \qquad i = 1, \dots, 32,$$
+ $x_i \approx 2^{k}\, q_i, \qquad i = 1, \dots, 32,$
where $q_i$ is the stored narrow element and $2^{k}$ is the shared scale. In words: the block shares one exponent, and each element keeps its own tiny mantissa. The cost is one 8-bit scale per 32 elements, $8/32 = 0.25$ extra bits each, so MXFP4 averages 4.25 bits per number. Analogy: a sign saying "all prices in this aisle are in hundreds of dollars", with a single digit on each item. It breaks when one aisle mixes 2-dollar and 2000-dollar items, which is why block size matters.
**NVFP4.** NVIDIA's variant uses smaller blocks of 16 FP4 elements, each block with an FP8 (E4M3) scale instead of a power of two, plus one FP32 scale for the whole tensor. That costs $8/16 = 0.5$ extra bits per element and buys finer scales. NVIDIA's 2025 preprint reports pretraining a 12-billion-parameter model on 10 trillion tokens with NVFP4, with loss and downstream accuracy comparable to an FP8 baseline. Its recipe adds random Hadamard transforms (a fixed mixing of each block's values that spreads outliers out), quantises weights the same way in the forward and backward passes, uses stochastic rounding for gradients (rounding up or down at random, more often towards the nearer value, so errors average out), and keeps some layers in higher precision.
**Hardware.** NVIDIA's Blackwell tensor cores apply the block scales inside the matrix-multiply instruction, so the scales must sit in memory in a particular layout. CUTLASS and Transformer Engine provide kernels and recipes, and Microsoft's microxcaling library emulates the formats in software.
**Open points.** Quantising activations and gradients, not only weights, to 4 bits; deciding which layers must stay wider; fusing the scale computation into neighbouring kernels, since computing scales is itself memory traffic; and checking whether vendor-reported results reproduce across model sizes and architectures.
hash 5ecc1bb0501878cd5d276810f2ee4e6e2e4dfdfbf70e0d5b4ea8ddcf095c889e
previous 688f0a133ab84f3e15ce5f19f730e88bf33618a4cdbe8b2ab039aa6a530fc00c