betaFeedback

WorksComputer Science

MC-Sparse: Deconstructing and Closing the Dense-Sparse Attention Gap in Diffusion Transformers

Abstract

Sparse attention is a primary approach to reducing the latency of diffusion transformers in long-sequence generation tasks, such as video and high-resolution 3D asset generation. However, existing methods can degrade generation quality and fidelity at high sparsity levels. Through controlled oracle comparisons, we trace this degradation to three sources: constraints imposed by token grouping, inaccurate interaction selection, and the attention contributions lost when tokens are discarded. Guided by this analysis, we propose Meta-Cached Sparse Attention (MC-Sparse), a training-free framework that selects individual key-value (KV) tokens while organizing similar queries into tile-aligned groups for efficient GPU execution. MC-Sparse caches metadata comprising query groups, KV indices selected using exact attention probabilities, and residuals between dense and sparse attention outputs, and reuses them across subsequent denoising steps. Across video and 3D generation models, MC-Sparse achieves higher fidelity to dense-attention outputs and larger denoising speedups than existing sparse-attention baselines, without visible quality degradation. Relative to dense attention, it delivers a 1.80×1.80\times denoising speedup on Minimax-H3-Base and a 2.32×2.32\times speedup on 3D asset generation, both with negligible quality loss.

https://dodododdo.github.io/mcsparse-project-page/

Figure 1. Quality and efficiency of MC-Sparse on Minimax-H3-Base at 768p. Left: quality metrics and DiT denoising latency. At 15% and 25% attention density, MC-Sparse achieves 1.80× and 1.61× speedup over dense attention (FA3), respectively. Right: frames generated at 15% density closely match the dense-attention reference across the video.

Introduction

Diffusion transformers ((Peebles & Xie, 2023)) have become a dominant backbone for high-fidelity video and 3D asset generation ([12, 8 a] (Wan et al. 2025)). However, their growing sequence lengths make attention a major inference bottleneck: its quadratic cost scales rapidly with video duration and output resolution, since it must process spatiotemporal video tokens and geometric 3D tokens. Sparse attention offers a natural remedy, as attention often concentrates on a small subset of token interactions. Yet aggressive sparsity frequently degrades generation quality, leaving a persistent gap between the efficiency of sparse attention and the fidelity of dense attention.

Most existing methods impose sparsity at block granularity ((Xi et al., 2025; Zhang et al., 2025c)). Block-sparse attention (BSA) selects entire KV blocks for each group of queries, which maps well onto efficient GPU tiles. In practice, block importance is typically estimated from pooled query and key representations ([10 a]). This design entangles two sources of error: the approximate scores used to pick blocks, and the coarse block layout that restricts which interactions can be picked at all. As a result, it is hard to tell how much of the quality gap stems from the selector, how much from the block structure, and how much persists even when both are improved.

We examine these questions through controlled oracle comparisons at matched attention densities (i.e., the same sparsity level). Each oracle maximizes the retained attention mass using exact dense-attention probabilities, but differs in selection granularity: the block oracle selects oracle KV blocks for each query group; the token oracle selects or oracle individual KV tokens for each query group; and the per-query oracle further lets every query choose its own KV tokens. Comparing mean-pooled BSA with these oracles, and the oracles with one another, isolates three sources of the quality gap (Figure 2): structural binding error, which arises because KV tokens are bound together in blocks and different queries in the same group share a single selection; selection error, which arises from approximate scoring (e.g. mean pooling); and discarded tail error, which arises because omitted tokens still carry nonzero attention mass. These findings motivate three design principles: finer-grained selection, accurate attention scoring, and compensation for discarded contributions.

Figure 2. Oracle comparisons of the dense-to-sparse gap on Wan2.1-1.3B-T2V at 480p. Experimental settings are provided in Appendix § 7.

Realizing these principles efficiently is challenging. First, exact token-level selection requires computing attention scores, which is expensive, and gathering individual KV tokens causes irregular memory access. Second, queries must still be grouped into sufficiently large tiles for efficient GPU execution. Unconstrained clustering can group similar queries to reduce structural binding, but it yields variable-size groups that must be padded to fill the kernel’s computation tiles, wasting computation ((Zhou et al., 2026)). Third, token-level selection removes the block structure that would otherwise provide a natural way to summarize discarded regions for compensation.

Temporal redundancy across denoising steps offers a way to amortize exact selection and to support compensation. We find that reusing exact selections from earlier steps can outperform recomputing mean-pooled selections at every step, and that the dense–sparse output residual changes little between nearby steps. Building on these observations, we propose Meta-Cached Sparse Attention (MC-Sparse), a training-free framework that combines token-level KV selection, tile-aligned query grouping, and cross-step reuse. At anchor steps, MC-Sparse groups similar queries into equal-size tiles, selects KV tokens according to their exact attention mass aggregated over each query group, and records the dense–sparse output residual. Subsequent steps reuse the query groups, selected indices, and cached residuals, while computing attention with the current queries, keys, and values. This amortizes the cost of grouping and exact selection, and the cached residuals compensate for the discarded tail across steps. To make this efficient in practice, we develop fast Principal Direction Divisive Partitioning (PDDP) ([1]) for grouping, a two-pass exact selector for selection, and a token-sparse attention kernel for execution.

Across the evaluated video models, MC-Sparse achieves higher fidelity to dense-attention outputs and larger denoising speedups than the compared sparse-attention baselines, while preserving visual quality. On Minimax-H3-Base, at 15% attention density, it reaches a 1.80×

