Quantization is an essential step in the efficient deployment of deep learning models and as such is an increasingly popular research topic. An important practical aspect that is not addressed in the current literature is how to analyze and fix fail cases where the use of quantization results in excessive degradation. In this paper, we present a simple analytic framework that breaks down overall degradation to its per layer contributions. We analyze many common networks and observe that a layer's contribution is determined by both intrinsic (local) factors - the distribution of the layer's weights and activations - and extrinsic (global) factors having to do with the the interaction with the rest of the layers. Layer-wise analysis of existing quantization schemes reveals local fail-cases of existing techniques which are not reflected when inspecting their overall performance. As an example, we consider ResNext26 on which SoTA post-training quantization methods perform poorly. We show that almost all of the degradation stems from a single layer. The same analysis also allows for local fixes - applying a common weight clipping heuristic only to this layer reduces degradation to a minimum while applying the same heuristic globally results in high degradation. More generally, layer-wise analysis allows for a more nuanced examination of how quantization affects the network, enabling the design of better performing schemes.
Network quantization is one of the most hardware friendly techniques to enable the deployment of convolutional neural networks (CNNs) on low-power mobile devices. Recent network quantization techniques quantize each weight kernel in a convolutional layer independently for higher inference accuracy, since the weight kernels in a layer exhibit different variances and hence have different amounts of redundancy. The quantization bitwidth or bit number (QBN) directly decides the inference accuracy, latency, energy and hardware overhead. To effectively reduce the redundancy and accelerate CNN infere…
Habana Labs – An Intel company(Habana Labs——英特尔旗下公司);Technion(以色列理工学院)
Lately, post-training quantization methods have gained considerable attention, as they are simple to use, and require only a small unlabeled calibration set. This small dataset cannot be used to fine-tune the model without significant over-fitting. Instead, these methods only use the calibration set to set the activations' dynamic ranges. However, such methods always resulted in significant accuracy degradation, when used below 8-bits (except on small datasets). Here we aim to break the 8-bit barrier. To this end, we minimize the quantization errors of each layer separately by optimizing its p…
Facebook AI Research(脸书人工智能研究院);University of Washington(华盛顿大学)
Stateful optimizers maintain gradient statistics over time, e.g., the exponentially smoothed sum (SGD with momentum) or squared sum (Adam) of past gradient values. This state can be used to accelerate optimization compared to plain stochastic gradient descent but uses memory that might otherwise be allocated to model parameters, thereby limiting the maximum size of models trained in practice. In this paper, we develop the first optimizers that use 8-bit statistics while maintaining the performance levels of using 32-bit optimizer states. To overcome the resulting computational, quantization, a…
George Mason University(乔治梅森大学);Michigan State University(密歇根州立大学);Northeastern University(东北大学)
This work proposes a novel Deep Neural Network (DNN) quantization framework, namely RMSMP, with a Row-wise Mixed-Scheme and Multi-Precision approach. Specifically, this is the first effort to assign mixed quantization schemes and multiple precisions within layers -- among rows of the DNN weight matrix, for simplified operations in hardware inference, while preserving accuracy. Furthermore, this paper makes a different observation from the prior work that the quantization error does not necessarily exhibit the layer-wise sensitivity, and actually can be mitigated as long as a certain portion of…
Center for Energy-Efficient Computing and Applications, Peking University(北京大学高能效计算与应用中心);Houmo AI(后摩智能)
Network quantization is a powerful technique to compress convolutional neural networks. The quantization granularity determines how to share the scaling factors in weights, which affects the performance of network quantization. Most existing approaches share the scaling factors layerwisely or channelwisely for quantization of convolutional layers. Channelwise quantization and layerwise quantization have been widely used in various applications. However, other quantization granularities are rarely explored. In this paper, we will explore the sub-layerwise granularity that shares the scaling fac…
CALM: A CKA-Guided Adaptive Layer-Wise Modularization Framework for LLM Quantization
Beijing University of Posts and Telecommunications(北京邮电大学);Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);Zhejiang University(浙江大学);University of Science and Technology of China(中国科学技术大学)
Duke University(杜克大学);Monta Vista High School(蒙塔维斯塔高中)
Neural networks are getting better accuracy with higher energy and computational cost. After quantization, the cost can be greatly saved, and the quantized models are more hardware friendly with acceptable accuracy loss. On the other hand, recent research has found that neural networks are vulnerable to adversarial attacks, and the robustness of a neural network model can only be improved with defense methods, such as adversarial training. In this work, we find that adversarially-trained neural networks are more vulnerable to quantization loss than plain models. To minimize both the adversaria…
LoPRo: Enhancing Low-Rank Quantization via Permuted Block-Wise Rotation
Institute of Software Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);Beijing University of Aeronautics and Astronautics(北京航空航天大学)
SmoothRot: Combining Channel-Wise Scaling and Rotation for Quantization-Friendly LLMs
Doctoral School of Applied Informatics and Applied Mathematics, Obuda University(应用信息学与应用数学博士学院,奥布达大学);John von Neumann Faculty of Informatics, Obuda University(约翰·冯·诺依曼信息学院,奥布达大学)
Second-order information has proven to be very effective in determining the redundancy of neural network weights and activations. Recent paper proposes to use Hessian traces of weights and activations for mixed-precision quantization and achieves state-of-the-art results. However, prior works only focus on selecting bits for each layer while the redundancy of different channels within a layer also differ a lot. This is mainly because the complexity of determining bits for each channel is too high for original methods. Here, we introduce Channel-wise Hessian Aware trace-Weighted Quantization (C…
Data quantization is an effective method to accelerate neural network training and reduce power consumption. However, it is challenging to perform low-bit quantized training: the conventional equal-precision quantization will lead to either high accuracy loss or limited bit-width reduction, while existing mixed-precision methods offer high compression potential but failed to perform accurate and efficient bit-width assignment. In this work, we propose DYNASTY, a block-wise dynamic-precision neural network training framework. DYNASTY provides accurate data sensitivity information through fast o…
Post-training, layer-wise quantization is preferable because it is free from retraining and is hardware-friendly. Nevertheless, accuracy degradation has occurred when a neural network model has a big difference of per-out-channel weight ranges. In particular, the MobileNet family has a tragedy drop in top-1 accuracy from 70.60% ~ 71.87% to 0.1% on the ImageNet dataset after 8-bit weight quantization. To mitigate this significant accuracy reduction, we propose a new weight equalizing shift scaler, i.e. rescaling the weight range per channel by a 4-bit binary shift, prior to a layer-wise quantiz…
Layer-wise Quantization for Quantized Optimistic Dual Averaging
National University of Singapore (NUS)(新加坡国立大学);EPFL(洛桑联邦理工学院);Neural Magic;University of Oslo (UiO)(奥斯陆大学);Integreat, Norwegian Centre for Knowledge-driven Machine Learning(挪威知识驱动机器学习中心);Institute of Science and Technology Austria (ISTA)(奥地利科学技术研究所)
MergeQuant: Accurate 4-bit Static Quantization of Large Language Models by Channel-wise Calibration
State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications(北京邮电大学网络与交换技术国家重点实验室);PengCheng Laboratory(鹏城实验室)
Mixed-precision quantization can potentially achieve the optimal tradeoff between performance and compression rate of deep neural networks, and thus, have been widely investigated. However, it lacks a systematic method to determine the exact quantization scheme. Previous methods either examine only a small manually-designed search space or utilize a cumbersome neural architecture search to explore the vast search space. These approaches cannot lead to an optimal quantization scheme efficiently. This work proposes bit-level sparsity quantization (BSQ) to tackle the mixed-precision quantization …
Technical University of Munich(慕尼黑工业大学);TU Darmstadt(达姆施塔特工业大学);Xidian University(西安电子科技大学)
In deep neural networks (DNNs), there are a huge number of weights and multiply-and-accumulate (MAC) operations. Accordingly, it is challenging to apply DNNs on resource-constrained platforms, e.g., mobile phones. Quantization is a method to reduce the size and the computational complexity of DNNs. Existing quantization methods either require hardware overhead to achieve a non-uniform quantization or focus on model-wise and layer-wise uniform quantization, which are not as fine-grained as filter-wise quantization. In this paper, we propose a class-based quantization method to determine the min…
University of Science and Technology of China(中国科学技术大学);Stanford University(斯坦福大学);Sun Yat-sen University(中山大学);Microsoft Research Asia(微软亚洲研究院);Microsoft Research(微软研究院)
Differentially private deep learning has recently witnessed advances in computational efficiency and privacy-utility trade-off. We explore whether further improvements along the two axes are possible and provide affirmative answers leveraging two instantiations of \emph{group-wise clipping}. To reduce the compute time overhead of private learning, we show that \emph{per-layer clipping}, where the gradient of each neural network layer is clipped separately, allows clipping to be performed in conjunction with backpropagation in differentially private optimization. This results in private learnin…
Inception Institute of Artificial Intelligence(起源人工智能研究院)
Conditioning analysis uncovers the landscape of an optimization objective by exploring the spectrum of its curvature matrix. This has been well explored theoretically for linear models. We extend this analysis to deep neural networks (DNNs) in order to investigate their learning dynamics. To this end, we propose layer-wise conditioning analysis, which explores the optimization landscape with respect to each layer independently. Such an analysis is theoretically supported under mild assumptions that approximately hold in practice. Based on our analysis, we show that batch normalization (BN) can…
Network quantization, which aims to reduce the bit-lengths of the network weights and activations, has emerged as one of the key ingredients to reduce the size of neural networks for their deployments to resource-limited devices. In order to overcome the nature of transforming continuous activations and weights to discrete ones, recent study called Relaxed Quantization (RQ) [Louizos et al. 2019] successfully employ the popular Gumbel-Softmax that allows this transformation with efficient gradient-based optimization. However, RQ with this Gumbel-Softmax relaxation still suffers from bias-varian…
Adaptive Layer-Wise Transformations for Post-Training Quantization of Large Language Models
Department of Data Science and AI, Monash University, Australia(墨尔本大学数据科学与人工智能系);Centre for Vision, Speech and Signal Processing, University of Surrey, UK(萨里大学视觉、语音和信号处理中心)
Layer-Wise High-Impact Parameter Ratio Optimization in Post-Training Quantization for Large Language Models
Department of Data Science and AI, Monash University, Australia(墨尔本大学数据科学与人工智能系);Centre for Vision, Speech and Signal Processing, University of Surrey, UK(萨里大学视觉、语音与信号处理中心)
Exploring Layer-wise Information Effectiveness for Post-Training Quantization in Small Language Models
The University of Hong Kong(香港大学);Huazhong University of Science and Technology(华中科技大学);Shenzhen International Graduate School, Tsinghua University(清华大学深圳国际研究生学院)
For recurrent neural networks trained on time series with target and exogenous variables, in addition to accurate prediction, it is also desired to provide interpretable insights into the data. In this paper, we explore the structure of LSTM recurrent neural networks to learn variable-wise hidden states, with the aim to capture different dynamics in multi-variable time series and distinguish the contribution of variables to the prediction. With these variable-wise hidden states, a mixture attention mechanism is proposed to model the generative process of the target. Then we develop associated …
LUT-KAN: Segment-wise LUT Quantization for Fast KAN Inference
Department of Theoretical and Applied Sciences (DiSTA)(理论与应用科学系);eCampus University(eCampus大学);Department of Intelligent Software Systems and Technologies(智能软件系统与技术系);School of Computer Science and Artificial Intelligence(计算机科学与人工智能学院);V.N. Karazin Kharkiv National University(V.N.卡扎林赫尔辛基国立大学)
Efficient Multi-bit Quantization Network Training via Weight Bias Correction and Bit-wise Coreset Sampling
Department of Electrical and Computer Engineering, Sungkyunkwan University(电气与计算机工程系,全北大学);Department of Electrical and Computer Engineering, Duke University(电气与计算机工程系,杜克大学);Kim Jaechul Graduate School of AI, Korea Advanced Institute of Science and Technology (KAIST)(金 Jaechul人工智能研究生院,韩国科学技术院(KAIST))
Huawei Zurich Research Center(华为苏黎世研究中心);Politecnico di Torino(都灵理工大学)
Most of today's computer vision pipelines are built around deep neural networks, where convolution operations require most of the generally high compute effort. The Winograd convolution algorithm computes convolutions with fewer MACs compared to the standard algorithm, reducing the operation count by a factor of 2.25x for 3x3 convolutions when using the version with 2x2-sized tiles $F_2$. Even though the gain is significant, the Winograd algorithm with larger tile sizes, i.e., $F_4$, offers even more potential in improving throughput and energy efficiency, as it reduces the required MACs by 4x…
Tsinghua University(清华大学);Peng Cheng Laboratory(鹏城实验室);Shanghai Jiao Tong University(上海交通大学);Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所)
The exponentially large discrete search space in mixed-precision quantization (MPQ) makes it hard to determine the optimal bit-width for each layer. Previous works usually resort to iterative search methods on the training set, which consume hundreds or even thousands of GPU-hours. In this study, we reveal that some unique learnable parameters in quantization, namely the scale factors in the quantizer, can serve as importance indicators of a layer, reflecting the contribution of that layer to the final accuracy at certain bit-widths. These importance indicators naturally perceive the numerical…