arXiv:2611.24479cs.CVNov 2026

Manuscript Offprint

arXiv:2611.24479

Every Query Routes Itself: Accelerating Video Diffusion Transformers with Per-Query Routed Sparse Attention

Zhen Huang, Shuwei Li, Ruizhe Yao, Xinrui Chen, Danyi Liu, Haoyuan Liang, Zhiyu Ye, Qiuyan Sun, Bingwei Chen, Yiyuan Li, Xu Zhou, Haohuan Fu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Self-attention over long token sequences dominates the inference cost of video diffusion transformers. Clustering-based sparse attention clusters both queries and keys and lets all queries in a cluster share one selection of key clusters. We show that this sharing limits accuracy: with key clusters and density fixed, attention grows more accurate as the query clusters are refined, and is most accurate when each query selects on its own, which needs no query clustering at all. We therefore propose Per-Query Routed Sparse Attention (PQRS), a training-free method that clusters only keys, lets each query select its own key clusters, and compensates for the unselected ones with their centroids. Per-query selections leave no query tile with a shared key list, so PQRS traverses key clusters instead of queries, buckets queries with identical selections into dense tasks, and merges their partial results in one pass under a fixed softmax offset carried from the previous denoising step. On four text-to-video and image-to-video models from the Wan and HunyuanVideo families, PQRS is the fastest of all the sparse attention methods we evaluate and the closest to the dense output, reaching 28.928.9 dB PSNR on Wan2.1-T2V and 35.435.4 dB on HunyuanVideo at 1.661.66–2.10×2.10\times end-to-end speedup.

Figure

Figure 1: PQRS accelerates 720p video generation while preserving visual quality. Each block shows frames from dense attention (top) and PQRS (bottom) generated with the same prompt and seed. On a single H100, PQRS reaches 1.75×\times and 2.10×\times end-to-end speedup on Wan2.1 and HunyuanVideo, with PSNRs of 27.61 and 33.58 dB on the shown samples. Prompts are truncated.

1 Introduction

Video diffusion transformers denoise token sequences whose length sets their cost: Wan2.1 [28] at 720p with 81 frames denoises N=75,600N=75{,}600 tokens, and self-attention over them is quadratic in NN and accounts for most of the 28 minutes a five-second clip takes on an H100 [35, 25]. Sparse attention reduces this cost by computing only the token pairs that carry most of the attention mass. Most methods select over blocks of contiguous tokens, and contiguity in a video latent does not imply similarity: tokens that respond to the same keys are often far apart in raster order. Clustering-based methods [35, 21, 25, 45] remove this mismatch by grouping tokens by content, and among training-free methods they currently give the best fidelity at a given cost.

Keys and queries are clustered for different reasons. Keys are clustered so that a query can select at cluster granularity. Queries are clustered so that the selection can be executed: when a whole query cluster shares one selection, each selected pair of clusters becomes a dense block for a block-sparse kernel. But the shared selection also fixes what each query may see, and a query that attends differently from its cluster mean is handed the mean’s keys. Holding the key clusters and the density fixed, we find that recall rises and compensated output error falls as the query clusters are refined, with one query per cluster the most accurate. Even when each query cluster is scored by the attention mass it actually receives, so that the score carries no estimation error, a shared selection still trails per-query routing. The sharing itself is what costs accuracy.

Per-query routing needs no query clusters at all, so it removes a step rather than adding one. Query clustering is not free either: a kk-means pass compares every token against every centroid, the same order of cost as scoring every query against the key centroids once. The finest granularity is therefore not the more expensive option. What stands in the way is the shape of the work rather than its volume: tensor cores multiply a tile of queries against a tile of keys, and such a tile pays off only when its rows attend to the same keys, which is why two-sided clustering groups queries before they select [35].

We therefore propose Per-Query Routed Sparse Attention (PQRS), which clusters only the keys and lets every query select on its own. Each query scores the key centroids, ranks the clusters by estimated attention mass, and keeps the top clusters whose cumulative mass reaches pp; the selected clusters are computed densely, and the rest are compensated through their centroid summaries using the scores the routing has already produced. Since no tile of consecutive queries now shares a key list, our kernel traverses key clusters instead: within a group of similar clusters it buckets the queries by which members they chose, so that queries with the same selection form a dense task, and execution is shared only where the hardware requires it. Partial results accumulate in place under a fixed offset taken from the log-sum-exp of the previous denoising step, which removes the rescaling of online softmax and lets the kernel finish in a single pass.

We evaluate PQRS on four 720p video DiTs covering text-to-video and image-to-video generation from the Wan and HunyuanVideo families, with one configuration shared by all models and no training or per-model calibration. Against five training-free sparse attention baselines, PQRS attains the best PSNR, SSIM and LPIPS on every model while also being the fastest, with end-to-end speedups of 1.66×1.66\times to 2.10×2.10\times on a single H100. On VBench, which judges a video without reference to the dense output, we detect no degradation relative to dense attention. Every Query Routes Itself: Accelerating Video Diffusion Transformers with Per-Query Routed Sparse Attention compares frames from dense attention and PQRS. Our contributions are the following.

  • We locate the accuracy cost of clustering-based sparse attention in the shared selection rather than in the clustering.
  • We propose PQRS, a training-free method in which every query routes over key clusters on its own and compensates the rest through their centroids, together with a cluster-major kernel that executes these irregular selections at tile efficiency in a single pass.
  • On four evaluated 720p video DiTs, PQRS attains the best PSNR, SSIM and LPIPS against five training-free baselines while also being the fastest, with end-to-end speedups of 1.66×1.66\times to 2.10×2.10\times and no degradation detected on VBench.

References (33)