CacheQuant:全面加速的扩散模型
CacheQuant: Comprehensively Accelerated Diffusion Models
AI总结:
针对扩散模型时间与结构层面加速优化非正交导致性能下降的问题,提出免训练范式CacheQuant,联合优化缓存与量化技术,在MS-COCO上实现5.18倍加速和4倍压缩,CLIP分数仅损失0.02。
摘要:
扩散模型在图像合成领域逐渐崭露头角,展现出卓越的生成能力。然而,由于在时间与结构层面均存在冗余,导致推理缓慢且网络复杂,阻碍了其在真实场景中的低延迟应用。当前的扩散模型加速方法分别针对时间与结构层面进行研究。但是,在每个层面进行独立优化以进一步突破加速极限会导致显著的性能下降。另一方面,将两个层面的优化结合起来可以产生复合的加速效果。遗憾的是,我们发现这两个层面的优化并非完全正交。分别进行优化然后再简单整合会导致不理想的性能。为了解决这个问题,我们提出了CacheQuant,这是一种新颖的免训练范式,通过联合优化模型缓存和量化技术来全面加速扩散模型。具体而言,我们采用动态规划方法来确定最优缓存调度,其中仔细考虑了缓存和量化的特性以最小化误差。此外,我们提出了解耦误差校正,以逐步进一步缓解耦合和累积的误差。实验结果表明,CacheQuant在MS-COCO上对Stable Diffusion实现了5.18倍的加速和4倍的压缩,CLIP分数仅损失0.02。我们的代码已开源:https://github.com/BienLuky/CacheQuant。
英文摘要:
Diffusion models have gradually gained prominence in the field of image synthesis, showcasing remarkable generative capabilities. Nevertheless, the slow inference and complex networks, resulting from redundancy at both temporal and structural levels, hinder their low-latency applications in real-world scenarios. Current acceleration methods for diffusion models focus separately on temporal and structural levels. However, independent optimization at each level to further push the acceleration limits results in significant performance degradation. On the other hand, integrating optimizations at both levels can compound the acceleration effects. Unfortunately, we find that the optimizations at these two levels are not entirely orthogonal. Performing separate optimizations and then simply integrating them results in unsatisfactory performance. To tackle this issue, we propose CacheQuant, a novel training-free paradigm that comprehensively accelerates diffusion models by jointly optimizing model caching and quantization techniques. Specifically, we employ a dynamic programming approach to determine the optimal cache schedule, in which the properties of caching and quantization are carefully considered to minimize errors. Additionally, we propose decoupled error correction to further mitigate the coupled and accumulated errors step by step. Experimental results show that CacheQuant achieves a 5.18 speedup and 4 compression for Stable Diffusion on MS-COCO, with only a 0.02 loss in CLIP score. Our code are open-sourced: https://github.com/BienLuky/CacheQuant .
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。