DiT denoising speedup over dense attention with higher fidelity than competing sparse methods. On HY3D-Internal, at the same density, it achieves a 2.32× denoising speedup with negligible quality degradation.

Our contributions are summarized as follows:

  • We use controlled oracle comparisons to disentangle three sources of quality degradation in sparse attention: structural binding error, selection error, and discarded tail error, and quantify how each affects attention fidelity at matched attention densities.

  • We propose MC-Sparse, a training-free framework that combines token-level KV selection and tile-aligned query grouping with cross-step reuse of exact selections and output residuals, together with efficient GPU implementations.

  • We demonstrate the effectiveness and generality of MC-Sparse on multiple diffusion transformer models, spanning both video and 3D asset generation.

Related Work

Long-Sequence Diffusion Transformers

Diffusion transformers (DiTs) (Peebles & Xie, 2023) are widely used in content generation, with video and 3D asset generation representing two prominent long-sequence tasks. Representative models include HunyuanVideo (Kong et al., [6]), Wan2.1 (Wan et al., 2025), and MiniMax-H3 (MiniMax, [12]) for video generation, alongside recent advances in 3D asset generation (Lai et al., [7]; Xiang et al., 2025; Wang et al., 2026b;d). As generation resolution increases, these tasks require longer token sequences, which can reach tens to hundreds of thousands of tokens, making the quadratic cost of full attention a dominant contributor to inference latency.

Efficient Attention

Trainable efficient attention. Trainable approaches include linear attention methods such as SANA (Xie et al., 2024), SANA-Video (Chen et al., [2]), and MHLA (Zhang et al., 2026c), and sparse attention methods such as VMoBA (Wu et al., 2025), VSA (Zhang et al., 2025c), and SpargeAttention2 (Zhang et al., 2026a), as well as hybrid attention methods such as SLA (Zhang et al., 2025a) and SLA2 (Zhang et al., 2026b).

Training-free sparse attention. Training-free sparse attention instead aims to approximate full attention in pretrained models while evaluating fewer token interactions. Many approaches organize computation into blocks to exploit FlashAttention-style tiling (Dao et al., [3]). Block selection uses structured patterns or content-dependent importance estimates, as explored by SVG (Xi et al., 2025), XAttention (Xu et al., 2025), and SpargeAttention (Zhang et al., 2025b). SVG-EAR (Zhou et al., 2026) and PISA (Li et al., [10]) further approximate contributions from unselected blocks. Block construction commonly forms tile-aligned groups based on spatial or spatiotemporal locality, or after serialization along Hilbert or Z-order curves, with SpargeAttention using Hilbert ordering; semantic clustering in SVG2 (Yang et al., 2026), SVOO ([11]), and AdaCluster (Tan et al., 2026) instead produces variable-sized groups whose mismatch with kernel tile boundaries introduces wasted computation within partially filled tiles, reducing actual execution efficiency even without explicit padding. A complementary line of work exploits cross-step redundancy in attention, a strategy also used in diffusion caching (Wang et al., 2026a;c). AdaSpa (Xia et al., 2025), DiTFastAttn (Yuan et al., 2024), and QuantSparse ([4]) reuse attention-related information along the denoising trajectory.

Preliminaries

Dense attention. Diffusion transformers typically use multi-head attention. For a single head with query, key, and value matrices Q\mathbf{Q}, K\mathbf{K}, and V\mathbf{V}, and query/key dimension dd, dense attention computes Ofull=Softmax⁡(QKTd)V\mathbf{O}^{\mathrm{full}} = \operatorname{Softmax}\left(\frac{\mathbf{Q}\mathbf{K}^{\mathsf{T}}}{\sqrt{d}}\right)\mathbf{V}, where the softmax is taken over keys. We write AijA_{ij} for the resulting attention weight from query ii to key jj.

Block-sparse attention. Sparse attention restricts each query to a subset of keys: Osparse=Softmax⁡(QKTd+M)V\mathbf{O}^{\mathrm{sparse}} = \operatorname{Softmax}\left(\frac{\mathbf{Q}\mathbf{K}^{\mathsf{T}}}{\sqrt{d}} + \mathbf{M}\right)\mathbf{V}, where Mij=0M_{ij}=0 retains the query–key interaction and Mij=−∞M_{ij}=-\infty masks it out. For efficient GPU execution, block-sparse attention (BSA) partitions queries and keys into blocks, retains entire KV blocks, and shares one selection among all queries in a block. The block size is typically aligned with the GPU computation tile.

Vanilla BSA. We refer to BSA with a mean-pooled selector as vanilla BSA. At each diffusion step, this selector scores each query-block/KV-block pair (g,r)(g,r) by z^gr=qˉgTkˉrd\hat{z}_{gr} = \frac{\bar{\mathbf{q}}_{g}^{\mathsf{T}}\bar{\mathbf{k}}_{r}}{\sqrt{d}}, where qˉg\bar{\mathbf{q}}_{g} and kˉr\bar{\mathbf{k}}_{r} are the mean-pooled query and key of blocks gg and rr, respectively. For each query block, it retains the highest-scoring KV blocks under a given attention density.

Method

We first examine where vanilla BSA loses fidelity relative to dense attention. An oracle selector retains the entries with the largest dense-attention probability mass under a fixed attention density. We consider three oracles (Figure 2): the block oracle selects KV blocks for each query block; the token oracle (shared Q block) selects individual KV tokens but shares one selection within each query block; and the per-query oracle selects KV tokens independently for each query. At matched densities, comparing vanilla BSA with these oracles and with dense attention isolates three sources of the gap: structural binding error, selection error, and discarded tail error.

