FastVideo Guide: Sliding Tile Attention AI Model

Problem: The 3D Attention Bottleneck in Video Diffusion Transformers
Diffusion Transformers (DiTs)—exemplified by frontier architectures like HunyuanVideo, CogVideoX, and Wan2.1—have established an undisputed dominance in high-definition video synthesis. By replacing legacy convolutional U-Nets with scalable transformer backbones, modern video generation models synthesize cinematic footage featuring fluid physical motion, photorealistic lighting dynamics, and intricate narrative consistency. Whether rendering synthesized video campaigns from web assets harvested via automated media scraping pipelines or generating interactive visual streams from real-time streaming data ingestion, video DiTs represent the frontier of generative media.
However, behind these breathtaking visual capabilities lies an excruciating computational barrier: the quadratic attention bottleneck.
+----------------------------------------------------------------------------------------------------+
| THE VIDEO DIT COMPUTATIONAL WALL |
+------------------------------------+---------------------------------------------------------------+
| System Challenge | Concrete Bottleneck in Modern Video DiTs (e.g. HunyuanVideo) |
+------------------------------------+---------------------------------------------------------------+
| Quadratic 3D Sequence Scaling | Generating a 5s 720P clip yields 115,200 visual tokens; |
| (Attention Dominance Tax) | full 3D attention consumes over 85% of total inference time |
+------------------------------------+---------------------------------------------------------------+
| Single-GPU Inference Latency | Generating 5 seconds of video on an NVIDIA H100 GPU requires |
| (16 Minutes per Video Clip) | 945 seconds with FlashAttention-3, paralyzing deployments |
+------------------------------------+---------------------------------------------------------------+
| Failure of Sliding Window (SWA) | Token-level 2D/3D SWA (NATTEN, CLEAR) creates irregular masks |
| (The Mixed-Block GPU Overhead) | with massive runtime overhead, slowing down execution (<6% MFU)|
+------------------------------------+---------------------------------------------------------------+
| Alternating 2D+1D Factorization | Separating space and time disrupts 3D spatio-temporal diagonal|
| (The Lost Locality Dilemma) | correlations, degrading complex motion and scene consistency |
+------------------------------------+---------------------------------------------------------------+ The 115K Token Sequence Wall
In static image generation, processing a $512 \times 512$ image requires approximately $1,024$ patch tokens. Even with dense quadratic self-attention, evaluating a single image requires modest computational resources.
In video generation, however, models must capture spatial dimensions ($H \times W$) across time ($T$). After 3D VAE latent compression, generating a standard 5-second 720P video clip ($1280 \times 768$ at 24 FPS, corresponding to 117 raw frames) yields a latent tensor of shape $(30, 48, 80)$. When flattened into visual tokens, the resulting sequence length explodes to:
$$N = 30 \times 48 \times 80 = 115,200 \text{ tokens!}$$
Calculating full bidirectional 3D attention over $115,200$ tokens requires an attention matrix of:
$$N^2 = (115,200)^2 \approx 1.327 \times 10^{10} \text{ elements per attention head per layer!}$$
Across 40 transformer layers and 50 denoising timesteps, attention alone accounts for over 800 seconds out of the 945 seconds of total generation time on an NVIDIA H100 SXM5 GPU. Generating just 5 seconds of video takes nearly 16 minutes on a $30,000 accelerator!
The Inefficiency of Traditional Sliding Window Attention (SWA)
Profiling pretrained video diffusion models reveals an intuitive physical phenomenon: 3D Spatio-Temporal Locality. Video signals exhibit extreme temporal and spatial correlation: adjacent pixels and neighboring frames carry the vast majority of mutual information. In HunyuanVideo, empirical analysis demonstrates that a local 3D window covering only 15.52% of the token space accounts for over 70% of total attention recall.
This finding suggests that Sliding Window Attention (SWA) should drastically accelerate video DiTs by restricting attention to localized 3D cuboids.
However, in practice, existing 2D and 3D sliding window kernels (such as NATTEN, Tiled NATTEN, and CLEAR) fail completely on GPUs:
- The Mixed-Block Trap: High-performance attention kernels (like FlashAttention) divide queries and keys into hardware-friendly matrix blocks (e.g., $64 \times 64$ or $128 \times 128$). In traditional SWA, each query token slides its window independently. This creates a staggered, zigzag boundary across attention blocks, producing numerous mixed blocks (blocks that are partially masked and partially dense).
- Extreme Mask Evaluation Overhead: A mixed block cannot simply be skipped. The GPU must calculate the exact geometric distance between every query-key pair on chip to apply dynamic masking. In 3D space, this mask computation introduces enormous overhead, causing kernels like NATTEN to run slower than unmasked dense FlashAttention despite executing 90% fewer theoretical FLOPs!
- Catastrophic Hardware Underutilization: While dense FlashAttention-3 achieves over 64% Model Flops Utilization (MFU), 3D NATTEN and CLEAR collapse to an abysmal 3.7% to 5.4% MFU.
+-----------------------------------------------------------------------------------------------+
| TRADITIONAL SLIDING WINDOW ATTENTION FAILURE |
| |
| Query Token i: Attends to Keys [i - W, i + W] |
| Query Token i+1: Attends to Keys [i - W + 1, i + W + 1] (Shifted boundary!) |
| |
| Result in FlashAttention SRAM Blocks: |
| [Dense Block] ===> 100% Valid (Fast GPU Tensor Cores) |
| [Empty Block] ===> 0% Valid (Completely Skipped) |
| [Mixed Block] ===> Partial Valid + Heavy Runtime Distance Masking! |
| |
| * The Disaster: 3D SWA produces over 7% mixed blocks, destroying GPU MFU down to 5%! |
+-----------------------------------------------------------------------------------------------+ To solve this hardware-algorithm disconnect and achieve real wall-clock speedups matching theoretical sparsity, researchers at the Hao AI Lab at UC San Diego, in collaboration with UC Berkeley, Tsinghua University, and MBZUAI, developed FastVideo: Fast Video Generation with Sliding Tile Attention (arXiv:2502.04507).
Solution: Sliding Tile Attention (STA) and System-Algorithm Co-Design
FastVideo introduces Sliding Tile Attention (STA), a hardware-aware attention paradigm that replaces token-by-token sliding with tile-by-tile sliding.
+----------------------------------------------------------------------------------------------------+
| FASTVIDEO CORE INNOVATIONS |
+------------------------------------+---------------------------------------------------------------+
| Innovation Pillar | Engineering Mechanism & Quantitative Advantage |
+------------------------------------+---------------------------------------------------------------+
| Sliding Tile Attention (STA) | Organizes queries and keys into 3D tiles matching hardware |
| (100% Dense / Zero Mixed Blocks) | blocks; all queries in a tile share the exact same key tiles |
+------------------------------------+---------------------------------------------------------------+
| Producer-Consumer Asynchrony | Producer warpgroups prefetch only valid KV tiles into SRAM; |
| (ThunderKittens Kernel Design) | consumer warpgroups execute dense unmasked matrix multiplies |
+------------------------------------+---------------------------------------------------------------+
| Head Specialization Profiling | Discovers optimal per-head window sizes via automated offline |
| (Training-Free Acceleration) | profiling, cutting end-to-end latency to 501s with zero drift |
+------------------------------------+---------------------------------------------------------------+
| Multi-Objective Sparse Fine-Tuning | Fine-tunes with attention distillation, final layer MSE, and |
| (Extreme 91% Attention Sparsity) | flow-matching loss, slashing latency to 268s (3.53x speedup!) |
+------------------------------------+---------------------------------------------------------------+ By shifting the sliding unit from an individual token to a hardware-native tile, FastVideo completely eliminates mixed blocks: every single attention block in STA is either 100% dense or 100% empty.
This allows the attention kernel to achieve 58.79% MFU—accelerating the attention operator by up to 10.45x over FlashAttention-3 and cutting end-to-end HunyuanVideo generation latency from 945 seconds down to 268 seconds.
To explore how these high-throughput inference engines integrate into scalable enterprise agent architectures, visit AI Fetchly.
Architecture: Mathematical Foundations of Sliding Tile Attention
Sliding Tile Attention is built on the principle that hardware efficiency requires regularized memory access. Rather than allowing every individual token to carve out an idiosyncratic neighborhood, tokens are grouped into compact 3D spatio-temporal tiles.
+----------------------------------------------------------------------------------------------------+
| SLIDING TILE ATTENTION MATRIX |
| |
| [3D Video Latent: T_len x H_len x W_len] |
| | |
| v |
| Partitioned into 3D Cubical Tiles of Size (T, T, T) |
| Tile Token Count: B = T^3 (Exactly matches FlashAttention block size!) |
| | |
| v |
| +-----------------------------------------------------------------------------------------------+ |
| | TILE-LEVEL SLIDING WINDOW MECHANICS | |
| | | |
| | Query Tile Q_k (Tokens [k*B ... (k+1)*B - 1]) | |
| | | | |
| | +===> Attends to ALL Key Tiles K_j located within Window W centered around Q_k | |
| | | | |
| | +===> Number of Valid Key Tiles: (W / T)^3 | |
| | | |
| | * CRUCIAL PROPERTY: Every query in Q_k attends to the EXACT SAME key tokens! | |
| | * ATTENTION MAP RESULT: Exactly (W / T)^3 DENSE BLOCKS and ZERO MIXED BLOCKS! | |
| +-----------------------------------------------------------------------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------------------------------+ |
| | THUNDERKITTENS HARDWARE-AWARE EXECUTION GRAPH | |
| | | |
| | [Producer Warpgroups] [Consumer Warpgroups] | |
| | * Evaluate tile coordinates in HBM * Oblivious to sparsity | |
| | * Prefetch only valid Key-Value tiles * Compute dense matrix ops | |
| | * Asynchronously load into shared SRAM * 58.79% Model Flops Util | |
| +-----------------------------------------------------------------------------------------------+ |
+----------------------------------------------------------------------------------------------------+ Mathematical Formulation and Mixed Block Elimination
Let a video latent volume have spatial-temporal dimensions $(L, L, L)$, containing $N = L^3$ tokens. Let the FlashAttention SRAM block size be $B$.
In 3D Sliding Tile Attention:
- We define the tile dimension $T$ such that: $$B = T^3$$ For example, if FlashAttention operates on block size $B = 64$, we define $T = 4$ (since $4^3 = 64$).
- The entire video sequence is partitioned into non-overlapping 3D tiles of shape $(T, T, T)$. Tokens within each tile are indexed consecutively in memory.
- The sliding window size $W$ is chosen to be an exact integer multiple of $T$.
- A query tile at coordinate $(i, j, k)$ slides over key tiles within a cubic window of radius $W$: $$\mathcal{N}(i, j, k) = \left{ (i’, j’, k’) ;\Big|; |i - i’| \le \frac{W}{2}, ; |j - j’| \le \frac{W}{2}, ; |k - k’| \le \frac{W}{2} \right}$$
Because all queries inside tile $(i, j, k)$ share the exact same neighborhood $\mathcal{N}(i, j, k)$:
- The attention sub-matrix between any query tile and any key tile is either 100% full (dense) or 100% zero (empty).
- The number of mixed blocks is mathematically zero:
$$N_{\text{mix}}^{\text{STA}} = 0$$
$$N_{\text{dense}}^{\text{STA}} = \left(\frac{W}{T}\right)^3 \cdot \left(\frac{L}{T}\right)^3$$
In contrast, traditional 3D Tiled NATTEN produces a massive proportion of mixed blocks:
$$N_{\text{mix}}^{\text{NATTEN}} = \left(2 \left\lceil \frac{W - 1}{2T} \right\rceil + 1\right)^3 \cdot \left(\frac{L}{T}\right)^3 - N_{\text{dense}}^{\text{NATTEN}}$$
+----------------------------------------------------------------------------------------------------+
| BLOCK TYPE DISTRIBUTION COMPARISON |
+--------------------------+-------------------+--------------------+--------------------------------+
| Attention Architecture | Window Size | Dense Blocks (%) | Mixed Blocks (%) |
+--------------------------+-------------------+--------------------+--------------------------------+
| 3D Tiled NATTEN | (11, 11, 11) | 0.06% | 7.17% (Severe GPU bottleneck!) |
+--------------------------+-------------------+--------------------+--------------------------------+
| Sliding Tile Attn (STA) | (12, 12, 12) | 1.56% | 0.00% (Zero mixed blocks!) |
+--------------------------+-------------------+--------------------+--------------------------------+
| Sliding Tile Attn (STA) | (20, 20, 20) | 7.23% | 0.00% (Zero mixed blocks!) |
+--------------------------+-------------------+--------------------+--------------------------------+ The ThunderKittens Producer-Consumer Architecture
To maximize hardware utilization, FastVideo implements STA using ThunderKittens, a fast embedded domain-specific language for NVIDIA Hopper (H100) Tensor Cores:
- Disaggregated Mask Logic: In standard attention, the compute kernel must evaluate complex coordinate distances for every thread. In STA, the sparse attention pattern is managed entirely by producer warpgroups.
- Asynchronous KV Prefetching: While the consumer warpgroups compute Tensor Core matrix multiplications on tile $k$ in high-speed SRAM, the producer warpgroups asynchronously load key and value tiles $k+1$ from High-Bandwidth Memory (HBM) using Tensor Memory Accelerator (TMA) instructions.
- Zero Compute Masking Overhead: Consumer warpgroups are completely oblivious to the sparsity pattern. They execute standard, unmasked, dense GEMMs over the circular SRAM cache, achieving 94.09% of dense FlashAttention kernel efficiency.
Head Specialization and Automated Window Profiling
Not all attention heads require the same window size:
- Local Detail Heads: Focus on sharp physical textures (hair, water droplets, edge contrast) and require only small 3D windows (e.g., $w = (18, 24, 24)$).
- Global Scene Heads: Model holistic background motion, lighting transitions, and long-range semantic interactions, requiring broader windows (e.g., $w = (30, 40, 40)$).
FastVideo introduces an automated, training-free profiling algorithm:
- Profiles attention recall across a small calibration set of 16 text prompts.
- Evaluates the Mean Squared Error (MSE) between dense attention output and candidate STA window patterns for each head $(l, h)$.
- Assigns an optimal per-head window configuration that preserves over 99.8% visual fidelity while cutting total attention FLOPs by up to 75%.
Implementation: PyTorch Sliding Tile Attention and Kernel Mechanics
Below is a complete, production-grade PyTorch implementation demonstrating the 3D tile partitioning, tile-level sliding window mapping, and dense block execution of Sliding Tile Attention:
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Dict, List, Tuple, Optional
class SlidingTileAttention3D(nn.Module):
"""
Hardware-Aware 3D Sliding Tile Attention (STA) for Video DiTs:
Partitions video volume into 3D cubical tiles and executes dense block attention,
eliminating irregular mixed blocks and maximizing GPU Tensor Core utilization.
"""
def __init__(self, d_model: int = 1024, n_heads: int = 16,
tile_size: Tuple[int, int, int] = (2, 4, 4),
window_size: Tuple[int, int, int] = (6, 12, 12)):
super().__init__()
self.d_model = d_model
self.n_heads = n_heads
self.head_dim = d_model // n_heads
self.t_tile, self.h_tile, self.w_tile = tile_size
self.tokens_per_tile = self.t_tile * self.h_tile * self.w_tile
self.t_win, self.h_win, self.w_win = window_size
# Verify that window dimensions are clean multiples of tile dimensions
assert self.t_win % self.t_tile == 0 and self.h_win % self.h_tile == 0 and self.w_win % self.w_tile == 0, \
"Window size must be an exact integer multiple of tile size."
self.tiles_in_window = (self.t_win // self.t_tile) * (self.h_win // self.h_tile) * (self.w_win // self.w_tile)
# Projections
self.q_proj = nn.Linear(d_model, d_model, bias=False)
self.k_proj = nn.Linear(d_model, d_model, bias=False)
self.v_proj = nn.Linear(d_model, d_model, bias=False)
self.out_proj = nn.Linear(d_model, d_model, bias=False)
def partition_into_tiles(self, x: torch.Tensor, T: int, H: int, W: int) -> Tuple[torch.Tensor, int, int, int]:
"""
Rearranges continuous video tensor into non-overlapping 3D tiles.
x: (B, N, D) where N = T * H * W
Returns: (B, Num_Tiles, Tokens_Per_Tile, D)
"""
b, _, d = x.shape
# Reshape to (B, T, H, W, D)
x_3d = x.view(b, T, H, W, d)
# Calculate tile grid counts
n_t = T // self.t_tile
n_h = H // self.h_tile
n_w = W // self.w_tile
# Permute into tile blocks: (B, n_t, t_tile, n_h, h_tile, n_w, w_tile, D)
x_tiled = x_3d.view(b, n_t, self.t_tile, n_h, self.h_tile, n_w, self.w_tile, d)
# Transpose to group tile indices: (B, n_t, n_h, n_w, t_tile, h_tile, w_tile, D)
x_tiled = x_tiled.permute(0, 1, 3, 5, 2, 4, 6, 7).contiguous()
# Flatten into (B, Total_Tiles, Tokens_Per_Tile, D)
total_tiles = n_t * n_h * n_w
x_tiles = x_tiled.view(b, total_tiles, self.tokens_per_tile, d)
return x_tiles, n_t, n_h, n_w
def forward(self, x: torch.Tensor, T: int, H: int, W: int) -> torch.Tensor:
b, n, d = x.shape
q = self.q_proj(x)
k = self.k_proj(x)
v = self.v_proj(x)
# 1. Partition Query, Key, and Value tensors into 3D tiles
q_tiles, n_t, n_h, n_w = self.partition_into_tiles(q, T, H, W)
k_tiles, _, _, _ = self.partition_into_tiles(k, T, H, W)
v_tiles, _, _, _ = self.partition_into_tiles(v, T, H, W)
total_tiles = n_t * n_h * n_w
# Reshape for multi-head attention: (B, Total_Tiles, Heads, Tokens_Per_Tile, Head_Dim)
q_tiles = q_tiles.view(b, total_tiles, self.tokens_per_tile, self.n_heads, self.head_dim).permute(0, 3, 1, 2, 4)
k_tiles = k_tiles.view(b, total_tiles, self.tokens_per_tile, self.n_heads, self.head_dim).permute(0, 3, 1, 2, 4)
v_tiles = v_tiles.view(b, total_tiles, self.tokens_per_tile, self.n_heads, self.head_dim).permute(0, 3, 1, 2, 4)
# 2. Compute Dense Tile-to-Tile Attention
# In optimized CUDA/ThunderKittens kernels, producer warpgroups prefetch key tiles.
# Here we simulate the dense block computation:
scale = 1.0 / (self.head_dim ** 0.5)
out_tiles = torch.zeros_like(q_tiles)
# Stride radius in tile units
rad_t = (self.t_win // self.t_tile) // 2
rad_h = (self.h_win // self.h_tile) // 2
rad_w = (self.w_win // self.w_tile) // 2
# Iterate over 3D tile coordinates
for it in range(n_t):
for ih in range(n_h):
for iw in range(n_w):
q_idx = it * (n_h * n_w) + ih * n_w + iw
q_tile = q_tiles[:, :, q_idx, :, :] # (B, Heads, B_q, Head_Dim)
# Gather valid key and value tiles within the 3D window
valid_k_list = []
valid_v_list = []
t_min, t_max = max(0, it - rad_t), min(n_t, it + rad_t + 1)
h_min, h_max = max(0, ih - rad_h), min(n_h, ih + rad_h + 1)
w_min, w_max = max(0, iw - rad_w), min(n_w, iw + rad_w + 1)
for kt in range(t_min, t_max):
for kh in range(h_min, h_max):
for kw in range(w_min, w_max):
k_idx = kt * (n_h * n_w) + kh * n_w + kw
valid_k_list.append(k_tiles[:, :, k_idx, :, :])
valid_v_list.append(v_tiles[:, :, k_idx, :, :])
# Concatenate key tiles into dense block (B, Heads, Total_K_Tokens, Head_Dim)
k_block = torch.cat(valid_k_list, dim=2)
v_block = torch.cat(valid_v_list, dim=2)
# Dense FlashAttention GEMM over unmasked dense block!
scores = torch.matmul(q_tile, k_block.transpose(-2, -1)) * scale
attn = F.softmax(scores, dim=-1)
out_tiles[:, :, q_idx, :, :] = torch.matmul(attn, v_block)
# 3. Invert tile permutation back to sequential video ordering
out_tiles = out_tiles.permute(0, 2, 3, 1, 4).reshape(b, n_t, n_h, n_w, self.t_tile, self.h_tile, self.w_tile, self.d_model)
out_3d = out_tiles.permute(0, 1, 4, 2, 5, 3, 6, 7).contiguous()
out_seq = out_3d.view(b, n, self.d_model)
return self.out_proj(out_seq)
# Execution Verification
if __name__ == "__main__":
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Video dimensions: T=4 frames, H=8, W=8 -> Total 256 tokens
sta_layer = SlidingTileAttention3D(
d_model=256, n_heads=8,
tile_size=(2, 4, 4), # Tile has 32 tokens
window_size=(4, 8, 8) # Window covers full local region
).to(device)
sta_layer.eval()
dummy_video_seq = torch.randn(1, 256, 256, device=device)
with torch.no_grad():
out = sta_layer(dummy_video_seq, T=4, H=8, W=8)
print(f"Output Shape: {out.shape}")
print("Sliding Tile Attention 3D forward execution verified successfully.") For enterprises orchestrating distributed GPU clusters with automated video processing workflows, review our architectural guide on streaming API integrations.
Comparison: Quantitative and Wall-Clock Latency Benchmarks
FastVideo and Sliding Tile Attention were benchmarked on HunyuanVideo (generating 5-second 720P clips, 117 frames, 115,200 tokens) on NVIDIA H100 SXM5 GPUs, evaluated against FlashAttention-2 (FA2), FlashAttention-3 (FA3), CLEAR, NATTEN, Tiled NATTEN, and Swin:
+----------------------------------------------------------------------------------------------------+
| KERNEL-LEVEL ATTENTION FORWARD LATENCY (115.2K SEQ LEN) |
+--------------------------+-------------+------------------+------------------+---------------------+
| Kernel Architecture | Sparsity | TFLOPS | Kernel Latency | Speedup vs FA3 |
+--------------------------+-------------+------------------+------------------+---------------------+
| FlashAttention-3 (Dense) | 0.00% | 164.03 TFLOPS | 256.59 ms | 1.00x (Baseline) |
+--------------------------+-------------+------------------+------------------+---------------------+
| CLEAR (FlexAttention) | 90.46% | 15.65 TFLOPS | 307.44 ms | 0.86x (Slowdown!) |
+--------------------------+-------------+------------------+------------------+---------------------+
| NATTEN (FlexAttention) | 89.69% | 16.91 TFLOPS | 313.92 ms | 0.85x (Slowdown!) |
+--------------------------+-------------+------------------+------------------+---------------------+
| Tiled NATTEN (CUDA) | 89.69% | 16.91 TFLOPS | 458.36 ms | 0.58x (Severe Lag!) |
+--------------------------+-------------+------------------+------------------+---------------------+
| Swin (FlexAttention) | 87.42% | 20.64 TFLOPS | 47.90 ms | 5.54x |
+--------------------------+-------------+------------------+------------------+---------------------+
| STA (ThunderKittens) | 58.33% | 68.35 TFLOPS | 111.73 ms | 2.37x |
+--------------------------+-------------+------------------+------------------+---------------------+
| STA (ThunderKittens) | 91.00% | 14.76 TFLOPS | 25.38 ms | 10.45x (Top Record!)|
+--------------------------+-------------+------------------+------------------+---------------------+ +----------------------------------------------------------------------------------------------------+
| END-TO-END HUNYUANVIDEO GENERATION (5S 720P CLIP) |
+--------------------------+-------------+------------------+------------------+---------------------+
| Framework & Mode | VBench Total| Latency (Seconds)| End-to-End Speed | Quality Drift |
+--------------------------+-------------+------------------+------------------+---------------------+
| HunyuanVideo + FA2 | 82.71% | 1,496s (~25 min) | 0.63x | Baseline |
+--------------------------+-------------+------------------+------------------+---------------------+
| HunyuanVideo + FA3 | 82.71% | 945s (~16 min) | 1.00x | Baseline |
+--------------------------+-------------+------------------+------------------+---------------------+
| HunyuanVideo + Tiled NAT | 82.69% | 1,858s (~31 min) | 0.51x (Slowdown!)| -0.02% |
+--------------------------+-------------+------------------+------------------+---------------------+
| STA (Training-Free) | 82.47% | 501s (~8.3 min) | 1.89x Faster | -0.24% (Unnoticeable)
+--------------------------+-------------+------------------+------------------+---------------------+
| STA (Fine-Tuned 75% Spar)| 83.00% | 388s (~6.4 min) | 2.44x Faster | +0.29% (Improvement!)
+--------------------------+-------------+------------------+------------------+---------------------+
| STA (Fine-Tuned 91% Spar)| 82.62% | 268s (~4.4 min) | 3.53x Faster | -0.09% (Zero Loss!) |
+--------------------------+-------------+------------------+------------------+---------------------+ Key Benchmark Discoveries
1. Converts Theoretical Sparsity into Real Hardware Speedups: While NATTEN and CLEAR slow down execution due to irregular masking overhead, FastVideo’s Sliding Tile Attention accelerates the attention kernel by 10.45x over FlashAttention-3 and 17x over FlashAttention-2.
2. Drastic End-to-End Generation Acceleration (268s vs. 945s): FastVideo slashes HunyuanVideo 720P generation time from 16 minutes down to 4.4 minutes (a 3.53x speedup). In training-free mode, latency drops to 501 seconds with zero fine-tuning.
3. VBench Benchmark Parity (82.62% vs. 82.71%): On the comprehensive VBench suite (assessing subject consistency, background consistency, temporal flickering, and motion smoothness), FastVideo preserves full generation quality with a statistically negligible 0.09% variance.
Production: Enterprise Deployment, Fine-Tuning Recipes, and Serving
Deploying FastVideo in enterprise production environments—such as cloud media rendering engines, generative video APIs, and game asset pipelines—requires optimized deployment strategies:
+----------------------------------------------------------------------------------------------------+
| PRODUCTION DEPLOYMENT TOPOLOGY |
| |
| [Client Video Request: 720P / 1080P Prompt] |
| | |
| v |
| +----------------------------------------------+ |
| | FastVideo Orchestration Layer | (Automated Per-Head Window Profile Matcher) |
| +----------------------+-----------------------+ |
| | |
| v |
| +----------------------------------------------+ +---------------------------------------+ |
| | HunyuanVideo / Wan2.1 DiT Engine | =====> | ThunderKittens Asynchronous TMA Queue | |
| | (Sliding Tile Attention: 91% Sparsity) | +---------------------------------------+ |
| +----------------------+-----------------------+ |
| | |
| v |
| +----------------------------------------------+ |
| | 3D Causal VAE Decoder & Dynamic H.264 Stream | (Sub-5 Minute 720P Video Rendering) |
| +----------------------+-----------------------+ |
| | |
| v |
| [High-Resolution Broadcast Video Output] |
+----------------------------------------------------------------------------------------------------+ The FastVideo Fine-Tuning Recipe
To achieve the maximum 3.53x speedup at 91% attention sparsity, fine-tune the video DiT using FastVideo’s tri-loss objective:
- Hardware Configuration: Requires 8x NVIDIA H100 GPUs for only 8 hours of training (costing under $250 in compute), a trivial fraction of foundation pre-training costs.
- Tri-Loss Formulation: Combine flow matching data loss $\mathcal{L}{\text{data}}$ with intermediate attention distillation loss $\mathcal{L}{\text{attn}}$ and final layer loss $\mathcal{L}{\text{final}}$: $$\mathcal{L}{\text{total}} = \alpha \mathcal{L}{\text{data}} + \beta \mathcal{L}{\text{final}} + \gamma \mathcal{L}_{\text{attn}}$$ with $\alpha = 1.0, \beta = 0.5, \gamma = 0.5$. This teaches intermediate sparse layers to reproduce the global representation of the dense teacher model.
Production Best Practices
- Keep Initial Timesteps Dense: In diffusion models, the initial 10% to 20% of denoising steps establish macroscopic scene layout and global lighting. Keep full attention for $t \in [T_0, T]$ and activate Sliding Tile Attention for the remaining 80% of steps. This guarantees perfect scene coherence.
- Match Tile Size to Hardware SRAM: When deploying on NVIDIA Hopper (H100), configure tile size to $(T=4, H=4, W=4)$ to match the 64-token warp execution boundaries. On NVIDIA Blackwell (B200), expand tile size to $(4, 8, 8)$ to saturate enlarged shared memory banks.
- Cross-Modality Application (Image Super-Resolution): FastVideo’s STA extends directly to 2D image diffusion models (such as FLUX.1). Applying STA to 4K super-resolution upscaling delivers a 3.4x speedup over dense attention without edge blurring.
Strategic Summary and Architectural Trajectory
Hao AI Lab’s FastVideo and Sliding Tile Attention demonstrate that solving the generative video compute crisis does not require sacrificing full 3D spatial-temporal modeling.
By diagnosing the fundamental flaw of token-level sliding windows—replacing irregular, mask-heavy operations with clean, hardware-aligned 3D tiles—FastVideo achieves true wall-clock speedups proportional to mathematical sparsity. Delivering a 10.45x acceleration in attention kernels and slashing end-to-end video generation times by up to 3.53x, FastVideo establishes the foundational blueprint for scalable, real-time video diffusion transformers.