Introduction
Diffusion models have established themselves as the state-of-the-art for high-fidelity image generation. However, their deployment on resource-constrained edge devices remains challenging due to significant computational overhead. This overhead stems from two primary sources: the iterative denoising process (temporal overhead) and the massive parameter count of the underlying neural networks (model complexity). While techniques like fast sampling and quantization have been explored independently, their joint optimization has remained largely unaddressed.
The Efficiency Bottleneck
Existing efficiency methods often ignore the critical interaction between the number of denoising timesteps and the bit-precision of model layers. Reducing timesteps alters the model's sensitivity to quantization errors. However, searching for the optimal combination of timesteps and layer-wise bit-widths presents a "combinatorial explosion," with a search space far too large for exhaustive evaluation. TMPQ-DM (Timestep and Mixed-Precision Quantization for Diffusion Models) is designed to navigate this complex space efficiently.
Methodology
The TMPQ-DM framework optimizes diffusion models through three integrated pillars: non-uniform timestep grouping, a weight-sharing mixed-precision solver, and a joint evolutionary search.
1. Non-uniform Timestep Grouping
Empirical observations suggest that the denoising process is not uniform. Steps closer to the final image (low noise) are significantly more sensitive to perturbations than steps near the initial noise. TMPQ-DM employs a non-uniform grouping strategy that allocates more "search attention" to these critical steps, drastically reducing the search space while preserving generation quality.
2. Weight-Sharing Mixed-Precision Solver
Standard Post-Training Quantization (PTQ) typically requires a slow calibration phase for every bit-width configuration. To overcome this, the authors developed a "super-network" where various bit-width options share calibration results. This weight-sharing approach allows for the near-instant evaluation of thousands of precision configurations.
3. Joint Evolutionary Search
A gradient-free evolutionary algorithm navigates the joint search space. It identifies configurations that minimize the Frechet Inception Distance (FID) while adhering to a specific Bit Operations (BitOPs) budget, ensuring high-quality results within strict computational constraints.
Key Insights
A fundamental finding of this work is the coupling between temporal and model precision. A model may tolerate lower bit-widths if it has more timesteps to iteratively correct errors. Furthermore, the sensitivity analysis reveals that activations generally require higher bit-widths (e.g., 8-bit) compared to weights (e.g., 5-bit or 6-bit) to maintain structural integrity in generated images.
Experimental Results
TMPQ-DM was validated across five diverse datasets, including CIFAR-10, LSUN, ImageNet, and COCO (using Stable Diffusion). Key performance metrics include:
- 10× Efficiency Gains: The method consistently achieved over 10× savings in BitOPs across all tasks without compromising generative performance.
- Low-Step Fidelity: On CIFAR-10 with only 5 steps, TMPQ-DM improved the FID score from 68.93 (baseline quantization) to 13.08.
- State-of-the-Art Performance: On LSUN-Churches, the framework achieved an FID of 4.88 with 20 steps, outperforming previous methods like ADPDM while saving approximately 85% of model invocations compared to 100-step baselines.
Conclusion and Future Work
TMPQ-DM demonstrates that joint optimization of timesteps and precision is essential for maximizing diffusion model efficiency. As a PTQ-based approach, it is highly practical for existing production models as it requires no expensive retraining. Future research may focus on integrating hardware-in-the-loop measurements to account for specific chip architectures and exploring Quantization-Aware Training (QAT) to push bit-widths even lower.
Summary updated