Because exact selection and query grouping are costly, MC-Sparse exploits the stability of attention across denoising steps: it performs them only at anchor steps and reuses the resulting query groups, KV indices, and dense–sparse output residual at subsequent reuse steps. In the following subsections, we analyze each error in turn and introduce a corresponding design.

Mitigating Structural Binding Error

Structural binding error arises from two constraints of block-sparse attention. KV binding forces a block-sparse selector to retain irrelevant neighbors of important tokens, while query binding forces queries with different attention patterns to share one selection (Figure 3(a)). Moving from the block oracle to the token oracle with shared query blocks removes KV binding, and moving further to the per-query oracle removes query binding. The accuracy gains at each step (Figure 2) show that both constraints cause losses. Table 4 further confirms this at matched realized densities: finer KV granularity and grouping more similar queries both improve fidelity.

Figure 3. Three sources of the gap between dense and sparse attention.

Query groupingKV granularityAlign.Attention recall ↑ s=0.1s=0.1s=0.2s=0.2s=0.3s=0.3Output rel. L1L_1 ↓ s=0.1s=0.1s=0.2s=0.2s=0.3s=0.3
No reorderblock1.000.6370.7780.8470.1760.1010.069
token1.000.7450.8570.9100.1300.0700.044
k-meansblock2.080.7430.8300.8740.1600.0980.071
token1.450.8400.9040.9350.0930.0540.036
block†2.080.8340.9060.9400.0960.0520.033
token†1.450.8760.9330.9590.0710.0380.023
Fast PDDP (ours)block1.000.7910.8870.9300.1180.0620.038
token1.000.8560.9230.9530.0800.0420.026
Oracle (per query)token–0.9080.9510.9710.0480.0250.015

Table 4. KV-selection granularity and query grouping at matched realized attention density ss. Align. is the ratio of executed to nominal sparse interactions after tile alignment. Black rows include this inflation in the density budget, whereas gray rows ignore it†.

Token-level KV selection. To remove KV binding, MC-Sparse selects individual KV tokens for each query group across block boundaries. The token level sparse attention kernel gathers the selected keys and values online from their indices without repacking them into blocks.

Tile-aligned query grouping. With head-specific keys and values in MHA, efficient attention tiles must batch queries within each head. We therefore form groups GgG_g of CC similar queries that share one KV selection, with CC matched to the kernel’s query tile size. Minimizing within-group variance of QQ is equivalent to maximizing between-group variance. Standard clustering methods such as kk-means do not guarantee equal-size groups, while enforcing hard balance constraints adds assignment overhead and complicates GPU parallelization. We adopt a median-split version of principal direction divisive partitioning (PDDP) (Boley, [1]): it recursively projects each group onto its principal direction and splits the ordered queries at the median until every group contains exactly CC queries, promoting within-group similarity while maintaining tile alignment. Because a naive PDDP implementation is expensive on GPUs, we develop Fast PDDP as described in § 4.4.

Mitigating Selection Error

For a query group GgG_g and a budget of KK KV tokens, we define oracle selection as the set that maximizes the group’s cumulative dense-attention mass:

Sg∗=arg max⁡∣S∣=K∑i∈Gg∑j∈SAij.(1)S_g^* = \underset{|S|=K}{\operatorname{arg\,max}} \sum_{i \in G_g} \sum_{j \in S} A_{ij}. \tag*{(1)}

Here SS is a set of KV indices. This objective is motivated by an output-error bound proportional to discarded attention mass for bounded value norms ((Shen et al., 2026)). Vanilla BSA instead scores pooled representations; even pooling queries alone does not preserve average attention probabilities:

Softmax⁡(qˉgKTd)j≠1∣Gg∣∑i∈GgAij.(2)\operatorname{Softmax}\left(\frac{\bar{q}_g K^{\mathsf{T}}}{\sqrt{d}}\right)_j \ne\frac{1}{|G_g|} \sum_{i \in G_g} A_{ij}. \tag*{(2)}

where qˉg\bar{q}_g is the group mean. Pooled scoring can miss KV tokens with high cumulative mass.

Reusable exact KV Selection. Without a trained indexer, recomputing exact attention scores at every step is costly. Attention patterns remain stable across nearby denoising steps ((Xia et al., 2025)); exact selections from earlier steps outperform mean-pooled selection recomputed at every step (Figure 4). This supports computing Eq. (1) only at anchor steps and reusing the result. At step τ\tau, we obtain Sτ,gS_{\tau,g} by selecting the top-KK tokens ranked by ∑i∈Gτ,gAτ,ij\sum_{i \in G_{\tau,g}} A_{\tau,ij}. We cache the query groups GτG_\tau and selected indices SτS_\tau for subsequent steps, amortizing both grouping and selection. The current QtQ_t, KtK_t and VtV_t are recomputed at each step.

Figure 4. Temporal stability and accuracy of reused exact selection.

Mitigating Discarded Tail Error

Discarded tokens typically have small attention weights but still make nonzero contributions (Figure 3(c)), leaving an output gap to dense attention even with per-query oracle selection.

Temporal residual compensation. Block-sparse methods approximate discarded contributions by incorporating block-mean representations into attention or correcting outputs with block-level statistics [10] (Zhou et al. 2026). Token-level selection cuts irregularly across these blocks, preventing direct reuse of their summaries. We instead exploit the temporal dimension: the dense–sparse residual varies less across denoising steps than the attention output, with exact selection further reducing this variation compared with mean-pooled selection (Figure 5).

Figure 5. Absolute temporal change of attention outputs and dense–sparse residuals under token-level selection. Lower values indicate smaller absolute variation across Δ\Delta denoising steps.

