           Sparse VideoGen: Accelerating Video Diffusion Transformers with
                             Spatial-Temporal Sparsity


        Haocheng Xi * Shuo Yang * Yilong Zhao Chenfeng Xu Muyang Li Xiuyu Li Yujun Lin Han Cai
                 Jintao Zhang Dacheng Li Jianfei Chen Ion Stoica Kurt Keutzer Song Han
                             https://github.com/svg-project/Sparse-VideoGen


                          Abstract                                                   CogVideoX-v1.5, 720p, 80 frames, Image-to-Video
                                                                                         Dense Attention (9 mins       ) VS Ours (4 mins      )




                                                                         Dense
      Diffusion Transformers (DiTs) dominate video
      generation but their high computational cost
      severely limits real-world applicability, usually re-

                                                                     PSNR=28.2
                                                                       Ours
      quiring tens of minutes to generate a few seconds
      of video even on high-performance GPUs. This
      inefficiency primarily arises from the quadratic
                                                                     PSNR=22.5
                                                                     MInference



      computational complexity of 3D full attention
      with respect to the context length. In this pa-
      per, we propose a training-free framework termed                            Prompt: "A beautiful woman in a blue sari posing in front of a wall"

      Sparse VideoGen (SVG) that leverages the inher-                                  HunyuanVideo, 720p, 128 frames, Text-to-Video
      ent sparsity in 3D full attention to boost inference                              Dense Attention (38 mins       ) VS Ours (16 mins         )

      efficiency. We reveal that the attention heads can
                                                                         Dense




      be dynamically classified into two groups depend-
      ing on distinct sparse patterns: (1) Spatial Head,
      where only spatially-related tokens within each
                                                                     PSNR=29.5




      frame dominate the attention output, and (2) Tem-
                                                                       Ours




      poral Head, where only temporally-related tokens
      across different frames dominate. Based on this
                                                                     PSNR=23.2
                                                                     MInference




      insight, SVG proposes an online profiling strat-
      egy to capture the dynamic sparse patterns and
      predicts the type of attention head. Combined                                      Prompt: "A woodpecker is pecking holes in the tree."
      with a novel hardware-efficient tensor layout
      transformation and customized kernel implemen-
      tations, SVG achieves up to 2.28× end-to-end                 Figure 1. SVG accelerates video generation while maintaining
                                                                   high quality. On CogVideoX-v1.5-I2V and Hunyuan-T2V, our
      speedup on CogVideoX-v1.5, 2.33× on Hunyuan-
                                                                   method achieves a 2.28× and 2.33× speedup with high PSNR.
      Video, while preserving generation quality. Our              In contrast, MInference (Jiang et al., 2024) fails to maintain pixel
      code is open-sourced at https://github.com/svg-              fidelity (significant blurring in the first example) and temporal
      project/Sparse-VideoGen.                                     coherence (inconsistencies in the tree trunk in the second example).


                                                                   1. Introduction
  *
   Equal contribution. University of California, Berkeley.         Diffusion Transformers (DiTs) (Peebles & Xie, 2023) have
NVIDIA. MIT. Correspondence to: Chenfeng Xu <xuchen-               recently emerged as a transformative paradigm for genera-
feng@berkeley.edu>.                                                tive tasks, achieving state-of-the-art results in image genera-
Proceedings of the 42 st International Conference on Machine       tion. This success has been naturally carried over to video
Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025        generation, with models adapting from a spatial 2D attention
by the author(s).                                                  to a spatiotemporal 3D full attention (Arnab et al., 2021;

                                                               1
                                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

                    LayerNorm      QK Norm     RoPE         Linear     Attention         fore, the computation for both types of heads can be greatly
                 17k 4%     23%         22%                    51%                       reduced by only calculating the attended tokens.
Context Length




                                                                                         Despite the theoretical speedup, leveraging sparsity for end-
                 45k 2% 11% 12%                        73%
                                                                                         to-end acceleration is still challenging. Firstly, sparsity
                 120k 14% 12%                         82%                                patterns are highly dynamic across different denoising steps
                                                                                         and input prompts. It necessitates an online method to iden-
                    0%          20%      40%          60%            80%      100%
                                                                                         tify sparsity patterns without incurring overhead. Secondly,
                                                                                         some sparsity patterns are unfriendly to hardware accelera-
Figure 2. Attention dominates the computation in video diffu-
                                                                                         tors. For example, temporal head computes over noncontigu-
sion models. For CogVideoX-v1 and -v1.5 with 17k and 45k
context length, attention takes 51% and 73% of the latency, respec-
                                                                                         ous data that cannot be fed to GPU’s tensor cores, resulting
tively. For HunyuanVideo with 120k context length, attention can                         in significant efficiency degradations (Ye et al., 2023).
take over 80% amount of the runtime latency.                                             To tackle these challenges, we propose Sparse VideoGen
                                                                                         (SVG), a training-free framework that accelerates video
                                                                                         DiTs with the following novel designs: (1) To efficiently
Yang et al., 2024c; Kong et al., 2024), resulting in high-                               identify the best sparsity pattern for each attention head,
fidelity and temporally consistent outputs. Close-sourced                                SVG introduces an online profiling strategy with minimal
models such as Sora and Kling, and open-sourced models                                   overhead (∼3%). It randomly samples 1% tokens from each
including Wan 2.1 (Wang et al., 2025), CogVideo (Hong                                    attention head and processes sampled tokens with full atten-
et al., 2023), and HunyuanVideo (Kong et al., 2024), have                                tion computation and two distinct sparse attentions (spatial
showcased impressive capabilities in applications ranging                                head and temporal head). Finally, the sparse pattern with a
from animation (Guo et al., 2024; Feng et al., 2024) to                                  lower error compared to the full attention is selected for each
physical world simulation (Liu et al., 2024b).                                           head. (2) To improve hardware efficiency, SVG proposes a
Despite significant advances in generating high-quality                                  novel layout transformation, which reorders the noncontigu-
videos, the deployment of video generation models remains                                ous sparsity pattern of temporal head into a compact and
challenging due to their substantial computation usage. For                              hardware-friendly sparsity pattern.
instance, HunyuanVideo requires almost an hour on an                                     We prototype SVG with customized kernel implementation
NVIDIA A100 GPU to generate only a 5-second video,                                       by Triton (Tillet et al., 2019) and FlashInfer (Ye et al., 2025)
where the 3D full attention accounts for more than 80%                                   and evaluate SVG’s accuracy and efficiency on representa-
of end-to-end runtime (Figure 2). Moreover, due to the                                   tive open video generative models including CogVideoX-
quadratic computational complexity with respect to the con-                              v1.5-I2V, CogVideoX-v1.5-T2V, and HunyuanVideo-T2V.
text length (Dao et al., 2022), the attention can be much                                SVG delivers significant efficiency improvements, achiev-
more dominant as the resolution and number of frames in-                                 ing an end-to-end speedup of up to 2.33× while maintaining
crease, as shown in Figure 2.                                                            high visual quality with a PSNR of up to 29, outperforming
Fortunately, attention in transformers is well-known for                                 all prior methods. Additionally, we show that SVG is com-
its sparsity, offering a great opportunity to reduce redun-                              patible with FP8 quantization, enabling additional efficiency
dant computation. For example, in large language models                                  gains without compromising quality. We summarize our
(LLMs), a small portion of the tokens can dominate the                                   key contributions as follows:
attention output (Zhang et al., 2023c; Xiao et al., 2024b;
Tang et al., 2024). Therefore, the computation can be dra-                               • We conduct in-depth analysis of video DiTs’ sparse pat-
matically reduced by only computing the attention among                                    terns, revealing two inherent sparse attention patterns
such important tokens, while still maintaining generation                                  (temporal head and spatial head) for efficient video gener-
accuracy. However, existing methods cannot be directly                                     ation.
applied to DiTs (as shown in Table 1), as video data has
fundamentally different sparsity patterns from text data.                                • We propose SVG, a training-free sparse attention frame-
                                                                                           work comprising an efficient online profiling strategy and
Our key observation is that attention heads in DiTs exhibit
                                                                                           an efficient inference system for accurate and efficient
inherent sparsity in two categories: Spatial Head and Tem-
                                                                                           video generation.
