잠재 확산 모델을 위한 효율적인 양자화 전략
Efficient Quantization Strategies for Latent Diffusion Models
December 9, 2023
저자: Yuewei Yang, Xiaoliang Dai, Jialiang Wang, Peizhao Zhang, Hongbo Zhang
cs.AI
초록
잠재 확산 모델(Latent Diffusion Models, LDMs)은 시간에 따른 잠재 변수의 동적 변화를 포착하며, 생성 시스템 내에서 패턴과 다중 양식을 혼합합니다. 강력한 텍스트 인코더와 변이형 오토인코더를 통해 텍스트-이미지 생성과 같은 다양한 응용 분야에서 LDM의 뛰어난 성능에도 불구하고, 대규모 생성 모델을 에지 디바이스에 배포해야 하는 중요한 필요성은 더욱 컴팩트하면서도 효과적인 대안을 모색하게 합니다. 딥러닝 모델의 운영 크기를 압축하는 방법인 학습 후 양자화(Post Training Quantization, PTQ)는 LDM에 적용할 때 시간적 및 구조적 복잡성으로 인해 어려움에 직면합니다. 본 연구는 LDM을 효율적으로 양자화하는 전략을 제안하며, 신호 대 양자화 잡음비(Signal-to-Quantization-Noise Ratio, SQNR)를 평가의 핵심 지표로 활용합니다. 양자화 불일치를 상대적 잡음으로 간주하고 모델의 민감한 부분을 식별함으로써, 우리는 전역적 및 지역적 전략을 포괄하는 효율적인 양자화 접근 방식을 제안합니다. 전역적 양자화 과정은 민감한 블록에 대해 더 높은 정밀도의 양자화를 시작함으로써 상대적 양자화 잡음을 완화하며, 지역적 처리는 양자화에 민감하고 시간에 민감한 모듈의 특정 문제를 해결합니다. 실험 결과는 전역적 및 지역적 처리를 모두 구현함으로써 LDM의 매우 효율적이고 효과적인 학습 후 양자화(PTQ)를 달성할 수 있음을 보여줍니다.
English
Latent Diffusion Models (LDMs) capture the dynamic evolution of latent
variables over time, blending patterns and multimodality in a generative
system. Despite the proficiency of LDM in various applications, such as
text-to-image generation, facilitated by robust text encoders and a variational
autoencoder, the critical need to deploy large generative models on edge
devices compels a search for more compact yet effective alternatives. Post
Training Quantization (PTQ), a method to compress the operational size of deep
learning models, encounters challenges when applied to LDM due to temporal and
structural complexities. This study proposes a quantization strategy that
efficiently quantize LDMs, leveraging Signal-to-Quantization-Noise Ratio (SQNR)
as a pivotal metric for evaluation. By treating the quantization discrepancy as
relative noise and identifying sensitive part(s) of a model, we propose an
efficient quantization approach encompassing both global and local strategies.
The global quantization process mitigates relative quantization noise by
initiating higher-precision quantization on sensitive blocks, while local
treatments address specific challenges in quantization-sensitive and
time-sensitive modules. The outcomes of our experiments reveal that the
implementation of both global and local treatments yields a highly efficient
and effective Post Training Quantization (PTQ) of LDMs.