← Open Source
spcl

QuaRot

Code for Neurips24 paper: QuaRot, an end-to-end 4-bit inference of large language models.

InfrastructureKernelsModel optimizationPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
534
Stars
79
Forks
+0
This week
3
Contributors
Created 2024-03-31 · Updated 2026-10-14 · #17549 today
Top developers
sashkboosmkrima

spcl/QuaRot is ranked 17,549 with 534 stars.

Same-category comparison

spcl/QuaRot is ranked 17,549 among these 8 peers; microsoft/sarathi-serve is ranked 17,547.

Same-category comparison
NameRankMetrics
FMInference/H2O17,505
Language:
Python
Stars:
535
Forks:
90
Description:
[NeurIPS'23] H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models.
schlarpc/re-shell17,528
Language:
Nix
Stars:
535
Forks:
36
Description:
Nix-powered agentic reverse engineering environment.
kubedl-io/kubedl17,546
Language:
Go
Stars:
534
Forks:
80
Description:
Run your deep learning workloads on Kubernetes more easily and efficiently.
microsoft/sarathi-serve17,547
Language:
Python
Stars:
534
Forks:
68
Description:
A low-latency & high-throughput serving engine for LLMs.
polyaxon/traceml17,573
Language:
Python
Stars:
533
Forks:
46
Description:
Engine for AI/ML/Data tracking, visualization, explainability, drift detection, and dashboards for Polyaxon.
bytemate/chatapi-single17,587
Language:
TypeScript
Stars:
532
Forks:
69
Description:
Simple and powerful ChatGPT-API-Server.
LSH9832/edgeyolo17,602
Language:
Python
Stars:
531
Forks:
72
Description:
an edge-real-time anchor-free object detector with decent performance.
NVIDIA-AI-IOT/nanoowl17,603
Language:
Python
Stars:
531
Forks:
82
Description:
A project that optimizes OWL-ViT for real-time inference with NVIDIA TensorRT.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryInfrastructure
SubcategoryKernels, Model optimization
KeywordsCUDA programming, Inference optimization, Memory management
Stars534
Forks79
Contributors3
Created date2024-03-31
Updated date2026-10-14
Stars in 1 day0
Stars in 7 days0
Rank17,549
Previous rank19,076
Rank change1,527
7-day stars rank16,166
Previous 7-day stars rank16,173
7-day stars rank change7
Total stars rank18,394
Previous total stars rank18,371
Total stars rank change-23
CountrySwitzerland
README summary

QuaRot: 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 **Qua**ntization scheme based on **Rot**ations, 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. Usage Compile the QuaRot

kernels using the following commands: For simulation results, check fake_quant directory. Star History Citation The full citation is

Frequently asked questions

How many stars and forks are recorded?

spcl/QuaRot has 534 stars and 79 forks.

What is the repository rank?

spcl/QuaRot is ranked 17,549.

What language and category are recorded?

spcl/QuaRot has 534 stars, uses Python and belongs to Infrastructure.

Which repository is closest in rank?

spcl/QuaRot is compared with microsoft/sarathi-serve, ranked 17,547 with 534 stars.

README

QuaRot: 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.

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}
}
Nearby in the ranking
Similar items