poral Head, based on their distinct sparsity patterns. As
shown in Figure 3, spatial head mainly focuses on tokens
that reside within the same frame, which determines the                                  • SVG delivers significant speedup while maintaining good
spatial structures of generated videos. In contrast, temporal                              video generation quality, paving the way for practical
head attends to tokens at the same spatial location across                                 applications of video generative models.
all frames, contributing to the temporal consistency. There-

                                                                                     2
                     Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

                                                               Hunyuan-T2V                                                                               Hunyuan-T2V




                                              CogVideoX-I2V    CogVideoX-T2V                                                         CogVideoX-I2V      CogVideoX-T2V




        (a) Spatial Head                     (b) Spatial Attention Map                           (c) Temporal Head                 (d) Temporal Attention Map
                                                                      Text Prompt


        Spatial
       Correlation



        Temporal
       Correlation


                        Frame 1                  Frame 2                       Frame 3               Frame 4             Frame 5                     Frame 6
                                  (e) Visualization of Spatial and Temporal Correlation. This example have 6 frames and 4 tokens per frame.


Figure 3. We observe two types of attention maps with distinct sparse patterns: spatial map (b) and temporal map (d). Based on the
attention map, we classify all attention heads into Spatial Head (a) and Temporal Head (c), which contribute to the spatial and temporal
consistency of generated videos respectively. As visualized in (e), spatial head primarily focuses on all tokens within the same frame
(painted as red). In contrast, temporal head attends to tokens at the same position across all frames (painted as green).


2. Related Work                                                                          these methods can improve throughput, their output quality
                                                                                         often drops below a PSNR of 22. By contrast, our method
2.1. Efficient diffusion models                                                          preserves a PSNR above 30, thus substantially outperform-
Decreasing the denoising steps. Most diffusion models                                    ing previous approaches in maintaining output fidelity.
employ SDEs that require many sampling steps (Song &
Ermon, 2019; Ho et al., 2020; Meng et al., 2022). To ad-                                 2.2. Efficient attention methods
dress this, DDIM (Song et al., 2020) approximates them
                                                                                         Sparse attention in LLMs. Recent research on sparse
with an ODE; subsequent techniques refine ODE paths and
                                                                                         attention in language models reveals diverse patterns to
solvers (Lu et al., 2022a;b; Liu et al., 2022; 2024c) or in-
                                                                                         reduce computational overhead. StreamingLLM (Xiao
corporate consistency losses (Song et al., 2023; Luo et al.,
                                                                                         et al., 2023) and LM-Infinite (Han et al., 2023) observe that
2023). Distillation-based methods (Yin et al., 2024a;b) train
                                                                                         attention scores often concentrate on the first few or local
simpler, few-step models. However, these require expensive
                                                                                         tokens, highlighting temporal locality. H2O (Zhang et al.,
re-training or fine-tuning—impractical for most video use
                                                                                         2023b), Scissorhands (Liu et al., 2024d) and DoubleSparsity
cases. In contrast, our approach directly uses off-the-shelf
                                                                                         (Yang et al., 2024b) identify a small set of “heavy hitter”
pre-trained models without any additional training.
                                                                                         tokens dominating overall attention scores. TidalDecode
Diffusion model compression. Weight compression                                          (Yang et al., 2024a) shows that attention patterns across
through quantization is a common tactic (Li et al., 2023;                                layers are highly correlated, while DuoAttention (Xiao et al.,
Zhao et al., 2024a; Li* et al., 2025), pushing attention mod-                            2024a) and MInference (Jiang et al., 2024) demonstrate
ules to INT8 (Zhang et al., 2025b) or even INT4/FP8 (Zhang                               distinct sparse patterns across different attention heads.
et al., 2024). Other work proposes efficient architectures                               However, these methods focus on token-level sparsity and
(Xie et al., 2024; Cai et al., 2024; Chen et al., 2025) or high-                         do not leverage the inherent redundancy of video data.
compression autoencoders (Chen et al., 2024a) to improve
                                                                                         Linear and low-bit attention. Another direction involves
performance. Our Sparse VideoGen is orthogonal to these
                                                                                         linear attention (Cai et al., 2023; Xie et al., 2024; Wang et al.,
techniques and can incorporate them for additional gains.
                                                                                         2020; Choromanski et al., 2020; Yu et al., 2022; Katharopou-
Efficient system implementation. System-level optimiza-                                  los et al., 2020), which lowers complexity from quadratic
tions focus on dynamic batching (Kodaira et al., 2023; Liang                             to linear, and low-bit attention (Zhang et al., 2025b; 2024),
et al., 2024), caching (Chen et al., 2024b; Zhao et al., 2024b),                         which operates in reduced precision to accelerate attention
or hybrid strategies (Lv et al., 2024; Liu et al., 2024a). While                         module. Sparse VideoGen is orthogonal to both approaches:


                                                                                    3
                                                                                                         ×



                       Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

       (a) SVG Attention Workflow                                        (b) Per-head Online Profiling

                                                                                                                          × V




                                                                                                                                MSE
                                                                                                          Spatial Head

                                                                                                                                          Spatial

       Q        ×
                        KT
                                        Spatial Head ×      V                Qp      ×      K    T                        × V              OR
               #2                                                                                                                     Temporal
              #1




                                                                                                                                MSE
                                                                                                         Full Attention
    Head#0


                                                                                                                          × V

                                       Temporal Head                                                     Temporal Head


Figure 4. Overview of SVG framework. (a) During generation, SVG adaptively classifies each attention head as either a spatial head or
a temporal head and applies a dedicated sparse attention computation accordingly. (b) This adaptive classification is driven by online
profiling strategy, which extracts a small portion of Q, denoted as Qp , to perform both spatial and temporal attention computations. SVG
then selects the attention patter that yields the minimal MSE compared to full attention, ensuring accurate classification.


it can be combined with techniques like FP8 attention while              In addition to the spatial and temporal patterns, we observe
still benefiting from the video-specific spatial and temporal            that the text prompts and the first frame hold significant
sparsity in video diffusion models.                                      attention scores for both spatial and temporal head, which
                                                                                                                               × Shen
                                                                         aligns with previous investigations (Xiao et al., 2024b;     Q             KT
3. Motivation and Analysis                                               et al., 2024; Su et al., 2025). Therefore, we include these
                                                                         tokens in both the spatial and temporal head.
3.1. 3D Full Attention shows instinct sparsity
                                                                         3.2. Sparse attention achieves lossless accuracy
We identify that 3D full attention possess inherent sparsity,
characterized by different distinct sparse patterns tailored             Furthermore, we find that directly applying sparse patterns
for different functions (Xiao et al., 2024a). We deeply inves-           to corresponding heads does not hurt the quality of gener-
tigate the sparsity nature across various text-to-video and              ated videos. We demonstrate this by evaluating CogVideoX-
image-to-video models and identify two types of attention                v1.5 and HunyuanVideo on VBench (Huang et al., 2023)
heads based on sparse patterns: Spatial Head and Temporal                with sparse attention. We determine the sparse pattern by
Head, as shown in Figure. 3.                                             computing full attention along with two different sparse
Spatial Head. As illustrated in Figure 3(a-b), spatial head              mechanisms (spatial head and temporal head) for each at-
primarily focuses its attention scores on spatially-local                tention head and denoising step. The sparse pattern with the
tokens. This leads to the attention map exhibiting a                     lowest mean squared error (MSE) relative to full attention
block-wise layout. Since pixels within the same frame                    is chosen for further inference. This approach achieves a
are tokenized into contiguous tokens, spatial head attends               PSNR over 29, showing that the right sparse pattern main-
exclusively to pixels within the same frame and its adjacent             tains the high quality of generated videos.
frames. This property is essential for maintaining the spatial           However, despite its accuracy, this strategy does not provide
consistency of generated videos. In spatial head, the block              practical efficiency benefits, as full attention computation
size relates to the number of tokens per frame.                          is still required to determine the optimal sparse pattern. We
Temporal Head. In contrast, temporal head exhibits a slash-              will address this issue in Sec 4.1.
wise layout with a constant interval (Figure 3(c-d)). Since
each frame is tokenized into a fixed number of tokens L,                 3.3. Sparse attention promises theoretical speedup
pixels occupying the same spatial position across different              Instead of computing full attention, sparse attention selec-
frames are arranged at a stride of L. Consequently, temporal             tively processes only the important tokens based on sparsity
head captures information from the token with the same spa-              patterns, leading to significant computational savings. We
tial position across multiple frames. This pattern is impor-
tant for ensuring temporal consistency in video generation1 .            training data consists of slow-motion videos, making the temporal
                                                                         head’s focus on tokens with the same spatial position in several
   1
       We hypothesize that this occurs because the majority of the       frames adequate to maintain temporal consistency.


                                                                     4
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity
                                                                                              Frame 1
                                                                                             Frame    1                       Frame 2                                                 T1        T2          T3       T4
