Standalone · Kernels

KV-stationary sparse attention on Blackwell

Fireworks' MiniMax M3 kernel hits ~980 TFLOP/s with a KV-stationary design. The lesson: for sparse attention, where you park the KV cache matters more than the math.

Attention is the kernel that defines inference. Sparse attention is the variant that defines long-context inference. Fireworks' work on MiniMax M3 sparse attention on Blackwell is a masterclass in why the data layout matters as much as the math.

The problem

MiniMax M3 uses sparse attention to handle 1M-token contexts. The naive approach: query-stationary, where you stream the KV cache through the compute. Fireworks found a better way: KV-stationary, where you keep the KV cache resident and stream the queries.

The numbers

Mental model

Query-stationary is like a chef who keeps running to the pantry for each ingredient. KV-stationary is the chef who stages everything on the counter first. For sparse attention, staging wins.

The design space

Fireworks walks through the Q-outer vs KV-outer design space, and the I/O roofline with the reuse crossover at nsb/N < 2.85. The insight: for sparse attention, the KV cache is the thing you want to keep resident, because it's reused across queries. The queries are the stream.

Why it matters

The takeaway

For sparse attention, the KV cache is the asset. Keep it resident, stream the queries, and you win.

Sources

Back to the blog