“A very cool cite from that article is LLM.int8(): LLM.int8()”
LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale
LLM.int8():向量级量化加离群值混合精度,推理显存减半且无损
针对大语言模型推理占用大量 GPU 显存,作者为 Transformer 的前馈层和注意力投影层开发了 Int8 矩阵乘法流程,使推理内存减半且保持全精度性能:一个 175B 参数的 16/32 位检查点可直接加载、转成 Int8 并立即使用而无性能下降。方法是两部分的 LLM.int8():先对大部分特征做逐向量量化(每个内积使用独立归一化常数),再对「涌现离群特征」采用混合精度分解,把这些维度隔离到 16 位矩阵乘法中,同时仍有超过 99.9% 的数值以 8 位相乘。这使得在配备消费级 GPU 的单台服务器上使用 OPT-175B 或 BLOOM 成为可能,软件已开源。
HN 上的人把它当作「让大模型用一半显存而性能不降」的代表方法来推荐,常提到其要点是除少数离群值外都量化到 8 位,并与 Hugging Face 中的相关支持对照。
HN 书评
推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及“LLM.int8() is a recent development allowing LLMs to run in half the memory without loss of performance [2].”
“there is a concerted effort, at least for inference, to reduce memory requirements and provide more access to giant LLMs.[0]”
“I've seen neural nets using int8 for matrix multiplication to reduce memory size [1].”
“The idea was just to quantize all weights to 8 bits except a few outliers, which are kept in original precision.”
“I would be curious how this differs from [1] which is supported in Huggingface”
- LLM.int8(): 8-Bit Matrix Multiplication for Transformers at Scale ↗ofirpress · 2022-08-17 · 7 分
- LLM.int8(): 8-Bit Matrix Multiplication for Transformers at Scale ↗tosh · 2023-06-10 · 15 分