Algorithm 1 Online Profiling Strategy




                                                                                                                                                                                    Frame 1
                                                                                                                                                                                    Frame 2
                                                                                                                                                                                              Frame 1
                                                                                                                                                                                              Frame 2
                                                                                                                                                                                                        Frame 1

                                                                                                                                                                                                                  Frame 1
                                                                                                                                                                                                                  Frame 2
                                                                                   Token 1
                                                                                             Token 2
                                                                                             Token 3
                                                                                                          Token 4
                                                                                                                    Token 1
                                                                                                                              Token 2
                                                                                                                              Token 3
                                                                                                                                        Token 4




                                                                                                                                                                                                                  Frame 2
                                                                           Text                                                                             Layout          Text
                                                                          Prompt                                                                       Transformation      Prompt
# Q, K, V, O: [B, H, S, D] - query, key, value, output
# S:              - Total Token Number E.g., 18k                      Text                                                                                             Text
                                                                     Prompt                                                                                          Prompt
# t:              - Sampled Token Number. E.g., 32                   Token 1                                                                                         Frame 1
                                                                                                                                                             Token 1
                                                                     Token 2                                                                                         Frame 2
# Sample the Indices                                                                                                                              Frame 1
                                                                     Token 3                                                                                         Frame 1
indices = sample_indices(S, t) # (t,)                                                                                                                        Token 2
                                                                     Token 4                                                                                         Frame 2
Q_i = Q[:, :, indices, :]                                            Token 1                                                                                         Frame 1
                                                                                                                                                             Token 3
                                                                     Token 2                                                                                         Frame 2
# Get the attention masks                                                                                                                         Frame 2
                                                                     Token 3                                                                                         Frame 1
mask_spatial = gen_spatial_mask()[:, :, indices, :]                                                                                                          Token 4
                                                                     Token 4                                                                                         Frame 2
mask_temporal = gen_temporal_mask()[:, :, indices, :]
                                                                           (a) Non-contiguous layout                                                                           (b) Contiguous layout
# Compute sampled attention score                                             Hardware inefficient                                                                               Hardware efficient
# Shape: [B, H, t, D]
O_full = mask_attention(Q_i, K, V, None)
O_spatial = mask_attention(Q_i, K, V, mask_spatial)                  Figure 5. Visualization of hardware-efficient layout transforma-
O_temporal = mask_attention(Q_i, K, V, mask_temporal)
                                                                     tion. (a) Non-contiguous sparsity layout of temporal head, which
# Calculate MSE and get best mask                                    is hardware inefficient due to the contiguous layout required by
# Shape: [B, H]
MSE_s = (O_full - O_spatial).norm().mean(dim=(2,3))                  hardware accelerators. (b) Contiguous layout generated by trans-
MSE_t = (O_full - O_temporal).norm().mean(dim=(2,3))                 posing the token-major tensor into a frame-major one, which can
best_mask_config = (MSE_s < MSE_t)
                                                                     be efficiently handled by block sparse attention.



analyze the theoretical computation saving below.                    generation quality.

Given a model configuration of hidden dimension H, num-              4.1. Online profiling strategy for sparsity identification
ber of tokens per frame L, and number of total frames N ,
the total computation (FLOPS) for each full attention is             As discussed in Sec 3.1, all attention heads can be clas-
2 · 2 · (LN )2 · H = 4L2 N 2 H. For spatial head, assuming           sified and sparsified into spatial head and temporal head.
each head only attends to nearby cs frames, the computation          However, we find that such sparse patterns can be highly
is reduced to (2 · 2 · L2 H) · cs N , resulting in a sparsity        dynamic across different denoising steps and input data.
of cNs . For temporal head, assuming each token only at-             E.g., a certain head can be a spatial head for one prompt
tends ct tokens across all the frames, the computation is            while being a temporal head given another. This dynamic
(2 · 2 · N 2 H) · ct L, with a sparsity of cLt . Since both cs       nature necessitates an efficient online sparsity identification
and ct are typically much smaller compared to N and L                method, which classifies attention heads on the fly without
respectively, the sparsity can easily achieve 30%. E.g., the         extra overhead.
aforementioned CogVideoX-v1.5-T2V achieves a sparsity                To this end, SVG proposes an online profiling strategy. In-
of 31% for both spatial and temporal head while maintaining          stead of computing the entire full attention to identify sparse
an average of 29.99 PSNR.                                            attention, SVG only samples a subset of input rows (x%)
Despite the theoretical speedup, the temporal head can not           and calculates results with both the spatial and temporal
be directly translated into real speedup since the pattern is        sparsity patterns. By choosing the one with the lower MSE
hardware-inefficient. We will discuss our practical solution         compared to full attention, SVG can efficiently approximate
in Sec. 4.2 and prove it can achieve theoretical speedup in          the oracle identification method discussed in Sec 3.2. We
Sec. 5.3. Note that we do not include the text prompts and           detail the profiling process in Algorithm 1.
first frame in the theoretical calculation for simplicity, as        To demonstrate the effectiveness of the proposed method,
they are constant and small compared to the remaining part.          we conduct a sensitivity test on profiling ratio x with
                                                                     CogVideoX-v1.5-I2V. As shown in Table 3, profiling only
4. Methodology                                                       1% can achieve up to 31.1 PSNR, with only 3% runtime
                                                                     overhead compared to full attention.
In this section, we introduce SVG, a training-free framework
designed to exploit the sparse patterns of 3D full attention
                                                                     4.2. Hardware-efficient layout transformation
while addressing practical deployment challenges through
careful design. To identify sparse patterns, SVG employs             Despite the high sparsity in attention computation, speedups
an online profiling strategy (Sec 4.1). To effectively utilize       are limited without a hardware-efficient sparsity layout (Ye
sparsity, SVG introduces a hardware-efficient layout trans-          et al., 2023; Zheng et al., 2023). For instance, NVIDIA’s
formation, which enables real-world hardware acceleration            Tensor Core, a matrix-matrix multiplication accelerator,
(Sec 4.2). Additionally, by integrating techniques such as           requires at least 16 contiguous elements along each
customized kernels and quantization (Sec 4.3), SVG signifi-          dimension to use. However, temporal head exhibits a sparse
cantly accelerates video generation without compromising             layout of non-contiguous elements with a stride of L (i.e.,

                                                                 5
                  Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity


                             Table 1. Quality and efficiency benchmarking results of SVG and other baselines.
    Type   Method                                                            Quality                                       Efficiency
                                                    PSNR ↑   SSIM ↑   LPIPS ↓     ImageQual ↑   SubConsist ↑     FLOPS ↓       Latency ↓   Speedup ↑
    I2V    CogVideoX-v1.5 (720p, 10s, 80 frames)      -        -         -             70.09%     95.37%       147.87 PFLOPs     528s         1x
           DiTFastAttn (Spatial-only)               24.591   0.836     0.167           70.44%     95.29%       78.86 PFLOPs      338s        1.56x
           Temporal-only                            23.839   0.844     0.157           70.37%     95.13%       70.27 PFLOPs      327s        1.61x
           MInference                               22.489   0.743     0.264           58.85%     87.38%       84.89 PFLOPs      357s        1.48x
           PAB                                      23.234   0.842     0.145           69.18%     95.42%       105.88 PFLOPs     374s        1.41x
           Ours                                     28.165   0.915     0.104           70.41%     95.29%       74.57 PFLOPs      237s        2.23x
    T2V    CogVideoX-v1.5 (720p, 10s, 80 frames)      -        -         -             62.42%     98.66%       147.87 PFLOPs     528s         1x
           DiTFastAttn (Spatial-only)               23.202   0.741     0.256           62.22%     96.95%       78.86 PFLOPs      338s        1.56x
           Temporal-only                            23.804   0.811     0.198           62.12%     98.53%       70.27 PFLOPs      327s        1.61x
           MInference                               22.451   0.691     0.304           54.87%     91.52%       84.89 PFLOPs      357s        1.48x
           PAB                                      22.486   0.740     0.234           57.32%     98.76%       105.88 PFLOPs     374s        1.41x
           Ours                                     29.989   0.910     0.112           63.01%     98.67%       74.57 PFLOPs      232s        2.28x
    T2V    HunyuanVideo (720p, 5.33s, 128 frames)     -        -         -             66.11%     93.69%       612.37 PFLOPs    2253s         1x
           DiTFastAttn (Spatial-only)               21.416   0.646     0.331           67.33%     90.10%       260.48 PFLOPs    1238s        1.82x
           Temporal-only                            25.851   0.857     0.175           62.12%     98.53%       259.10 PFLOPs    1231s        1.83x
           MInference                               23.157   0.823     0.163           63.96%     91.12%       293.87 PFLOPs    1417s        1.59x
           Ours                                     29.546   0.907     0.127           65.90%     93.51%       259.79 PFLOPs    1171s        1.92x
           Ours + FP8                               29.452   0.906     0.128           65.70%     93.51%       259.79 PFLOPs     968s        2.33x



number of tokens per frame). This sparsity pattern prevents                      5. Experiment
effective utilization of Tensor Core, thereby constraining
overall efficiency.                                                              5.1. Setup

