arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2309.01507cs.LGcs.AI
收藏

具有4位状态的节省内存优化器

Memory Efficient Optimizers with 4-bit States

Tsinghua University(清华大学)

Bingrui Li, Jianfei Chen, Jun Zhu

AI总结:

本文通过实证分析一阶矩和二阶矩的离群值模式,提出结合行列信息的小块量化及排除零点的线性量化器,将优化器状态压缩至4位,在多个任务上实现与全精度优化器相当的准确率并显著降低内存占用。

摘要:

优化器状态是训练神经网络时内存消耗的主要来源之一,限制了在给定内存预算下可训练的最大模型规模。将优化器状态从32位浮点数压缩到更低位宽是减少训练内存占用的一个有前景的方向,而目前可达到的最低位数是8位。在这项工作中,我们通过对一阶矩和二阶矩的详细实证分析,将优化器状态的位宽降低到4位。具体来说,我们发现这些矩具有复杂的离群值模式,当前的逐块量化无法准确近似。我们采用更小的块大小,并提出同时利用行方向和列方向的信息以实现更好的量化。我们进一步识别出量化二阶矩时的零点问题,并通过一种排除零点的线性量化器来解决该问题。我们的4位优化器在自然语言理解、机器翻译、图像分类和指令微调等多种基准上进行了评估。在所有任务上,我们的优化器都能达到与全精度对应方法相当的准确率,同时具有更好的内存效率。

英文摘要:

Optimizer states are a major source of memory consumption for training neural networks, limiting the maximum trainable model within given memory budget. Compressing the optimizer states from 32-bit floating points to lower bitwidth is promising to reduce the training memory footprint, while the current lowest achievable bitwidth is 8-bit. In this work, we push optimizer states bitwidth down to 4-bit through a detailed empirical analysis of first and second moments. Specifically, we find that moments have complicated outlier patterns, that current block-wise quantization cannot accurately approximate. We use a smaller block size and propose to utilize both row-wise and column-wise information for better quantization. We further identify a zero point problem of quantizing the second moment, and solve this problem with a linear quantizer that excludes the zero point. Our 4-bit optimizers are evaluated on a wide variety of benchmarks including natural language understanding, machine translation, image classification, and instruction tuning. On all the tasks our optimizers can achieve comparable accuracy with their full-precision counterparts, while enjoying better memory efficiency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