TL;DR
This paper introduces QuantCache, a novel framework that significantly accelerates Diffusion Transformers (DiTs) for video generation. By adaptively optimizing quantization, caching, and pruning, QuantCache achieves a 6.72x speedup on Open-Sora with minimal loss in generation quality, making high-fidelity video generation more accessible.
What Problem Does This Paper Address?
Diffusion Transformers (DiTs) have revolutionized video generation, producing impressive results by leveraging transformer architectures. However, their computational and memory demands are substantial, hindering their deployment on resource-constrained devices. Existing acceleration techniques like quantization and caching often operate in isolation and rely on static heuristics, failing to adapt to the dynamic nature of the diffusion process and the varying importance of different layers and timesteps. This paper addresses the need for a unified, adaptive framework that can efficiently accelerate DiTs without sacrificing generation quality.
Methods
QuantCache is a training-free inference acceleration framework that jointly optimizes three key components:
- Hierarchical Latent Caching (HLC): Instead of static caching intervals, HLC adaptively decides when to refresh cached features based on inter-step feature divergence. This metric quantifies the rate of change in motion across consecutive timesteps, allowing for more intelligent caching decisions that reduce redundant computations while preserving quality.
- Adaptive Importance-Guided Quantization (AIGQ): This technique dynamically assigns bit-widths to both weights and activations based on their perceptual relevance and timestep-level redundancy.
- Weight Quantization: Layers are assigned bit-widths based on their sensitivity to numerical error, perceptual distortion, and temporal dynamics. Critical layers receive higher precision, while less important ones are quantized more aggressively.
- Activation Quantization: Bit-widths are modulated per timestep based on feature similarity. Steps with high redundancy (subtle changes) use lower bit-widths, while critical transition steps use higher bit-widths to maintain fidelity.
- Structural Redundancy-Aware Pruning (SRAP): This mechanism adaptively prunes layers within a single timestep based on the similarity of their intermediate representations. By quantifying redundancy using cosine similarity between consecutive layers, SRAP selectively omits computations that are unlikely to impact information flow, further reducing computational cost.
These three components are integrated to create a cohesive, self-adaptive compute allocation strategy.
Datasets
The paper evaluates QuantCache on the Open-Sora model. For evaluation, they utilize the VBench benchmark suite, which provides a comprehensive set of metrics for video generation quality. They also use CLIP and Dover for assessing text-video alignment, temporal semantic consistency, and overall video quality (aesthetic and technical).
Key Insights and Ideas
- Dynamic Importance is Key: The core insight is that the importance of different layers and timesteps in DiTs is not static but changes dynamically throughout the diffusion process. This variability is the foundation for adaptive optimization.
- Synergy of Techniques: QuantCache demonstrates that combining caching, quantization, and pruning in a unified framework yields significantly better results than applying them in isolation.
- Content-Awareness: The adaptive nature of HLC and AIGQ, driven by feature divergence and similarity metrics, allows the framework to tailor its acceleration strategies to the specific content of the video being generated.
- Trade-off Management: The framework is designed to balance efficiency gains with generation quality, ensuring that critical aspects of the video are preserved even with aggressive optimization.
Key Results
- Significant Speedup: QuantCache achieves a 6.72x speedup on Open-Sora compared to the baseline, outperforming other state-of-the-art methods.
- Minimal Quality Degradation: Despite the substantial speedup, QuantCache demonstrates negligible loss in generation quality across various metrics, including motion smoothness, background consistency, subject consistency, aesthetic quality, and imaging quality.
- Competitive Performance: In 8/8 bit-width settings, QuantCache shows strong performance with only minor reductions compared to the baseline. In more challenging 4/6 bit-width configurations, it outperforms other methods with 4/8 bit-width, showcasing its robustness.
- Ablation Study Success: Ablation studies confirm the significant contributions of each component: HLC provides a 4.12x speedup, AIGQ alongside HLC brings it to 6.33x, and the full QuantCache (including SRAP) achieves the maximum 6.72x speedup.
Limitations and Future Work
- Training-Free Nature: While a strength for deployment, the training-free nature might limit its ability to achieve the absolute best possible quality compared to methods that involve fine-tuning.
- Hardware Optimization: The paper mentions optimized GEMM CUDA kernels and kernel fusion for hardware implementation, suggesting that further hardware-specific optimizations could yield even greater gains.
- Generalizability: While evaluated on Open-Sora, future work could explore the generalizability of QuantCache to other DiT architectures and video generation tasks.
- Adaptive Thresholds: The paper mentions empirically determined thresholds for redundancy metrics. Further research could focus on more principled ways to set or learn these thresholds.
Summary updated