To tackle this, SVG introduces a layout transformation strat-                    Models. We evaluate SVG on open-sourced state-of-the-art
egy that transforms the sparsity layout of temporal head                         video generation models including CogVideoX-v1.5-I2V,
into a hardware-efficient one. As illustrated in Figure 5,                       CogVideoX-v1.5-T2V, and HunyuanVideo-T2V to generate
this strategy transposes a token-major tensor into a frame-                      720p resolution videos. After 3D VAE, CogVideoX-v1.5
major one, which makes the tokens across different frames                        consumes 11 frames with 4080 tokens per frame in 3D full
into a contiguous layout. Such transformation maintains                          attention, while HunyuanVideo works on 33 frames with
a mathematically equivalent output as attention computa-                         3600 tokens per frame.
tion is associative (Dao et al., 2022; 2019). We ablate the                      Metrics. We assess the quality of the generated videos us-
effectiveness of the proposed method in Sec 5.3.                                 ing the following metrics. We use Peak Signal-to-Noise
                                                                                 Ratio (PSNR), Learned Perceptual Image Patch Similarity
4.3. Other optimizations                                                         (LPIPS) (Zhang et al., 2018), Structural Similarity Index
                                                                                 Measure (SSIM) to evaluate the generated video’s similar-
Efficient kernel customization. We notice that current
                                                                                 ity, and use VBench Score (Huang et al., 2023) to evaluate
implementations of QK-norm and RoPE suffer from per-
                                                                                 the video quality, following common practices in commu-
formance issues, due to limited parallelism on small head
                                                                                 nity (Horé & Ziou, 2010; Zhao et al., 2024b; Li* et al., 2025;
dimensions (e.g., 64 in CogVideoX-v1.5). Therefore, we
                                                                                 Li et al., 2024). Specifically, we report the imaging quality
customize those operations with CUDA by a sub-warp re-
                                                                                 and subject consistency metrics, represented by ImageQaul
duction implementation, providing up to 5× speedup com-
                                                                                 and SubConsist in our table.
pared to torch implementation (see Table 2). We also use Tri-
ton to implement fused online profiling strategy and layout                      Datasets. For CogVideoX-v1.5, we generate video using
transformation kernels, followed by a block sparse attention                     the VBench dataset after prompt optimization, as suggested
kernel with FlashInfer (Ye et al., 2025).                                        by CogVideoX (Yang et al., 2024c). For HunyuanVideo, we
                                                                                 benchmark our method using the prompt in Penguin Video
Quantization. We further incorporate FP8 quantization
                                                                                 Benchmark released by HunyuanVideo (Kong et al., 2024).
into sparse attention (Zhang et al., 2025b; 2024; Zhao et al.,
2024c), which further boosts up to 1.3× throughput with                          Baselines. We compare SVG against sparse attention
minimal accuracy drop as shown in Table 1. We also cus-                          algorithms DiTFastAttn (Yuan et al., 2024) and MInfer-
tomize an attention kernel that supports both FP8 quantiza-                      ence (Jiang et al., 2024). As DiTFastAttn can be considered
tion and block sparse computation.                                               as spatial head only algorithm, we also manually imple-
                                                                                 ment a temporal head only baseline named Temporal-only
                                                                                 attention. We also include a cache-based DiT acceleration


                                                                             6
                               Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity
CogVideoX-v.15
SVG     Dense




                 (a) Prompt: A blue boat is navigating in the ocean next to a cruise ship.                       (b) Prompt: A book on fire with flames coming out of it.
       Dense
HunyuanVideo
SVG




                              (c) Prompt: Several swallows are carrying mud to build                               (d) Prompt: Several ducks are lying in the mud pit,
                              nests under the eaves, low angle shot.                                               occasionally preening their feathers leisurely.


Figure 6. Examples of generated videos by SVG and original implementation on CogVideoX-v1.5-I2V and HunyuanVideo-T2V. We
showcase four different scenarios: (a) minor scene changes, (b) significant scene changes, (c) rare object interactions, and (d) frequent
object interactions. SVG produces videos highly consistent with the originals in all cases, maintaining high visual quality.


                     Others            RoPE/Norm       Linear                Attention
                                                                                                        5.2. Quality evaluation
      Baseline
   + Efficient                                                                                          We evaluate the quality of generated videos by SVG com-
       Kernel                                                                        1.06×
     + Sparse                                                   1.81×                                   pared to baselines and report the results in Table 1. Results
    Attention                                                                                           demonstrate that SVG consistently outperforms all base-
       + FP8                                        1.21×
                                                              Total: 2.33×                              line methods in terms of PSNR, SSIM, and LPIPS while
      (SVG)
                 0               480          960      1440             1920             2400 (s)       achieving higher end-to-end speedup.

Figure 7. The breakdown of end-to-end runtime of HunyuanVideo                                           Specifically, SVG achieves an average PSNR exceeding
when generating a 5.3s, 720p video. SVG effectively reduces                                             29.55 on HunyuanVideo and 29.99 on CogVideoX-v1.5-
the end-to-end inference time from 2253 seconds to 968 seconds                                          T2V, highlighting its exceptional ability to maintain high
through system-algorithm co-design. Each design point contributes                                       fidelity and accurately reconstruct fine details. For a visual
to a considerable improvement, with a total 2.33× speedup.                                              understanding of the video quality generated by SVG, please
                                                                                                        refer to Figure 6.
                                                                                                        SVG maintains both spatial and temporal consistency by
                                                                                                        adaptively applying different sparse patterns, while all other
                                                                                                        baselines fail. E.g., since the mean-pooling block sparse
algorithm PAB (Zhao et al., 2024b) as a baseline.
                                                                                                        cannot effectively select slash-wise temporal sparsity (see
Parameters. For MInference and PAB, we use their official                                               Figure 3), MInference fails to account for temporal depen-
configurations. For SVG, we choose cs as 4 frames and ct as                                             dencies, leading to a substantial PSNR drop. Besides, PAB
1224 tokens for CogVideoX-v1.5, while cs as 10 frames and                                               skips computation of 3D full attention by reusing results
ct as 1200 tokens for HunyuanVideo. Such configurations                                                 from prior layers, which greatly hurts the quality.
lead to approximately 30% sparsity for both spatial head
                                                                                                        Moreover, SVG is compatible with FP8 attention quanti-
and temporal head, which is enough for lossless generation
                                                                                                        zation, incurring only a 0.1 PSNR drop on HunyuanVideo.
in general. We skip the first 25% denoising steps for all
                                                                                                        Such quantization greatly boosts the efficiency by 1.3×.
baselines as they are critical to generation quality, following
                                                                                                        Note that we do not apply FP8 attention quantization on
previous works (Zhao et al., 2024b; Li et al., 2024; Lv et al.,
                                                                                                        CogVideoX-v1.5, as its head dimension of 64 limits the
2024; Liu et al., 2024a).
                                                                                                        arithmetic intensity, offering no on-GPU speedups.
Visualizations. We present a comparison of the videos
generated by Dense Attention and Sparse VideoGen in Ap-
pendix B. Additionally, real video samples are available on
Google Drive and can be accessed here.

                                                                                                    7
                   Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

                                                                                                             Original              Ours (w/ transform)            Theoretical
Table 2. Inference speedup of customized QK-norm and RoPE
                                                                                              3200 Full Attention's Latency - 3060 ms
compared to PyTorch implementation with different number of                                                                                                  1.14x
                                                                                                                                                   1.49x
frames. We use the same configuration of CogVideoX-v1.5, i.e.                                 2400




                                                                               Latency (ms)
                                                                                                          5.59x         3.66x           2.12x
4080 tokens per frame, 96 attention heads.                                                                          1.53x
                                                                                              1600 1.66x
    Frame Number            8          9           10         11
                                                                                               800
       QK-norm            7.44×      7.45×      7.46×       7.47×
         RoPE            14.50×     15.23×      15.93×     16.47×                                 0
                                                                                                          0.17          0.27            0.47       0.67    0.87          1.0
                                                                                                                                            Sparsity


                                                                               Figure 8. Latency comparison of different implementations of
