Nox sparse attention against SpargeAttn
Comparing SpargeAttn to Nox sparse attention on MiniMax-H3
This is a follow-up to our sparse attention post. That post introduced Nox sparse attention, attention mass and the Laplacian loss. Since then we added SpargeAttn to Nox as a second sparse attention backend. We compared the two on a MiniMax-H3 I2V render and found that one setting decides more of the result than the routers themselves: how a router treats the text and conditioning tokens.
We use the same setup as the distilled checkpoint comparison and its rally car I2V shot.
| Rally car, I2V, 15% video budget | Prefix density | First step | Denoise | SSIM to dense | Laplacian loss |
|---|---|---|---|---|---|
| Dense SageAttention | – | dense | 58.4s | – | – |
| Nox sparse attention | 1.0 | sparse | 33.9s | 0.667 | 13.1% |
| SpargeAttn | 1.0 | sparse | 35.3s | 0.661 | 15.9% |
| Nox sparse attention | 0.15 | sparse | 30.5s | 0.599 | 25.5% |
| SpargeAttn | 0.15 | sparse | 31.8s | 0.608 | 35.0% |
| Nox sparse attention | 1.0 | dense | 39.3s | 0.806 | 2.7% |
| SpargeAttn | 1.0 | dense | 41.1s | 0.789 | 4.8% |
SpargeAttn in Nox
SpargeAttn is a training-free sparse attention from the SageAttention authors. It routes like the raster routing in our previous post: it mean-pools the queries and keys of every tile and scores each query tile against each key tile with a dot product. Each query tile keeps its top-scoring key tiles. Tokens stay in their natural raster order.
Sparge adds two safeguards on top of that router. The first is a similarity check: a tile mean only represents a tile when its tokens point in similar directions. So Sparge computes the mean pairwise cosine similarity inside each tile.
The second safeguard sits inside the attention kernel. When a key tile’s largest score is far enough below the running row maximum, its softmax weight is negligible. The kernel then skips that tile’s exponentials and its P·V product.
We built Sparge on the same SageAttention kernel and router that run Nox sparse attention. The two backends differ only in routing.
Prefix density
MiniMax-H3 puts about 2,600 non-video tokens in front of the video tokens: the text, the conditioning frame and the audio. We call this the prefix.
The two routers treat the prefix differently by default. Nox sparse attention keeps it dense: every video query tile attends to all 41 prefix key tiles and the prefix query tiles attend to every key. In SpargeAttn prefix tiles compete with video tiles in one top-k.
To compare the routers with the same prefix handling, we made it a parameter. Prefix density sets how much of the prefix a router keeps, independent of the video budget. At 1.0 the prefix stays dense. Below 1.0 the prefix query tiles keep that fraction of all key tiles. The video query tiles keep that fraction of the prefix key tiles and choose them by score next to their video key tiles. The parameter works the same way for both backends.
Routing the prefix costs both backends coherence, because the prefix carries the conditioning: what the prompt asks for and what the first frame looks like.
With the prefix handling matched, Nox sparse attention loses less detail than Sparge at both prefix densities and is faster. Sparge keeps raster tiles, which spend part of the budget on stripes across the frame. That is the ceiling we measured in the previous post. Sparge also runs its similarity check before every routed call.
Adding a dense first step
Nox sparse attention normally runs the first denoising step dense because that step sets the composition. The runs above route every step to isolate the router. We repeated the dense-prefix runs with the first step dense, shown in the last two rows of the table. The dense first step brings both routers much closer to dense, and Nox sparse attention still leads on both measures.
Both renders now follow the first frame and the prompt more closely, but neither is clean. The gap between Nox sparse attention and SpargeAttn grows as the clip progresses, with cars flipping around and turning backwards.
Conclusion
We expose the sparse attention algorithm and the prefix density as changeable settings for experimentation. The default stays Nox sparse attention with prefix density 1.0, which stayed closest to dense in every comparison above. We ultimately think this won’t be a viable path to lowering denoising costs because it gives up too much quality.