DeepCache: 무료로 확산 모델 가속화하기
DeepCache: Accelerating Diffusion Models for Free
December 1, 2023
저자: Xinyin Ma, Gongfan Fang, Xinchao Wang
cs.AI
초록
디퓨전 모델은 최근 놀라운 생성 능력으로 인해 이미지 합성 분야에서 전례 없는 관심을 받고 있습니다. 그러나 이러한 모델은 주로 순차적인 노이즈 제거 과정과 방대한 모델 크기로 인해 상당한 계산 비용을 초래하는 경우가 많습니다. 기존의 디퓨전 모델 압축 방법은 일반적으로 광범위한 재훈련을 필요로 하여 비용과 실행 가능성 측면에서 어려움을 겪습니다. 본 논문에서는 모델 아키텍처 관점에서 디퓨전 모델을 가속화하는 새로운 훈련 불필요 패러다임인 DeepCache를 소개합니다. DeepCache는 디퓨전 모델의 순차적 노이즈 제거 단계에서 관찰되는 시간적 중복성을 활용하여, 인접한 노이즈 제거 단계 간의 특징을 캐싱하고 검색함으로써 불필요한 계산을 줄입니다. U-Net의 특성을 활용하여 고수준 특징은 재사용하고 저수준 특징은 매우 저렴한 방식으로 업데이트합니다. 이 혁신적인 전략은 Stable Diffusion v1.5에서 CLIP Score가 단 0.05 감소한 상태에서 2.3배의 속도 향상을, LDM-4-G에서는 ImageNet에서 FID가 0.22 약간 감소한 상태에서 4.1배의 속도 향상을 가능하게 합니다. 우리의 실험은 또한 DeepCache가 재훈련을 필요로 하는 기존의 가지치기 및 지식 증류 방법을 능가하며, 현재의 샘플링 기술과도 호환됨을 보여줍니다. 더 나아가, 동일한 처리량 하에서 DeepCache는 DDIM 또는 PLMS와 비교하여 유사하거나 약간 개선된 결과를 효과적으로 달성함을 확인했습니다. 코드는 https://github.com/horseee/DeepCache에서 확인할 수 있습니다.
English
Diffusion models have recently gained unprecedented attention in the field of
image synthesis due to their remarkable generative capabilities.
Notwithstanding their prowess, these models often incur substantial
computational costs, primarily attributed to the sequential denoising process
and cumbersome model size. Traditional methods for compressing diffusion models
typically involve extensive retraining, presenting cost and feasibility
challenges. In this paper, we introduce DeepCache, a novel training-free
paradigm that accelerates diffusion models from the perspective of model
architecture. DeepCache capitalizes on the inherent temporal redundancy
observed in the sequential denoising steps of diffusion models, which caches
and retrieves features across adjacent denoising stages, thereby curtailing
redundant computations. Utilizing the property of the U-Net, we reuse the
high-level features while updating the low-level features in a very cheap way.
This innovative strategy, in turn, enables a speedup factor of 2.3times for
Stable Diffusion v1.5 with only a 0.05 decline in CLIP Score, and 4.1times
for LDM-4-G with a slight decrease of 0.22 in FID on ImageNet. Our experiments
also demonstrate DeepCache's superiority over existing pruning and distillation
methods that necessitate retraining and its compatibility with current sampling
techniques. Furthermore, we find that under the same throughput, DeepCache
effectively achieves comparable or even marginally improved results with DDIM
or PLMS. The code is available at https://github.com/horseee/DeepCache