Table 3. Sensitivity test on online profiling strategy ratios. Profiling
                                                                               sparse attention. Our hardware-efficient layout transformation
just 1% tokens achieves generation quality comparable to the
                                                                               optimizes the sparsity pattern of temporal head for better con-
oracle (100%) while introducing only negligible overhead.
                                                                               tiguity, which is 1.7× faster than naive sparse attention (named
     Ratios                 PSNR ↑         SSIM ↑       LPIPS ↓                original), approaching the theoretical speedup.
       CogVideoX-v1.5-I2V (720p, 10s, 80 frames)
     profiling 0.1%         30.791         0.941         0.0799
                                                                               5.4. Sensitivity test
     profiling 1%           31.118         0.945         0.0757
     profiling 5%           31.008         0.944         0.0764                In this section, we conduct a sensitivity analysis on the hy-
     profiling 100%         31.324         0.947         0.0744                perparameter choices of SVG, including the online profiling
                                                                               strategy ratios (Sec 4.1) and the sparsity ratios cs and ct
                                                                               (Sec 4.2). Our goal is to demonstrate the robustness of SVG
                                                                               across various efficiency-accuracy trade-offs.
5.3. Efficiency evaluation                                                     Online profiling strategy ratios. We evaluate the effec-
To demonstrate the feasibility of SVG, we prototype the                        tiveness of online profiling strategy with different profiling
entire framework with dedicated CUDA kernels based on                          ratios on CogVideoX-v1.5 using a random subset of VBench
FlashAttention (Dao et al., 2022), FlashInfer (Ye et al.,                      in Table 3. In our experiments, we choose to profile only
2025), and Triton (Tillet et al., 2019). We first showcase                     1% of the input rows, which offers a comparable generation
the end-to-end speedup of SVG compared to baselines on                         quality comparable to the oracle profile (100% profiled)
an H100-80GB-HBM3 with CUDA 12.4. Besides, we also                             with negligible overhead.
conduct a kernel-level efficiency evaluation. Note that all                    Generation quality over different sparsity ratios. As dis-
baselines adopt FlashAttention-2 (Dao et al., 2022).                           cussed in Sec 3.3, different sparsity ratio of the spatial head
End-to-end speedup benchmark. We incorporate the end-                          and temporal head can be set by choosing different cs and
to-end efficiency metric including FLOPS, latency, and cor-                    ct , therefore reaching different trade-offs between efficiency
responding speedup into Table 1. SVG consistently out-                         and accuracy. We evaluate the LPIPS of HunyuanVideo
performs all baselines by achieving an average speedup                         over a random subset of VBench with different sparsity ra-
of 2.28× while maintaining the highest generation quality.                     tios. As shown in Table 4, SVG consistently achieves decent
We further provide a detailed breakdown of end-to-end in-                      generation quality across various sparsity ratios. E.g., even
ference time on HunyuanVideo in Figure 7 to analyze the                        with a sparsity of 13%, SVG still achieves 0.154 LPIPS. We
speedup. Each design point described in Sec 4 contributes                      leave the adaptive sparsity control for future work.
significantly to the speedup, with sparse attention delivering
the most substantial improvement of 1.81×.                                     5.5. Ablation study
Kernel-level efficiency benchmark. We benchmark in-                            We conduct the ablation study to evaluate the effectiveness
dividual kernel performance including QK-norm, RoPE,                           of the proposed hardware-efficient layout transformation
and block sparse attention with unit tests in Table 2. Our                     (as discussed in Sec 4.2). Specifically, we profile the la-
customized QK-norm and RoPE achieve consistently bet-                          tency of the sparse attention kernel with and without the
ter throughput across all frame numbers, with an average                       transformation under the HunyuanVideo configuration. As
speedup of 7.4× and 15.5×, respectively. For the sparse                        shown in Figure 8, the sparse attention with layout transfor-
attention kernel, we compare the latency of our customized                     mation closely approaches the theoretical speedup, whereas
kernel with the theoretical speedup across different spar-                     the original implementation without layout transformation
sity. As shown in Figure 8, our kernel achieves theoretical                    falls short. For example, at a sparsity level of 10%, our
speedup, enabling practical benefit from sparse attention.                     method achieves an additional 1.7× speedup compared to

                                                                           8
                 Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

                                                                        Chen, J., Ge, C., Xie, E., Wu, Y., Yao, L., Ren, X., Wang, Z.,
Table 4. Video quality of HunyuanVideo on a subset of VBench
                                                                          Luo, P., Lu, H., and Li, Z. Pixart-sigma: Weak-to-strong
when varying sparsity ratios. LPIPS decreases as the sparse ratio
increases, achieving trade-offs between efficiency and accuracy.          training of diffusion transformer for 4k text-to-image
                                                                          generation. In European Conference on Computer Vision,
     Sparsity↓    0.13     0.18     0.35     0.43     0.52
                                                                          pp. 74–91. Springer, 2025.
      LPIPS↓      0.154   0.135    0.141    0.129    0.116
                                                                        Chen, P., Shen, M., Ye, P., Cao, J., Tu, C., Bouganis, C.-
                                                                          S., Zhao, Y., and Chen, T. \delta-dit: A training-free
the original approach, achieving a 3.63× improvement.                     acceleration method tailored for diffusion transformers.
                                                                          arXiv preprint arXiv:2406.01125, 2024b.
6. Conclusion                                                           Choromanski, K., Likhosherstov, V., Dohan, D., Song, X.,
We accelerate video diffusion transformers by exploiting                  Gane, A., Sarlos, T., Hawkins, P., Davis, J., Mohiuddin,
sparse attention. We reveal that attention heads have in-                 A., Kaiser, L., et al. Rethinking attention with performers.
herent sparsity patterns and we classify them into spatial                arXiv preprint arXiv:2009.14794, 2020.
head and temporal head. We proposed Sparse VideoGen                     Dao, T., Gu, A., Eichhorn, M., Rudra, A., and Ré, C. Learn-
(SVG), a training-free method to utilize these sparsity pat-              ing fast algorithms for linear transforms using butterfly
terns for end-to-end efficiency boosts, including an efficient            factorizations. In International conference on machine
online profiling algorithm and an efficient inference sys-                learning, pp. 1517–1527. PMLR, 2019.
tem. On representative open video diffusion transformers
(CogVideoX-v1.5 and HunyuanVideo), SVG demonstrates                     Dao, T., Fu, D. Y., Ermon, S., Rudra, A., and Ré, C. Flashat-
prominent end-to-end speedup without losing quality.                      tention: Fast and memory-efficient exact attention with io-
                                                                          awareness, 2022. URL https://arxiv.org/abs/
                                                                          2205.14135.
Impact Statement
                                                                        Feng, H., Ding, Z., Xia, Z., Niklaus, S., Abrevaya, V., Black,
This paper presents work that aims to advance the field
                                                                          M. J., and Zhang, X. Explorative inbetweening of time
of Machine Learning. There are many potential societal
                                                                          and space. In European Conference on Computer Vision,
consequences of our work, none of which we feel must be
                                                                          pp. 378–395. Springer, 2024.
specifically highlighted here.
                                                                        Guo, Y., Yang, C., Rao, A., Liang, Z., Wang, Y., Qiao, Y.,
Acknowledgment                                                           Agrawala, M., Lin, D., and Dai, B. Animatediff: Animate
                                                                         your personalized text-to-image diffusion models without
We thank Guangxuan Xiao and Zihao Ye for the visualiza-                   specific tuning. In ICLR, 2024.
tions and kernel designs.
                                                                        Han, C., Wang, Q., Xiong, W., Chen, Y., Ji, H., and Wang, S.
                                                                          Lm-infinite: Simple on-the-fly length generalization for
References                                                                large language models. arXiv preprint arXiv:2308.16137,
Arnab, A., Dehghani, M., Heigold, G., Sun, C., Lučić, M.,               2023.
  and Schmid, C. Vivit: A video vision transformer. In                  Ho, J., Jain, A., and Abbeel, P. Denoising diffusion proba-
  ICCV, 2021.                                                             bilistic models. NeurIPS, 2020.

Cai, H., Li, J., Hu, M., Gan, C., and Han, S. Efficientvit:             Hong, W., Ding, M., Zheng, W., Liu, X., and Tang, J.
  Lightweight multi-scale attention for high-resolution                   Cogvideo: Large-scale pretraining for text-to-video gen-
  dense prediction. In Proceedings of the IEEE/CVF In-                    eration via transformers. In ICLR, 2023.
  ternational Conference on Computer Vision, pp. 17302–
                                                                        Horé, A. and Ziou, D. Image quality metrics: Psnr vs.
  17313, 2023.
                                                                          ssim. In 2010 20th International Conference on Pattern
                                                                         Recognition, pp. 2366–2369, 2010. doi: 10.1109/ICPR.
