让大模型更省显存更快推理,不丢精度
Q-VLM: Post-training Quantization for Large Vision-Language Models
- 用激活熵做代理,优化跨层依赖,降低搜索成本
- 130亿参数的LLaVA模型压缩2.78倍,速度提升44%
- 适合部署大视觉语言模型的工程师和研究者
本文提出一种用于大型视觉-语言模型(LVLMs)的后训练量化框架,以实现高效的多模态推理。传统量化方法通过逐层最小化激活离散化误差来搜索最优量化策略,但未考虑跨层依赖,难以获得最优结果。本文挖掘了显著影响整个模型离散化误差的跨层依赖关系,并将其融入低开销的最优量化策略搜索中。具体地,我们发现激活熵与输出离散化误差的跨层依赖具有强相关性,因此采用熵作为代理进行块的最优划分,以在离散化误差与搜索成本之间取得良好平衡。此外,我们优化视觉编码器以解耦跨层依赖,实现搜索空间的细粒度分解,进一步降低搜索成本而不损害量化精度。实验表明,该方法将130亿参数的LLaVA模型内存压缩2.78倍,生成速度提升1.44倍,且在多种多模态推理任务上无性能下降。代码已开源:https://github.com/ChangyuanWang17/QVLM。
原文摘要 · Abstract (English)
In this paper, we propose a post-training quantization framework of large vision-language models (LVLMs) for efficient multi-modal inference. Conventional quantization methods sequentially search the layer-wise rounding functions by minimizing activation discretization errors, which fails to acquire optimal quantization strategy without considering cross-layer dependency. On the contrary, we mine the cross-layer dependency that significantly influences discretization errors of the entire vision-language model, and embed this dependency into optimal quantization strategy searching with low search cost. Specifically, we observe the strong correlation between the activation entropy and the cross-layer dependency concerning output discretization errors. Therefore, we employ the entropy as the proxy to partition blocks optimally, which aims to achieve satisfying trade-offs between discretization errors and the search cost. Moreover, we optimize the visual encoder to disentangle the cross-layer dependency for fine-grained decomposition of search space, so that the search cost is further reduced without harming the quantization accuracy. Experimental results demonstrate that our method compresses the memory by 2.78x and increase generate speed by 1.44x about 13B LLaVA model without performance degradation on diverse multi-modal reasoning tasks. Code is available at https://github.com/ChangyuanWang17/QVLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。