We use a simple additive residual correction (Yuan et al., 2024). At anchor step τ\tau, we record

Rτ=Oτfull−Oτsparse,(3)R_{\tau} = O_{\tau}^{\mathrm{full}} - O_{\tau}^{\mathrm{sparse}}, \tag*{(3)}

where OτsparseO_{\tau}^{\mathrm{sparse}} uses the KV selection. At a subsequent reuse step tt, MC-Sparse computes

O^t=SparseAttn⁡(Qt,Kt,Vt;Gτ,Sτ)+Rτ.(4)\widehat{O}_{t} = \operatorname{SparseAttn}(Q_{t}, K_{t}, V_{t}; \mathcal{G}_{\tau}, \mathcal{S}_{\tau}) + R_{\tau}. \tag*{(4)}

The residual follows the same refresh schedule as the cached groups and KV indices. Because the anchor step already computes dense attention for exact selection, forming the residual adds one sparse-attention evaluation and an elementwise subtraction at each anchor.

Pipeline and Efficient Implementation

Overall pipeline. MC-Sparse alternates between anchor and reuse steps. At an anchor step, which is the last step of a dense warm-up or refresh segment, we run dense attention, construct query groups, perform exact KV selection, and cache the query groups, selected indices, and output residual. At each subsequent reuse step, the current QQ, KK, and VV are recomputed, while attention uses the cached metadata and residual. Figure 6 illustrates the pipeline; Algorithm 1 gives the corresponding pseudocode.

Figure 6. Pipeline overview of MC-Sparse.

Fast PDDP. We obtain principal directions using batched power iteration, processing all nodes at the same tree depth across attention heads in parallel. To reduce peak memory

Algorithm 1 MC-Sparse
Require: Diffusion steps $T$, reuse interval $L$, KV budget $K$
Ensure: Attention outputs $\{\hat{O}_t\}_{t=1}^{T}$
1: for $t = 1, \ldots, T$ do
2:     Compute $Q_t$, $K_t$, and $V_t$
3:     if ISANCHOR($t$, $L$) then
4:         $(O_t^{\mathrm{full}}, l_t) \leftarrow \operatorname{FLASHATTN}(Q_t, K_t, V_t)$
5:         $G_t \leftarrow \operatorname{GROUPQUERIES}(Q_t)$
6:         $S_t \leftarrow \operatorname{EXACTKVSELECTION}(Q_t, K_t, l_t, G_t, K)$
7:         $O_t^{\mathrm{sparse}} \leftarrow \operatorname{SPARSEATTN}(Q_t, K_t, V_t; G_t, S_t)$
8:         $R_t \leftarrow O_t^{\mathrm{full}} - O_t^{\mathrm{sparse}}$
9:         $C \leftarrow (G_t, S_t, R_t)$
10:        $\hat{O}_t \leftarrow O_t^{\mathrm{full}}$
11:    else
12:        $(G, S, R) \leftarrow C$
13:        $O_t^{\mathrm{sparse}} \leftarrow \operatorname{SPARSEATTN}(Q_t, K_t, V_t; G, S)$
14:        $\hat{O}_t \leftarrow O_t^{\mathrm{sparse}} + R$
15:    end if
16: end for

usage and improve speed, we propagate only query-index arrays between tree levels. Table 7 reports its single-call and amortized grouping costs.

Grouping1.3B, 480p Single1.3B, 480p Amort.14B, 720p Single14B, 720p Amort.
Flash-KMeans init.32.02.26295.120.43
+ step update1.5013.38
Fast PDDP11.30.5766.63.33

Table 7. Query-grouping latency on Wan2.1-T2V (ms per layer). Amortized over 40 steps: 2 Fast PDDP calls or Flash-KMeans with a 50-iteration initialization and 39 two-iteration updates.

Two-pass exact selection. FlashAttention does not expose attention logits, so we implement a two-pass kernel for exact KV selection. Details are provided in Appendix § 7.§ 2.

Token-sparse attention kernel. We implement the token-sparse attention kernel in CuTeDSL, with performance comparisons in Table 6 and design details in Appendix § 7.§ 2.

KernelSparse layouts=0.2s = 0.2s=0.3s = 0.3s=0.5s = 0.5
BSAregular blocks4.96× (0.99)3.30× (0.99)1.97× (0.99)
PISA kernelregular blocks4.11× (0.82)2.84× (0.85)1.73× (0.87)
SVG2 kernelvariable-length blocks4.02× (0.80)2.70× (0.81)1.62× (0.81)
MC-Sparsetile-aligned Q, gathered KV4.79× (0.96)3.25× (0.98)1.97× (0.99)

Table 6. Attention-kernel speedup on Wan2.1-14B-T2V (720p), using a Hopper GPU in BF16 (H=40H = 40, D=128D = 128, S=75600S = 75600). Entries show speedup ρ=tFA3/t\rho= t_{\mathrm{FA3}}/t (efficiency η=ρs\eta= \rho s relative to the ideal 1/s1/s speedup). Selection and grouping are excluded.

Cache offloading and prefetching. When GPU memory is insufficient, we offload inactive cache entries to CPU memory and prefetch them ahead of use, overlapping transfers with computation to hide latency. Table 8 demonstrates the effectiveness of prefetching.

ModelVV (MB)CC (TFLOP)C/VC/V (FLOP/B)Transfer (ms)Compute (ms)Transfer hidden
Wan2.1-14B-T2V243529.111,40947.7208.8✓
HunyuanVideo-13B271034.612,16452.9244.5✓