Cai, H., Li, M., Zhang, Q., Liu, M.-Y., and Han, S.
                                                                          2010.579.
  Condition-aware neural network for controlled image
  generation. In CVPR, 2024.                                            Huang, Z., He, Y., Yu, J., Zhang, F., Si, C., Jiang, Y., Zhang,
                                                                         Y., Wu, T., Jin, Q., Chanpaisit, N., Wang, Y., Chen, X.,
Chen, J., Cai, H., Chen, J., Xie, E., Yang, S., Tang, H.,                 Wang, L., Lin, D., Qiao, Y., and Liu, Z. Vbench: Com-
  Li, M., Lu, Y., and Han, S. Deep compression autoen-                    prehensive benchmark suite for video generative mod-
  coder for efficient high-resolution diffusion models. arXiv             els, 2023. URL https://arxiv.org/abs/2311.
  preprint arXiv:2410.10733, 2024a.                                       17982.

                                                                    9
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

Jiang, H., Li, Y., Zhang, C., Wu, Q., Luo, X., Ahn, S., Han,           Liu, X., Zhang, X., Ma, J., Peng, J., and Liu, Q. Instaflow:
   Z., Abdi, A. H., Li, D., Lin, C.-Y., et al. Minference 1.0:           One step is enough for high-quality diffusion-based text-
   Accelerating pre-filling for long-context llms via dynamic            to-image generation. In International Conference on
   sparse attention. arXiv preprint arXiv:2407.02490, 2024.              Learning Representations, 2024c.
Katharopoulos, A., Vyas, A., Pappas, N., and Fleuret, F.               Liu, Z., Desai, A., Liao, F., Wang, W., Xie, V., Xu, Z., Kyril-
  Transformers are rnns: Fast autoregressive transformers                lidis, A., and Shrivastava, A. Scissorhands: Exploiting
  with linear attention. In International conference on ma-              the persistence of importance hypothesis for llm kv cache
  chine learning, pp. 5156–5165. PMLR, 2020.                             compression at test time. Advances in Neural Information
                                                                         Processing Systems, 36, 2024d.
Kodaira, A., Xu, C., Hazama, T., Yoshimoto, T., Ohno,
  K., Mitsuhori, S., Sugano, S., Cho, H., Liu, Z., and                 Lu, C., Zhou, Y., Bao, F., Chen, J., Li, C., and Zhu, J. Dpm-
  Keutzer, K. Streamdiffusion: A pipeline-level solu-                    solver: A fast ode solver for diffusion probabilistic model
  tion for real-time interactive generation. arXiv preprint              sampling in around 10 steps. In NeurIPS, 2022a.
  arXiv:2312.12491, 2023.
                                                                       Lu, C., Zhou, Y., Bao, F., Chen, J., Li, C., and Zhu, J. Dpm-
Kong, W., Tian, Q., Zhang, Z., Min, R., Dai, Z., Zhou, J.,               solver++: Fast solver for guided sampling of diffusion
  Xiong, J., Li, X., Wu, B., Zhang, J., et al. Hunyuan-                  probabilistic models. arXiv preprint arXiv:2211.01095,
  video: A systematic framework for large video generative               2022b.
  models. arXiv preprint arXiv:2412.03603, 2024.
                                                                       Luo, S., Tan, Y., Huang, L., Li, J., and Zhao, H. La-
Li, M., Cai, T., Cao, J., Zhang, Q., Cai, H., Bai, J., Jia, Y.,          tent consistency models: Synthesizing high-resolution
  Liu, M.-Y., Li, K., and Han, S. Distrifusion: Distributed              images with few-step inference. arXiv preprint arXiv:
  parallel inference for high-resolution diffusion models.               2310.04378, 2023.
  In CVPR, 2024.
                                                                       Lv, Z., Si, C., Song, J., Yang, Z., Qiao, Y., Liu, Z., and
Li*, M., Lin*, Y., Zhang*, Z., Cai, T., Li, X., Guo, J., Xie,            Wong, K.-Y. K. Fastercache: Training-free video diffu-
  E., Meng, C., Zhu, J.-Y., and Han, S. Svdquant: Absorb-                sion model acceleration with high quality. 2024.
  ing outliers by low-rank components for 4-bit diffusion
                                                                       Ma, X., Fang, G., and Wang, X. Deepcache: Accelerating
  models. In The Thirteenth International Conference on
                                                                        diffusion models for free. In CVPR, 2024.
  Learning Representations, 2025.
                                                                       Meng, C., He, Y., Song, Y., Song, J., Wu, J., Zhu, J.-Y., and
Li, X., Liu, Y., Lian, L., Yang, H., Dong, Z., Kang, D.,
                                                                        Ermon, S. SDEdit: Guided image synthesis and editing
  Zhang, S., and Keutzer, K. Q-diffusion: Quantizing
                                                                        with stochastic differential equations. In ICLR, 2022.
  diffusion models. In ICCV, 2023.
                                                                       Peebles, W. and Xie, S. Scalable diffusion models with
Li, Y., Jiang, H., Zhang, C., Wu, Q., Luo, X., Ahn, S.,
                                                                         transformers. In ICCV, 2023.
  Abdi, A. H., Li, D., Gao, J., Yang, Y., et al. Mmin-
  ference: Accelerating pre-filling for long-context vlms              Shen, X., Xiong, Y., Zhao, C., Wu, L., Chen, J., Zhu, C., Liu,
  via modality-aware permutation sparse attention. arXiv                 Z., Xiao, F., Varadarajan, B., Bordes, F., Liu, Z., Xu, H.,
  preprint arXiv:2504.16083, 2025.                                       Kim, H. J., Soran, B., Krishnamoorthi, R., Elhoseiny, M.,
                                                                         and Chandra, V. Longvu: Spatiotemporal adaptive com-
Liang, F., Kodaira, A., Xu, C., Tomizuka, M., Keutzer, K.,
                                                                         pression for long video-language understanding, 2024.
  and Marculescu, D. Looking backward: Streaming video-
                                                                         URL https://arxiv.org/abs/2410.17434.
  to-video translation with feature banks. arXiv preprint
  arXiv:2405.15757, 2024.                                              Song, J., Meng, C., and Ermon, S. Denoising diffusion
                                                                         implicit models. In ICLR, 2020.
Liu, F., Zhang, S., Wang, X., Wei, Y., Qiu, H., Zhao, Y.,
  Zhang, Y., Ye, Q., and Wan, F. Timestep embedding                    Song, Y. and Ermon, S. Generative modeling by estimating
  tells: It’s time to cache for video diffusion model. arXiv             gradients of the data distribution. Advances in neural
  preprint arXiv:2411.19108, 2024a.                                      information processing systems, 32, 2019.
Liu, H., Yan, W., Zaharia, M., and Abbeel, P. World model              Song, Y., Dhariwal, P., Chen, M., and Sutskever, I. Consis-
  on million-length video and language with ringattention.               tency models. In ICML, 2023.
  arXiv preprint, 2024b.
                                                                       Su, Z., Shen, W., Li, L., Chen, Z., Wei, H., Yu, H., and
Liu, X., Gong, C., and Liu, Q. Flow straight and fast:                   Yuan, K. Akvq-vl: Attention-aware kv cache adaptive 2-
  Learning to generate and transfer data with rectified flow.            bit quantization for vision-language models, 2025. URL
  arXiv preprint arXiv:2209.03003, 2022.                                 https://arxiv.org/abs/2501.15021.

                                                                  10
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

Tang, J., Zhao, Y., Zhu, K., Xiao, G., Kasikci, B., and                Ye, Z., Lai, R., Shao, J., Chen, T., and Ceze, L. Sparsetir:
  Han, S. Quest: Query-aware sparsity for efficient long-                Composable abstractions for sparse compilation in deep
  context llm inference, 2024. URL https://arxiv.                        learning, 2023. URL https://arxiv.org/abs/
  org/abs/2406.10774.                                                    2207.04606.
