Skip to content
プロジェクト

概要

Neurips24論文「QuaRot: 大規模言語モデルのエンドツーエンド4ビット推論」のコード。

AI・機械学習

この数値の測り方

計測したスター増加

24時間
+1
7日間
+2
15日間
+4
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Your ImageQuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs

This repository contains the code for QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs.

Abstract

We introduce QuaRot, a new Quantization scheme based on Rotations, which is able to quantize LLMs end-to-end, including all weights, activations, and KV cache in 4 bits. QuaRot rotates LLMs in a way that removes outliers from the hidden state without changing the output, making quantization easier. This computational invariance is applied to the hidden state (residual) of the LLM, as well as to the activations of the feed-forward components, aspects of the attention mechanism and to the KV cache. The result is a quantized model where all matrix multiplications are performed in 4-bits, without any channels identified for retention in higher precision. Our quantized LLaMa2-70B model has losses of at most 0.29 WikiText perplexity and retains 99% of the zero-shot performance.

Your Image

Usage

Compile the QuaRot kernels using the following commands:

git clone https://github.com/spcl/QuaRot.git
cd QuaRot
pip install -e .  # or pip install .

For simulation results, check fake_quant directory.

Star History

Citation

The full citation is

@article{ashkboos2024quarot,
  title={QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs},
  author={Ashkboos, Saleh and Mohtashami, Amirkeivan and Croci, Maximilian L and Li, Bo and Jaggi, Martin and Alistarh, Dan and Hoefler, Torsten and Hensman, James},
  journal={arXiv preprint arXiv:2404.00456},
  year={2024}
}

関連プロジェクトを探す

読み込み中…