用低秩组件吸收异常值,实现4比特扩散模型高效部署
SVDQuant: Absorbing Outliers by Low-Rank Components for 4-Bit Diffusion Models
- 将量化异常值从激活值转移到权重,再通过低秩分解处理
- 120亿参数模型内存减少3.5倍,推理速度提升3.0倍(4090笔记本)
- 适配现有低秩适配器,无需重新量化,适合边缘设备部署
扩散模型能生成高质量图像,但规模扩大后带来内存与延迟挑战。本文提出SVDQuant,将权重与激活量化至4比特以加速推理。传统后训练量化方法在如此激进的精度下失效。SVDQuant先将异常值集中至权重,再利用奇异值分解(SVD)构建高精度低秩分支处理权重异常,同时低比特分支处理残差,缓解两端量化压力。为避免低秩分支带来的额外内存开销,设计协同推理引擎Nunchaku,将低秩核融合至低比特核中,消除冗余数据移动。实验验证其在SDXL、PixArt-Σ、FLUX.1上的有效性:12B的FLUX.1模型内存降低3.5×;在16GB笔记本4090显卡上,使用INT4精度相较4比特权重仅量化(W4A16)基线提速3.0×;在搭载Blackwell架构的RTX 5090桌面机上,使用NVFP4精度提速3.1×。
原文摘要 · Abstract (English)
Diffusion models can effectively generate high-quality images. However, as they scale, rising memory demands and higher latency pose substantial deployment challenges. In this work, we aim to accelerate diffusion models by quantizing their weights and activations to 4 bits. At such an aggressive level, both weights and activations are highly sensitive, where existing post-training quantization methods like smoothing become insufficient. To overcome this limitation, we propose SVDQuant, a new 4-bit quantization paradigm. Different from smoothing, which redistributes outliers between weights and activations, our approach absorbs these outliers using a low-rank branch. We first consolidate the outliers by shifting them from activations to weights. Then, we use a high-precision, low-rank branch to take in the weight outliers with Singular Value Decomposition (SVD), while a low-bit quantized branch handles the residuals. This process eases the quantization on both sides. However, naively running the low-rank branch independently incurs significant overhead due to extra data movement of activations, negating the quantization speedup. To address this, we co-design an inference engine Nunchaku that fuses the kernels of the low-rank branch into those of the low-bit branch to cut off redundant memory access. It can also seamlessly support off-the-shelf low-rank adapters (LoRAs) without re-quantization. Extensive experiments on SDXL, PixArt-$Σ$, and FLUX.1 validate the effectiveness of SVDQuant in preserving image quality. We reduce the memory usage for the 12B FLUX.1 models by 3.5$\times$, achieving 3.0$\times$ speedup over the 4-bit weight-only quantization (W4A16) baseline on the 16GB laptop 4090 GPU with INT4 precision. On the latest RTX 5090 desktop with Blackwell architecture, we achieve a 3.1$\times$ speedup compared to the W4A16 model using NVFP4 precision.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。