Tillet, P., Kung, H.-T., and Cox, D. D.      Tri-                      Ye, Z., Chen, L., Lai, R., Lin, W., Zhang, Y., Wang, S.,
  ton: an intermediate language and compiler for                         Chen, T., Kasikci, B., Grover, V., Krishnamurthy, A.,
  tiled neural network computations. Proceedings                         and Ceze, L. Flashinfer: Efficient and customizable
  of the 3rd ACM SIGPLAN International Workshop                          attention engine for llm inference serving, 2025. URL
  on Machine Learning and Programming Languages,                         https://arxiv.org/abs/2501.01005.
  2019. URL https://api.semanticscholar.
  org/CorpusID:184488182.                                              Yin, T., Gharbi, M., Park, T., Zhang, R., Shechtman, E., Du-
                                                                         rand, F., and Freeman, W. T. Improved distribution match-
Wang, A., Ai, B., Wen, B., Mao, C., Xie, C.-W., Chen, D.,                ing distillation for fast image synthesis. arXiv preprint
 Yu, F., Zhao, H., Yang, J., Zeng, J., et al. Wan: Open                  arXiv:2405.14867, 2024a.
 and advanced large-scale video generative models. arXiv
 preprint arXiv:2503.20314, 2025.                                      Yin, T., Gharbi, M., Zhang, R., Shechtman, E., Durand, F.,
                                                                         Freeman, W. T., and Park, T. One-step diffusion with
Wang, S., Li, B. Z., Khabsa, M., Fang, H., and Ma, H.                    distribution matching distillation. In CVPR, 2024b.
 Linformer: Self-attention with linear complexity. arXiv
 preprint arXiv:2006.04768, 2020.                                      Yu, W., Luo, M., Zhou, P., Si, C., Zhou, Y., Wang, X., Feng,
                                                                         J., and Yan, S. Metaformer is actually what you need
Xiao, G., Tian, Y., Chen, B., Han, S., and Lewis, M. Ef-                 for vision. In Proceedings of the IEEE/CVF conference
  ficient streaming language models with attention sinks.                on computer vision and pattern recognition, pp. 10819–
  arXiv preprint arXiv:2309.17453, 2023.                                 10829, 2022.
Xiao, G., Tang, J., Zuo, J., Guo, J., Yang, S., Tang, H.,
                                                                       Yuan, Z., Zhang, H., Lu, P., Ning, X., Zhang, L., Zhao, T.,
  Fu, Y., and Han, S. Duoattention: Efficient long-context
                                                                         Yan, S., Dai, G., and Wang, Y. Ditfastattn: Attention com-
  llm inference with retrieval and streaming heads. arXiv
                                                                         pression for diffusion transformer models, 2024. URL
  preprint arXiv:2410.10819, 2024a.
                                                                         https://arxiv.org/abs/2406.08552.
Xiao, G., Tian, Y., Chen, B., Han, S., and Lewis, M. Effi-
                                                                       Zhang, J., Herrmann, C., Hur, J., Cabrera, L. P., Jampani,
  cient streaming language models with attention sinks,
                                                                         V., Sun, D., and Yang, M.-H. A tale of two features:
  2024b. URL https://arxiv.org/abs/2309.
                                                                         Stable diffusion complements dino for zero-shot semantic
  17453.
                                                                         correspondence. 2023a.
Xie, E., Chen, J., Chen, J., Cai, H., Tang, H., Lin, Y., Zhang,
  Z., Li, M., Zhu, L., Lu, Y., et al. Sana: Efficient high-            Zhang, J., Huang, H., Zhang, P., Wei, J., Zhu, J., and Chen,
  resolution image synthesis with linear diffusion trans-                J. Sageattention2: Efficient attention with thorough out-
  formers. arXiv preprint arXiv:2410.10629, 2024.                        lier smoothing and per-thread int4 quantization. arXiv
                                                                         preprint arXiv:2411.10958, 2024.
Xu, R., Xiao, G., Huang, H., Guo, J., and Han, S. Xattention:
  Block sparse attention with antidiagonal scoring. arXiv              Zhang, J., Wei, J., Zhang, P., Xu, X., Huang, H., Wang, H.,
  preprint arXiv:2503.16428, 2025.                                       Jiang, K., Zhu, J., and Chen, J. Sageattention3: Microscal-
                                                                         ing fp4 attention for inference and an exploration of 8-bit
Yang, L., Zhang, Z., Chen, Z., Li, Z., and Jia, Z. Tidalde-              training. arXiv preprint arXiv:2505.11594, 2025a.
  code: Fast and accurate llm decoding with position per-
  sistent sparse attention. arXiv preprint arXiv:2410.05076,           Zhang, J., Wei, J., Zhang, P., Zhu, J., and Chen, J. Sageatten-
  2024a.                                                                 tion: Accurate 8-bit attention for plug-and-play inference
                                                                         acceleration. In International Conference on Learning
Yang, S., Sheng, Y., Gonzalez, J. E., Stoica, I., and Zheng, L.          Representations (ICLR), 2025b.
  Post-training sparse attention with double sparsity, 2024b.
  URL https://arxiv.org/abs/2408.07092.                                Zhang, J., Xiang, C., Huang, H., Wei, J., Xi, H., Zhu,
                                                                         J., and Chen, J. Spargeattn: Accurate sparse atten-
Yang, Z., Teng, J., Zheng, W., Ding, M., Huang, S., Xu,                  tion accelerating any model inference. arXiv preprint
  J., Yang, Y., Hong, W., Zhang, X., Feng, G., et al.                    arXiv:2502.18137, 2025c.
  Cogvideox: Text-to-video diffusion models with an
  expert transformer. arXiv preprint arXiv:2408.06072,                 Zhang, J., Xu, X., Wei, J., Huang, H., Zhang, P., Chendong,
  2024c.                                                                 X., Zhu, J., and Chen, J. Sageattention2++: A more

                                                                  11
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

  efficient implementation of sageattention2. arXiv preprint
  arXiv:2505.21136, 2025d.
Zhang, R., Isola, P., Efros, A. A., Shechtman, E., and Wang,
  O. The unreasonable effectiveness of deep features as a
  perceptual metric. In CVPR, 2018.
Zhang, Z., Sheng, Y., Zhou, T., Chen, T., Zheng, L., Cai,
  R., Song, Z., Tian, Y., Ré, C., Barrett, C., et al. H2o:
  Heavy-hitter oracle for efficient generative inference of
  large language models. Advances in Neural Information
  Processing Systems, 36:34661–34710, 2023b.
Zhang, Z., Sheng, Y., Zhou, T., Chen, T., Zheng, L., Cai,
  R., Song, Z., Tian, Y., Ré, C., Barrett, C., Wang, Z., and
  Chen, B. H2 o: Heavy-hitter oracle for efficient generative
  inference of large language models, 2023c. URL https:
  //arxiv.org/abs/2306.14048.
Zhao, T., Fang, T., Liu, E., Rui, W., Soedarmadji, W., Li,
  S., Lin, Z., Dai, G., Yan, S., Yang, H., et al. Vidit-
  q: Efficient and accurate quantization of diffusion trans-
  formers for image and video generation. arXiv preprint
  arXiv:2406.02540, 2024a.
Zhao, X., Jin, X., Wang, K., and You, Y. Real-time video
  generation with pyramid attention broadcast, 2024b. URL
  https://arxiv.org/abs/2408.12588.
Zhao, Y., Lin, C.-Y., Zhu, K., Ye, Z., Chen, L., Zheng, S.,
  Ceze, L., Krishnamurthy, A., Chen, T., and Kasikci, B.
  Atom: Low-bit quantization for efficient and accurate llm
  serving. MLSys, 2024c.

Zheng, N., Jiang, H., Zhang, Q., Han, Z., Yang, Y., Ma,
  L., Yang, F., Zhang, C., Qiu, L., Yang, M., and Zhou,
  L. Pit: Optimization of dynamic sparse deep learning
  models via permutation invariant transformation, 2023.
  URL https://arxiv.org/abs/2301.10936.




                                                                12
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

A. A full version of related work
A.1. Efficient Diffusion Models
Diffusion Models function primarily as denoising models that are trained to estimate the gradient of the data distribution
(Song & Ermon, 2019; Zhang et al., 2023a). Although these models are capable of generating samples with high quality
and diversity, they are known as inefficient. To enhance the efficiency of diffusion models, researchers often focus on three
primary approaches: (1) decreasing the number of denoising steps, (2) reducing the model size, and (3) optimizing system
implementation for greater efficiency.


