Fast and Efficient 2-bit LLM Inference on GPU: 2/4/16-bit in a Weight Matrix with Asynchronous Dequantization
Large language models (LLMs) have demonstrated impressive abilities in various domains while the inference cost is expensive. Many previous studies exploit quantization methods to reduce LLM inference cost by reducing latency and memory consumption. Applying 2-bit single-precision weight quantization brings >3% accuracy loss, so the state-of-the-art methods use mixed-precision methods for LLMs (e.g. Llama2-7b, etc.) to improve the accuracy. However, challenges still exist: (1) Uneven distribution in weight matrix. Weights are quantized by groups, while some groups contain weights with large range. Previous methods apply inter-weight mixed-precision quantization and neglect the range difference inside each weight matrix, resulting in >2.7% accuracy loss (e.g. LLM-MQ and APTQ). (2) Large speed degradation by adding sparse outliers. Reserving sparse outliers improves accuracy but slows down the speed affected by the outlier ratio (e.g. 1.5% outliers resulting in >30% speed degradation in SpQR). (3) Time-consuming dequantization operations on GPUs. Mainstream methods require a dequantization operation to perform computation on the quantized weights, and the 2-order dequantization operation is applied because scales of groups are also quantized. These dequantization operations lead to >50% execution time.
Authors
- Shiyao Li (ORCID: https://orcid.org/0009-0007-4755-6881)
- Guohao Dai (ORCID: https://orcid.org/0000-0003-0849-3252)
- J Liu (ORCID: https://orcid.org/0009-0003-8280-9072)
- Jinhao Li (ORCID: https://orcid.org/0009-0009-4286-6359)
- Yaoxiu Lian (ORCID: https://orcid.org/0009-0007-7858-5132)
- Shan Huang (ORCID: https://orcid.org/0009-0005-2012-8540)
- Jianrong Xu (ORCID: https://orcid.org/0009-0000-7000-6537)
Institutions
- Shanghai Jiao Tong University (CN)
- Tsinghua University (CN)
Publication Details
- Published
- 2024-10-27
- DOI
- https://doi.org/10.1145/3676536.3676796
- Citations
- 3
- Primary Topic
- Algorithms and Data Compression
- Type
- article
- Field-Weighted Citation Impact
- 1.04
Funders
- National Natural Science Foundation of China