Table 8. Per-layer cost of offloading cached output residuals and selected KV indices to CPU memory. VV is the transfer volume and CC the sparse-attention FLOPs; C/VC/V gives the break-even compute-to-PCIe-bandwidth ratio for overlap. Check marks indicate transfers hidden by prefetching one layer ahead in the measured setting.

Experiments

Experimental Setup

Tasks and baselines. We evaluate video generation with Minimax-H3-Base (MiniMax, [12]), HunyuanVideo-13B (Kong et al., [6]), and Wan2.1-14B-T2V/I2V (Wan et al., 2025), and image-to-geometry generation with HY3D-Internal. Following SVG-EAR (Zhou et al., 2026), we use Penguin Benchmark prompts for text-to-video and VBench image–prompt pairs for image-to-video, and a detail-oriented image test set for 3D generation. We compare with FA3-based dense attention (Shah et al., 2024), SVG2, SVG-EAR, Sol-Attn (Li et al., [9]), PISA (Li et al., [10]), and SpargeAttn (Zhang et al., 2025b), as applicable to each model.

Metrics. PSNR, SSIM, and LPIPS (Zhang et al., 2018) measure video fidelity to dense-attention outputs, while VBench (Huang et al., [5]) measures image quality (ImgQual) and background consistency (BgCons). For 3D assets, we report geometric fidelity using Chamfer distance (CD), volumetric IoU, and F1, and input-image consistency using Uni3D-I (Zhou et al., 2023) and ULIP3D-I (Xue et al., 2023). Efficiency is measured by attention density, the fraction of retained query–key interactions, and DiT denoising speedup over dense attention, including warm-up but excluding condition encoding and VAE decoding. Detailed settings are provided in Appendix § 7.

Main Results

Video generation. Table 1 shows improved fidelity and denoising speedup across the evaluated video models. On Minimax-H3-Base, MC-Sparse achieves 28.44 dB PSNR at 25% density and 1.61× speedup, compared with 23.66 dB and 1.59× for Sol-Attn at 32.4% density. With the same anchor schedule, MC-Sparse-Flash reaches 1.80×1.80\times speedup at 15% density with 27.30 dB PSNR, retaining higher fidelity than both Sol-Attn and PISA. On Hunyuan and Wan, MC-Sparse achieves the highest PSNR and SSIM and the lowest LPIPS among the evaluated sparse methods, with 1.52×1.52\times–1.82×1.82\times speedup. The qualitative comparisons in Figure 7 show that MC-Sparse produces videos visually closer to the dense-attention outputs than the compared sparse methods, consistent with the fidelity metrics. Qualitative results on other video generation models are provided in Figure 9.

MethodPSNR↑\uparrowSSIM↑\uparrowLPIPS↓\downarrowImgQual↑\uparrowBgCons↑\uparrowDensity↓\downarrowSpeedup↑\uparrow
Minimax-H3-Base, 768p, T2AV (video branch)
Full Attn (FA3)---69.2091.72100%1.00×1.00\times
Sol-Attn23.660.8160.23468.8391.7332.4%1.59×1.59\times
PISA23.450.8110.24368.5491.6430.0%1.52×1.52\times
MC-Sparse (density=25%)28.440.8990.16169.0091.8125.0%<u>1.61×1.61\times</u>
MC-Sparse (density=15%)<u>27.30</u><u>0.882</u><u>0.176</u><u>68.94</u>91.8515.0%1.80×1.80\times
HunyuanVideo-13B, 720p, T2V
Full Attn (FA3)---68.5296.91100%1.00×1.00\times
Sol-Attn28.060.8980.15968.2797.0332.3%1.79×1.79\times
PISA27.650.8900.17468.74<u>96.96</u>30.0%1.70×1.70\times
MC-Sparse (density=25%)32.890.9400.11468.6696.8925.0%<u>1.82×1.82\times</u>
MC-Sparse (density=15%)<u>30.78</u><u>0.919</u><u>0.135</u><u>68.67</u><u>96.96</u>15.0%2.00×2.00\times
Wan2.1-14B-T2V, 720p
Full Attn (FA3)---67.1196.60100%1.00×1.00\times
SpargeAttn23.560.8280.21266.8496.8130.0%-
Sol-Attn24.620.8520.15767.0196.7231.6%<u>1.52×1.52\times</u>
PISA24.030.8380.20267.09<u>96.76</u>30.0%<u>1.52×1.52\times</u>
SVG226.020.8750.16667.1196.5231.5%1.34×1.34\times
SVG-EAR<u>27.61</u><u>0.897</u><u>0.142</u>66.9796.4125.3%1.38×1.38\times
MC-Sparse (Ours)28.810.9120.12867.1296.7025.0%1.53×1.53\times
Wan2.1-14B-I2V, 720p
Full Attn (FA3)---70.3796.51100%1.00×1.00\times
SpargeAttn26.660.8590.17270.4096.3030.0%-
Sol-Attn27.730.8760.15770.3496.4631.9%<u>1.51×1.51\times</u>
PISA27.100.8650.16370.3896.4030.0%<u>1.51×1.51\times</u>
SVG227.150.8610.16870.32<u>96.42</u>30.4%1.35×1.35\times
SVG-EAR<u>30.71</u><u>0.916</u><u>0.127</u>70.3496.3824.6%1.39×1.39\times
MC-Sparse (Ours)32.110.9290.11770.4196.4625.0%1.52×1.52\times

Table 1. Video generation results. PSNR, SSIM, and LPIPS compare with dense-attention outputs; ImgQual and BgCons are VBench scores. Speedup measures DiT denoising only. Bold and underlined values indicate the best and second-best results, respectively, excluding Full Attn.