Decreasing the denoising steps. The main diffusion models rely on stochastic differential equations (SDEs) that learn to
estimate the gradient of the data distribution through Langevin dynamics (Ho et al., 2020; Meng et al., 2022). Consequently,
these models generally require numerous sampling steps (, e.g., 1,000). To improve sample efficiency, DDIM (Song et al.,
2020) approximates SDE-based diffusion models within an ordinary differential equation (ODE) framework. Expanding on
this concept, DPM (Lu et al., 2022a), DPM++ (Lu et al., 2022b), and Rectified Flows (Liu et al., 2022; 2024c) enhance ODE
paths and solvers to further reduce the number of denoising steps. Furthermore, Consistency Models (Song et al., 2023;
Luo et al., 2023) integrate the ODE solver into training using a consistency loss, allowing diffusion models to replicate
several denoising operations with fewer iterations. In addition, approaches grounded in distillation (Yin et al., 2024a;b)
represent another pivotal strategy. This involves employing a simplified, few-step denoising model to distill a more complex,
multi-step denoising model, thereby improving overall efficiency.
Nevertheless, all these approaches necessitate either re-training or fine-tuning the complete models on image or video
datasets. For video generation models, this is largely impractical due to the significant computational expense involved,
which is prohibitive for the majority of users. In this work, our primary focus is on a method to enhance generation speed
that requires no additional training.


Diffusion Model Compreesion A common approach to enhancing the efficiency of diffusion models involves compressing
their weights through quantization. Q-Diffusion (Li et al., 2023) introduced a W8A8 strategy, implementing quantization in
these models. Building on this foundation, ViDiT-Q (Zhao et al., 2024a) proposed a timestep-aware dynamic quantization
method that effectively reduces the bit-width to W4A8. Furthermore, SVDQuant (Li* et al., 2025) introduced a cost-effective
branch designed to address outlier problems in both activations and weights, thus positioning W4A4 as a feasible solution
for diffusion models. SageAttention (Zhang et al., 2025b) advanced the field by quantizing the attention module to INT8
precision via a smoothing technique. SageAttention V2 (Zhang et al., 2024; 2025d) and V3 (Zhang et al., 2025a) extended
these efforts by pushing the precision boundaries to INT4 hybridized with FP8 or even full FP4. Another common approach
is to design efficient diffusion model architectures (Xie et al., 2024; Cai et al., 2024; Chen et al., 2025) and high-compression
autoencoders (Chen et al., 2024a) to boost efficiency. Our Sparse VideoGen is orthogonal to these techniques and can utilize
them as supplementary methods to enhance efficiency.


Efficient System Implementation In addition to enhancing the efficiency of diffusion models by either retraining the
model to decrease the number of denoising steps or compressing the model size, efficiency improvements can also be
achieved at the system level. For instance, strategies such as dynamic batching are employed in StreamDiffusion (Kodaira
et al., 2023) and StreamV2V (Liang et al., 2024) to effectively manage streaming inputs in diffusion models, thereby
achieving substantial throughput enhancements. Other approaches include: DeepCache (Ma et al., 2024), which leverages
feature caching to modify the UNet Diffusion; ∆ − DiT (Chen et al., 2024b), which implements this mechanism by caching
residuals between attention layers in DiT to circumvent redundant computations; and PAB (Zhao et al., 2024b), which
caches and broadcasts intermediary features at distinct timestep intervals. FasterCache (Lv et al., 2024) identifies significant
redundancy in CFG and enhances the reuse of both conditional and unconditional outputs. Meanwhile, TeaCache (Liu et al.,
2024a) recognizes that the similarity in model inputs can be used to forecast output similarity, suggesting an improved
machine strategy to amplify speed gains.
Despite these advanced methodologies, they often result in the generated output diverging significantly from the original, as
indicated by a PSNR falling below 22. In contrast, our method consistently achieves a PSNR exceeding 30, thus ensuring
substantially superior output quality compared to these previously mentioned strategies.

                                                               13
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

A.2. Efficient Attention
Sparse Attention in LLM Recent studies on sparse attention in language models have identified patterns that reduce
computational costs by targeting specific token subsets. StreamingLLM (Xiao et al., 2023) and LM-Infinite (Han et al.,
2023) reveal concentration on initial and local tokens, highlighting temporal locality in decoding. H2O (Zhang et al., 2023b)
and Scissorhands (Liu et al., 2024d) note attention focuses mainly on a few dominant tokens. TidalDecode (Yang et al.,
2024a) shows cross-layer attention pattern correlations, aiding in attention sparsity. DuoAttention (Xiao et al., 2024a)
and MInference (Jiang et al., 2024) find distinct sparse patterns among attention heads, with varying focus on key tokens
and context. MMInference (Li et al., 2025) speedup the vision language models through modality-aware permutation.
SpargeAttention (Zhang et al., 2025c) and XAttention (Xu et al., 2025) propose general sparsity identification algorithms
that can be applied to all forms of models. Despite their success in LLMs or VLMs, these mechanisms are constrained to
token-level sparsity and miss the redundancy unique to video data.

Linear and Low-bit Attention Significant advancements have been achieved in enhancing attention efficiency, notably
through linear attention (Cai et al., 2023; Xie et al., 2024) and low-bit attention techniques (Zhang et al., 2025b; 2024).
Linear attention models, including Linformer (Wang et al., 2020), Performer (Choromanski et al., 2020), MetaFormer (Yu
et al., 2022), and LinearAttention (Katharopoulos et al., 2020), reduce the quadratic complexity of traditional attention to
linear. Low-bit attention approaches decrease computational demands by utilizing lower precision, with SageAttention
(Zhang et al., 2025b) employing INT8 precision to enhance efficiency without notable performance loss.
Sparse VideoGen, as a sparse attention method, is orthogonal to both linear attention and low-bit attention techniques.
Moreover, it can be integrated with low-bit attention methods, such as FP8 attention, to further enhance computational
efficiency.

B. Visualization of the generated videos
We provide visualization comparison between Dense Attention and Sparse VideoGen on HunyuanVideo and Wan 2.1.
We conduct both Text-to-Video generation and Image-to-Video generation under 720p resolution. Results demonstrate
that Sparse VideoGen can preserve high pixel-level fidelity, achieving similar generation quality compared with the dense
attention.




                                                            14
              Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity




Dense Attention




Sparse VideoGen




Dense Attention




Sparse VideoGen




Dense Attention




Sparse VideoGen




Dense Attention




Sparse VideoGen



          Figure 9. Comparion of Dense Attention and Sparse VideoGen on HunyuanVideo Text-to-Video generation.




                                                          15
  Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity




       Dense Attention                                                  Sparse VideoGen




       Dense Attention                                                  Sparse VideoGen




       Dense Attention                                                  Sparse VideoGen




       Dense Attention                                                  Sparse VideoGen




       Dense Attention                                                  Sparse VideoGen




Figure 10. Comparison of Dense Attention and Sparse VideoGen on Wan 2.1 Image-to-Video generation.




                                               16
                Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity

C. Theoretical Analysis of Sparse Video Attention
Here we provide the theoretical analyses of SVG. Consider a video with N frames, each containing F tokens. Every
token can be encoded by an indices pair (i, j), where 0 ≤ i < N, 0 ≤ j < F . In the attention map we will flatten these
two-dimensional indices into a 1D vector. Corresponding formula is x = i · F + j.

Spatial Head
For spatial head, let a1 > 0 denote the threshold for spatial closeness between tokens. The spatial attention mask is defined
as:                                                                  (
                                                                      1 if |i1 − i2 | < a1 ,
                                       fs ((i1 , j1 ), (i2 , j2 )) =
                                                                      0 otherwise

For flattened indices x1 = i1 · F + j1 and x2 = i2 · F + j2 ,
                                                                jx k         jx k
                                                                     1         2
                                          fs (x1 , x2 ) = 1 ⇔            −          < a1
                                                                     F        F
The resulting attention map takes the form of block-banded structures: the attention mask will be on the main diagonal and
also on neighboring ±(a1 − 1) diagonals.

Temporal Head
For temporal head, let a2 > 0 denote the threshold for temporal closeness between tokens. The temporal attention mask is
defined as:                                                        (
                                                                    1 if |j1 − j2 | < a2 ,
                                     ft ((i1 , j1 ), (i2 , j2 )) =
                                                                    0 otherwise

For flattened indices x1 = i1 · F + j1 and x2 = i2 · F + j2 ,

         ft (x1 , x2 ) = 1 ⇔ |(x1 mod F ) − (x2 mod F )| < a2 ⇔ ∃k, 0 ≤ k < 2N − 1, |(x1 − x2 ) − kF | < a2

The resulting attention map forms 2N − 1 slanted diagonals that align along constant column index differences. These
diagonals, often referred to as “slashes,” correspond to the token positions sharing similar temporal locations across frames.
The corresponding points in the attention matrix yield a “slash-wise” pattern with width a2 .




                                                                17
