[Paper Review] BiQGEMM: Matrix Multiplication with Lookup Table For Binary-Coding-based Quantized DNNs
BiQGEMM is a novel matrix multiplication algorithm for binary-coding-based quantized DNNs that accelerates inference by using precomputed lookup tables to replace redundant multiplications and enabling simultaneous access to non-uniformly quantized weights via fixed-width instructions. It achieves up to 30.42× speedup over baseline kGpu and outperforms XNOR-based methods in memory-bound scenarios, especially for large output-size, small batch-size workloads common in NLP models.
The number of parameters in deep neural networks (DNNs) is rapidly increasing to support complicated tasks and to improve model accuracy. Correspondingly, the amount of computations and required memory footprint increase as well. Quantization is an efficient method to address such concerns by compressing DNNs such that computations can be simplified while required storage footprint is significantly reduced. Unfortunately, commercial CPUs and GPUs do not fully support quantization because only fixed data transfers (such as 32 bits) are allowed. As a result, even if weights are quantized into a few bits, CPUs and GPUs cannot access multiple quantized weights without memory bandwidth waste. Success of quantization in practice, hence, relies on an efficient computation engine design, especially for matrix multiplication that is a basic computation engine in most DNNs. In this paper, we propose a novel matrix multiplication method, called BiQGEMM, dedicated to quantized DNNs. BiQGEMM can access multiple quantized weights simultaneously in one instruction. In addition, BiQGEMM pre-computes intermediate results that are highly redundant when quantization leads to limited available computation space. Since pre-computed values are stored in lookup tables and reused, BiQGEMM achieves lower amount of overall computations. Our extensive experimental results show that BiQGEMM presents higher performance than conventional schemes when DNNs are quantized.
Motivation & Objective
- Address the performance bottleneck in quantized DNN inference caused by inefficient memory bandwidth utilization on von Neumann architectures.
- Overcome the limitation of fixed-width data transfers in CPUs/GPUs when handling non-uniformly quantized weights (e.g., 1-bit, 2-bit).
- Reduce redundant computations in matrix multiplication for quantized DNNs by precomputing and storing intermediate results in lookup tables.
- Enable high-performance GEMM operations on modern CPUs/GPUs without requiring hardware modifications, especially for models with large output dimensions and small batch sizes.
- Provide an efficient, software-level solution that improves both computational efficiency and memory bandwidth utilization in quantized DNN inference.
Proposed method
- Pre-compute and store intermediate results from quantized matrix multiplication in lookup tables to replace repeated multiplications.
- Design a memory access pattern that allows multiple non-uniformly quantized weights to be loaded in a single instruction, minimizing memory bandwidth waste.
- Use bit-packing to store quantized weights efficiently and unpack them in a way that supports simultaneous processing of multiple bits per word.
- Integrate the lookup-based computation into a GEMM kernel that operates on quantized weight matrices, avoiding explicit multiplication operations.
- Optimize the algorithm for scenarios where output size (m) is large and batch size (n) is small—common in NLP models like Transformers and LSTMs.
- Implement the method on GPU using a modified kGpu baseline and compare against XNOR-based and standard GEMM approaches.
Experimental results
Research questions
- RQ1Can lookup-based precomputation significantly reduce redundant computations in matrix multiplication for quantized DNNs?
- RQ2How can memory bandwidth be maximized when accessing non-uniformly quantized weights on fixed-width processors?
- RQ3What performance gain can be achieved by combining bit-packing with lookup tables in GEMM kernels for quantized DNNs?
- RQ4In what workload regimes (e.g., large m, small n) does BiQGEMM outperform existing quantized GEMM methods like XNOR and kGpu?
- RQ5To what extent does BiQGEMM reduce computational complexity while maintaining model accuracy in quantized inference?
Key findings
- BiQGEMM achieves up to 30.42× speedup over the kGpu baseline in matrix multiplication for 1-bit quantized DNNs, especially when matrix size is large and batch size is small.
- The performance gain increases with larger output size (m) and smaller batch size (n), making BiQGEMM particularly effective for NLP models such as Transformers and LSTMs.
- BiQGEMM outperforms XNOR-based methods in memory-bound scenarios, even when XNOR is optimized for 1-bit operations.
- By using lookup tables, BiQGEMM reduces redundant computations in quantized matrix multiplication, especially when the output space is limited due to low-bit quantization.
- The method significantly improves memory bandwidth utilization by enabling simultaneous access to multiple non-uniformly quantized weights in a single instruction, reducing data transfer overhead.
- BiQGEMM demonstrates high efficiency on modern von Neumann architectures without requiring hardware modifications, making it practical for deployment on standard CPUs and GPUs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.