[论文解读] BSQ: Exploring Bit-Level Sparsity for Mixed-Precision Neural Network Quantization
BSQ 引入比特级稀疏性正则化以联合训练权重的比特级表示,通过单一基于梯度的优化并结合可微分的比特稀疏正则来实现逐层的动态混合精度量化。
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 from a new angle of inducing bit-level sparsity. We consider each bit of quantized weights as an independent trainable variable and introduce a differentiable bit-sparsity regularizer. BSQ can induce all-zero bits across a group of weight elements and realize the dynamic precision reduction, leading to a mixed-precision quantization scheme of the original model. Our method enables the exploration of the full mixed-precision space with a single gradient-based optimization process, with only one hyperparameter to tradeoff the performance and compression. BSQ achieves both higher accuracy and higher bit reduction on various model architectures on the CIFAR-10 and ImageNet datasets comparing to previous methods.
研究动机与目标
- 为实现最佳准确率-压缩 Trade-off 而动机化混合精度量化。
- 提出一个可微框架,在不进行穷举 NAS 的情况下探索完整的混合精度空间。
- 引入比特级稀疏正则化,以动态调整层的精度。
- 实现高效的单次前向梯度优化以产生混合精度方案。
- 提供一个在训练过程中考虑内存的目标函数,以平衡准确率和模型大小。
提出的方法
- 将固定点权重的每一位表示为一个独立的可训练变量。
- 使用直通估计器以实现比特级表示的基于梯度的训练。
- 引入比特级组拉线正则化以在跨层产生比特级稀疏性。
- 对正则化进行内存占用感知的重加权,以倾向于对较大层进行更多剪枝。
- 进行定期重新量化和精度调整以动态最终确定混合精度方案。
- 在精度调整后对最终量化模型进行微调以恢复精度。
实验结果
研究问题
- RQ1如何通过比特级稀疏性在单次训练中发现最优的混合精度量化方案?
- RQ2可微的比特级正则化是否在保持或提升精度的前提下有效降低各层的精度?
- RQ3层级内存感知正则化对实现的压缩-精度权衡有何影响?
- RQ4BSQ 相较于现有的固定点和混合精度量化方法在 CIFAR-10 和 ImageNet 上有何表现?
- RQ5在不产生高昂训练成本的前提下,动态精度降低是否可行?
主要发现
- BSQ 在 CIFAR-10 和 ImageNet 的混合精度设置下,获得比前沿方法更高的准确率和更大的比特数压缩。
- 层级内存感知的重加权通过防止对较小层过度惩罚和对较大层不足惩罚来改善压缩-精度权衡。
- BSQ 产生的量化方案中,最关键的层获得更高的精度,与层重要性评估结果一致。
- 由 BSQ 从零开始找到的量化方案在在最终方案下微调时可超越 DoReFa-Net 基线。
- 该方法通过重新量化和精度调整实现动态的精度降低,而无需改变前向的 STE 权重重构。
- BsQ 在某些层可以实现 0-bit 剪枝而不破坏 ResNet 等网络的残差路径。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。