Qualitative comparison of video generation using Minimax-H3-Base

Figure 7. Qualitative comparison of video generation using Minimax-H3-Base.

Figure 9. Qualitative comparison with full attention across video generation models.

3D asset generation. At 15% attention density, MC-Sparse achieves 2.32×2.32\times denoising speedup and the best geometric fidelity among the evaluated sparse methods (Table 2), reducing CD from PISA’s 0.976 to 0.177. Its input-image consistency remains comparable to dense attention. In Figure 8, MC-Sparse better preserves fine details and surface continuity, while the compared methods exhibit broken surfaces and missing details despite using higher attention densities.

ConfigCD↓\downarrowVol-IoU-1536↑\uparrow[email protected]↑\uparrowUni3D-I↑\uparrowULIP3D-I↑\uparrowDensity↓\downarrowSpeedup↑\uparrow
HY3D-Internal
Full Attn (FA3)---0.33090.1204100%1.00×\times
Sol-Attn1.90150.5570.360.33010.120336.1%1.57×\times
PISA0.97663.2283.290.33040.120425.0%<1.87×< 1.87\times
MC-Sparse (Ours)0.17782.9196.330.33110.120615.0%2.32×\times

Table 2. Image-to-geometry results on HY3D-Internal. Geometric fidelity is measured against dense-attention outputs; Uni3D-I and ULIP3D-I measure input-image consistency. Speedup measures DiT denoising only.

Figure 8. Qualitative comparison on 3D asset generation.

Ablation Study

Component contributions. Starting from vanilla BSA, we successively add exact KV selection with cross-step reuse, token-level KV granularity, query grouping, and residual compensation (Table 3). Each addition improves PSNR, SSIM, and LPIPS across all evaluated densities, supporting the contribution of each component to the full framework.

ConfigurationDensity s=0.2s = 0.2Density s=0.25s = 0.25Density s=0.3s = 0.3
PSNR ↑SSIM ↑LPIPS ↓PSNR ↑SSIM ↑LPIPS ↓PSNR ↑SSIM ↑LPIPS ↓
Vanilla BSA20.960.75350.271421.670.77500.246922.260.79230.2278
+ exact KV selection (w. reuse)21.600.77310.248222.630.80040.217623.470.82050.1956
+ token granularity22.570.79540.225423.540.81880.199524.380.83800.1789
+ query grouping23.510.81750.201724.470.83860.178425.240.85390.1624
+ compensation (full model)27.050.88090.132627.350.88430.129427.540.88620.1273

Table 3. Cumulative ablation on Wan2.1-1.3B-T2V at 480p. Each row adds one component to the preceding configuration. Settings are provided in Appendix § 7.

KV granularity and query grouping. Table 4 shows that token-level KV selection improves attention recall and output accuracy under every grouping strategy. We match realized density after tile alignment, since padding variable-size kk-means groups increases executed interactions beyond the nominal budget. Under this comparison, Fast PDDP avoids alignment inflation and consistently outperforms kk-means, supporting both token-level selection and tile-aligned query grouping.

Role of residual compensation. Residual compensation yields the largest gain in the cumulative ablation, but its benefit is substantially greater with MC-Sparse’s selection and grouping designs than with vanilla BSA (Table 5), indicating that its effectiveness depends on their combination. PISA receives smaller additional gains than vanilla BSA with its native block-statistics compensation retained, consistent with both mechanisms compensating for discarded tail contributions.

Configurations=0.20s = 0.20 PSNR ↑Δ\Deltas=0.25s = 0.25 PSNR ↑Δ\Deltas=0.30s = 0.30 PSNR ↑Δ\Delta
MC-Sparse w/o residual compensation23.51–24.47–25.24–
MC-Sparse27.05+3.5427.35+2.8827.54+2.30
Vanilla BSA20.96–21.67–22.26–
+ our residual compensation22.21+1.2523.12+1.4523.90+1.64
PISA21.66–22.14–22.52–
+ our residual compensation22.15+0.4922.92+0.7823.42+0.90

Table 5. PSNR (dB) before and after adding our residual compensation at target attention density ss. Δ\Delta is the PSNR gain from adding the residual. PISA retains its native block-statistics compensation in both configurations.

System Efficiency

Token-sparse attention kernel. Table 6 compares attention kernels at matched KV-token densities on Wan2.1-14B-T2V at 720p, excluding selection and grouping. SVG2 uses Qc=300Q_c = 300 and Kc=1000K_c = 1000. MC-Sparse achieves 96%–99% of the ideal 1/ss speedup, versus 80%–81% for SVG2 and 82%–87% for PISA, showing that token-level KV gathering preserves kernel efficiency.

Tile-aligned query grouping. Table 7 compares Fast PDDP with Flash-KMeans. Under the evaluated schedules, Fast PDDP reduces amortized grouping cost by 3.96× at 480p and 6.14× at 720p, keeping tile-aligned query grouping inexpensive.

Anchor-step overhead. The two-pass selector adds a QK-only pass costing approximately half a dense attention evaluation in GEMM operations. With the first anchor overlapping the final warm-up step (Table 9), the additional dense evaluation and selection passes yield an amortized overhead equivalent to an absolute density increase of Δs≈5%\Delta s \approx5\% over all denoising steps. Including query grouping and other auxiliary operations, the measured overhead is equivalent to Δs≈5%\Delta s \approx5\%–6%6\%, below SVG2’s combined clustering and variable-length kernel overhead.

