Indian AI news · we check every factSubmit an updateNewsletterSign in

Research

Sarvam AI reports its MXFP8 attention fix trained 4.9% faster than BF16 attention at 32K context

Sarvam AI describes how a shared scale in MXFP8 attention lets later tokens alter earlier outputs, how it closed the gap, and the gains it measured.

Published 3 min read

Aerial view of terraced green fields with the title Ensuring Causality in MXFP8 Attention across it
Image: Sarvam AI

What happened

In a technical post on its website dated 2 December 2026, Sarvam AI reports that training Qwen3-4B on 16 B200 GPUs at 32K context with its causal MXFP8 attention lifted throughput by 4.9% and cut peak memory by 5.2%, compared with attention in BF16.

The company says it set out to learn what running the attention calculation itself in MXFP8 would take. Lower-precision training, it notes, usually quantizes (stores in a lower-precision format) the projection and feed-forward layers but keeps attention in a higher-precision format such as BF16. The post does not say why.

Sarvam says it has contributed the work to NVIDIA's cuDNN, to TransformerEngine and to vLLM, the last for prefill. Prefill, the post says, is one of inference's two parts, alongside decoding.

How the leak arises

In MXFP8, Sarvam's post explains, a group of 32 neighbouring values shares one power-of-two scale rather than each number carrying its own. For the value matrix in attention, each feature's scale is picked from 32 consecutive token positions.

A causal mask gives later positions zero weight, but Sarvam says a later value can still change a shared scale, and so how an earlier, visible value is rounded. In the post's example, a large value at position 55 can raise the scale and shift position 32, which an earlier query reads.

The fix

According to Sarvam's post, MatX had shown the same problem in MXFP4 and suggested computing the block that straddles the mask without quantization.

Sarvam keeps even that boundary block in MXFP8, so both forward matrix products in training and prefill use the format. Each boundary token gets a scale from its own values, folded into the attention weights, leaving the hardware's group scale a fixed constant that later tokens cannot move. Only one 32-token block per query needs this; earlier blocks take the standard MXFP8 path, and the results are merged. The backward pass converts saved values back to BF16, so no new scale is shared across tokens.

The numbers

Sarvam's training baselines were two Transformer Engine options: BF16 attention, and stock cuDNN MXFP8 attention, which the post says leaks future tokens in both the forward and backward passes. At 32K its recipe also beat stock MXFP8 on throughput by 1.8%. At 4K the result reverses, with the recipe 2.1% behind BF16, which Sarvam puts down to quantization cost and its extra preparation and merging steps, saying these fade as context grows.

For text generation, Sarvam changed vLLM's paged KV cache, where earlier keys and values are kept, to store them in MXFP8, handling the newest token separately. The decoding test ran one request at a time on one GPU against a baseline with higher-precision attention and a lower-precision cache. For Qwen3-14B, the post calls results broadly comparable with vLLM's lower-precision attention path, with gains of 0.5 to 4.2%, only the 16K figure beating run-to-run variation of about 3%. For the smaller Qwen3-4B, Sarvam reports 312.2 tokens a second at 32K against 272.1 for the baseline, a 14.7% gain.

Sources

  1. Ensuring Causality in MXFP8 AttentionSarvam AI · 2 December 2026 · Primary source

Spotted an error? See our corrections policy.

Latest news

All latest news →