HarmoniCa:协调训练与推理以优化 Diffusion Transformer 加速中的特征缓存
HarmoniCa: Harmonizing Training and Inference for Better Feature Caching in Diffusion Transformer Acceleration
AI总结:
本文提出 HarmoniCa 框架,通过引入逐步去噪训练和图像误差代理指导目标,解决 DiTs 特征缓存中训练与推理目标不一致的问题,在多模型和分辨率下实现显著加速与性能提升。
摘要:
Diffusion Transformers (DiTs) 在生成任务中表现出色,但由于高昂的推理成本,面临实际部署挑战。特征缓存通过存储和检索冗余计算,提供了加速的潜力。现有的基于学习的缓存方法虽然具备自适应性,但忽略了先前时间步的影响。它还存在训练与推理之间目标不一致的问题——即预测噪声对齐与高质量图像之间的矛盾。这两方面的差异损害了性能和效率。为此,我们通过一种名为 HarmoniCa 的新型基于学习的缓存框架来协调训练与推理。该框架首先引入了逐步去噪训练,以确保去噪过程的连续性,从而可以利用先前的步骤。此外,应用了图像误差代理指导目标,通过高效的代理来近似图像误差,从而在图像质量和缓存利用率之间取得平衡。在 8 个模型、4 个采样器以及从 256×256 到 2K 的分辨率上进行的广泛实验证明了本框架的卓越性能和加速效果。例如,在 PixArt-α 上实现了超过 40% 的延迟降低(即 2.07 倍的理论加速)以及性能提升。值得注意的是,我们这种无需图像的方法与先前的方法相比,将训练时间减少了 25%。代码可在 https://github.com/ModelTC/HarmoniCa 获取。
英文摘要:
Diffusion Transformers (DiTs) excel in generative tasks but face practical deployment challenges due to high inference costs. Feature caching, which stores and retrieves redundant computations, offers the potential for acceleration. Existing learning-based caching, though adaptive, overlooks the impact of the prior timestep. It also suffers from misaligned objectives--aligned predicted noise vs. high-quality images--between training and inference. These two discrepancies compromise both performance and efficiency. To this end, we harmonize training and inference with a novel learning-based caching framework dubbed HarmoniCa. It first incorporates Step-Wise Denoising Training (SDT) to ensure the continuity of the denoising process, where prior steps can be leveraged. In addition, an Image Error Proxy-Guided Objective (IEPO) is applied to balance image quality against cache utilization through an efficient proxy to approximate the image error. Extensive experiments across $8$ models, $4$ samplers, and resolutions from $256\times256$ to $2K$ demonstrate superior performance and speedup of our framework. For instance, it achieves over $40\%$ latency reduction (i.e., $2.07\times$ theoretical speedup) and improved performance on PixArt-$α$. Remarkably, our image-free approach reduces training time by $25\%$ compared with the previous method. Our code is available at https://github.com/ModelTC/HarmoniCa.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。