ModelSettingWarm-up layersWarm-up stepsAnchor steps
Wan2.1-1.3B-T2V480p, 5s, text-to-video1/3010/50{10, 26}
Wan2.1-14B-I2V720p, 5s, image-to-video1/4010/50{10, 26}
Wan2.1-14B-T2V720p, 5s, text-to-video1/4010/50{10, 26}
Hunyuan-13B720p, 5.25s, text-to-video1/20, 1/4010/50{10, 26}
Minimax-H3-Base768p, 14.4s, text-to-audio-video1/5210/49{10, 26}
HY3D-Internal1536 resolution, image-to-geometry1/401/12{1}

Table 9. Dense warm-up and MC-Sparse anchor configurations. Warm-up entries denote count / total count. Hunyuan lists dual-stream and single-stream layers, respectively.

Cache offloading and prefetching. Table 8 reports per-layer transfer and sparse-attention costs. For both evaluated models, transferring the cached residuals and selected KV indices takes less time than sparse-attention computation. Prefetching one layer ahead hides the transfer latency in these measured settings.

Conclusion

We presented MC-Sparse, a training-free framework for accelerating diffusion transformers with token-level sparse attention. Our oracle comparisons show that the dense-to-sparse gap extends beyond selection accuracy to include structural binding and discarded tail contributions. Guided by this analysis, MC-Sparse combines token-level KV selection and tile-aligned query grouping with temporal reuse and residual compensation, balancing approximation quality with execution efficiency. Experiments on video and 3D asset generation demonstrate improved fidelity to dense-attention outputs and reduced denoising latency compared with the evaluated sparse-attention baselines.

Experimental Details

Evaluation Protocol

Video generation evaluation. Following SVG-EAR, we use the Penguin Benchmark text-to-video prompts refined by the VBench team and the VBench image–prompt pairs with enhanced prompts for image-to-video generation. We randomly select 50 samples from each task’s evaluation set. For Minimax-H3-Base, we further rewrite the test prompts with the official prompt-enhancement API and generate 345-frame videos, approximately 14.4 seconds long.

Analysis and ablation. We use Wan2.1-1.3B-T2V at 480p only for the analysis and ablation experiments. When computing the analysis metrics, we uniformly sample diffusion steps and transformer layers outside the dense warm-up regions. Analysis experiments use the same evaluation set as the corresponding generation task. We compute the reported metrics by uniformly sampling diffusion steps and transformer layers outside the dense warm-up regions.

Warm-up configuration. Table 9 lists the dense warm-up steps and layers for the video model configurations and the 3D generation experiment. Each entry gives the number of warm-up steps or layers divided by the corresponding total. For Hunyuan, 1/20 and 1/40 refer to the dual-stream and single-stream layers, respectively. MC-Sparse uses the same dense warm-up configuration as the corresponding baseline; its anchor steps are also listed in the table.

Baseline configuration. For Wan 2.1, we follow the baseline configurations used by SVG-EAR, with the key SVG2 and SVG-EAR parameters summarized in Table 10. Their warm-up schedules follow Table 9. For Sol-Attn, we use the diagonal estimator with τ=0.52\tau= 0.52, obtained by inverting the Gaussian approximation for a target attention density of 30%. We use the same Sol-Attn configuration for HY3D-Internal. For a fair comparison, none of the methods applies special treatment to condition tokens.

ModelQcQ_cKcK_cSVG2SVG-EAR
Wan2.1-14B-T2V30010000.900.85
Wan2.1-14B-I2V30010000.900.85

Table 10. SVG2 and SVG-EAR settings following the SVG-EAR evaluation setup. QcQ_c and KcK_c denote the numbers of query and key clusters.

Efficiency measurement. We report speedup relative to dense attention based on DiT denoising latency, including dense warm-up computation. We do not report SpargeAttn’s runtime because its implementation couples sparsification with low-precision attention, using INT8 or FP8 instructions for the QK and PV matrix multiplications, whereas the other methods use BF16, making the latencies not directly comparable. PISA’s provided kernel cannot run efficiently on this model without modification. We therefore use the Sol-Attn kernel latency at the same attention density to estimate an upper bound on PISA’s denoising speedup on HY3D-Internal.

Implementation Details

Operators and attention backend. Following the implementation practices of SVG2 and SVG-EAR, all Wan 2.1 and HunyuanVideo runs, including the dense-attention baseline, use optimized operators such as RoPE and normalization. Dense attention during warm-up uses FlashAttention-3 (FA3). Minimax-H3-Base uses the operators provided by Diffusers, with FA3 for both the dense-attention baseline and dense warm-up steps.

Hardware and parallelism. Wan 2.1, HunyuanVideo, and HY3D-Internal run on 1 Hopper GPU, including the condition encoder and VAE where applicable. Minimax-H3-Base runs on 8 Hopper GPUs: 1 handles condition encoding and VAE decoding, while the remaining 7 execute the denoiser with Ulysses sequence parallelism, which partitions the attention heads.

Two-Pass exact selection kernel. FlashAttention uses online softmax and does not expose the full normalized attention matrix needed for exact selection. We therefore use two passes: the first returns the dense output and row-wise log-sum-exp values; the second recomputes QK scores and uses these values to recover attention probabilities. We fuse group-wise aggregation into the second pass and apply top-KK to the aggregated attention mass, avoiding materialization of the dense attention matrix.

Token-Sparse Attention kernel. We implement the token-sparse attention kernel in CuTeDSL with warp-specialized producer and consumer warps. Producer warps resolve selected indices and gather key and value rows asynchronously into shared memory. Consumer warpgroups apply WGMMA operations and online softmax, while a multi-stage pipeline overlaps the next gather with the current computation.

More qualitative results

References

  1. [1]Daniel Boley. Principal direction divisive partitioning. Data Mining and Knowledge Discovery, 2(4):325–344, 1998. URL citeseer.ist.psu.edu/boley97principal.html.
  2. [2]Junsong Chen, Yuyang Zhao, Jincheng Yu, Ruihang Chu, Junyu Chen, Shuai Yang, Xianbang Wang, Yicheng Pan, Daquan Zhou, Huan Lin, Haozhe Liu, Hongwei Yi, Hao Zhang, Muyang Li, Yukang Chen, Han Cai, Sanja Fidler, Ping Luo, Song Han, and Enze Xie. Sana-video: Efficient video generation with block linear diffusion transformer, 2025. URL https://arxiv.org/abs/2509.24695.
  3. [3]Tri Dao, Daniel Y. Fu, Stefano Ermon, Аtri Rudra, and Christopher Ré. Flashattention: Fast and memory-efficient exact attention with io-awareness, 2022. URL https://arxiv.org/abs/2205.14135.
  4. [4]Weilun Feng, Chuangguang Yang, Haotong Qin, Mingqiang Wu, Yuqi Li, Xiangqi Li, Zhulin An, Libo Huang, Yulun Zhang, Michele Magno, and Yongjun Xu. Quantsparse: Comprehensively compressing video diffusion transformer with model quantization and attention sparsification, 2026. URL https://arxiv.org/abs/2509.23681.
  5. [5]Ziqi Huang, Yinan He, Jiashuo Yu, Fan Zhang, Chenyang Si, Yuming Jiang, Yuanhan Zhang, Tianxing Wu, Qingyang Jin, Nattapol Chanpaisal, Yaohui Wang, Xinyuan Chen, Limin Wang, Dahua Lin, Yu Qiao, and Ziwei Liu. Vbench: Comprehensive benchmark suite for video generative models, 2023. URL https://arxiv.org/abs/2311.17982.
  6. [6]Weijie Kong, Qi Tian, Zijian Zhang, Rox Min, Zuozhuo Dai, Jin Zhou, Jiangfeng Xiong, Xin Li, Bo Wu, Jianwei Zhang, Kathrina Wu, Qin Lin, Junkun Yuan, Yanxin Long, Aladdin Wang, Andong Wang, Changlin Li, Duojun Huang, Fang Yang, Hao Tan, Hongmei Wang, Jacob Song, Jiawang Bai, Jianbing Wu, Jinbao Xue, Joey Wang, Kai Wang, Mengyang Liu, Pengyu Li, Shuai Li, Weiyan Wang, Wenqing Yu, Xinchi Deng, Yang Li, Yi Chen, Yutao Cui, Yuanbo Peng, Zhentao Yu, Zhiyu He, Zhiyong Xu, Zixiang Zhou, Zunnan Xu, Yangyu Tao, Qinling Lu, Songtao Liu, Dax Zhou, Hongfa Wang, Yong Yang, Di Wang, Yuhong Liu, Jie Jiang, and Caesar Zhong. Hunyuanvideo: A systematic framework for large video generative models, 2025. URL https://arxiv.org/abs/2412.03603.
  7. [7]Zeqiang Lai, Yunfei Zhao, Haolin Liu, Zibo Zhao, Qingxiang Lin, Huiwen Shi, Xianghui Yang, Mingxin Yang, Shuhui Yang, Yifei Feng, Sheng Zhang, Xin Huang, Di Luo, Fan Yang, Fang Yang, Lifu Wang, Sicong Liu, Yixuan Tang, Yulin Cai, Zebin He, Tian Liu, Yuhong Liu, Jie Jiang, Linus, Jingwei Huang, and Chunchao Guo. Hunyuan3d 2.5: Towards high-fidelity 3d assets generation with ultimate details, 2025a. URL https://arxiv.org/abs/2506.16504.
  8. [8]Zeqiang Lai, Yunfei Zhao, Zibo Zhao, Haolin Liu, Qingxiang Lin, Jingwei Huang, Chunchao Guo, and Xiangyu Yue. Lattice: Democratize high-fidelity 3d generation at scale, 2025b. URL https://arxiv.org/abs/2512.03052.
  9. [9]Haopeng Li, Yitong Li, Junsong Chen, Tian Ye, Haozhe Liu, Jincheng Yu, Duomin Wang, Ruihua Zhang, Zeke Xie, Enze Xie, and Song Han. Sol-attn: Accelerating video generation inference via on-the-fly attention sparsification, 2026a. URL https://arxiv.org/abs/2607.02407.
  10. [10]Haopeng Li, Shitong Shao, Wenliang Zhong, Zikai Zhou, Lichen Bai, Hui Xiong, and Zeke Xie. Piecewise sparse attention is wiser for efficient diffusion transformers, 2026b. URL https://arxiv.org/abs/2602.01077.
  11. [11]Jiayi Luo, Jiayu Chen, Jiankun Wang, Cong Wang, Hanxin Zhu, Qingyun Sun, Chen Gao, Zhibo Chen, and Jianxin Li. Attention sparsity is input-stable: Training-free sparse attention for video generation via offline sparsity profiling and online qk co-clustering, 2026. URL https://arxiv.org/abs/2603.18636.
  12. [12]MiniMax. MiniMax H3: An Open Model Breaking the Boundaries Between Tasks and Modalities. Official research blog, 2026. URL https://www.minimax.io/blog/minimax-h3. Accessed 2026-09-17.

Paper details

vlnc:W_2jkcfwp8
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 2

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents