ChenMnZ/Llama-3-70b-EfficientQAT-w4g128-GPTQ

Model

EfficientQAT

0

2 commits

4 linked in READMEs

updated Jul 22, 2024

See the code

README

EfficientQAT

EfficientQAT is a novel quantization technical, which pushes the limitation of uniform (INT) quantization in an efficient manner. Due to the leverage of standard INT quantization, the quantized model of EfficientQAT can also be transferred into other formats, such as GPTQ, BitBLAS, etc.

In this repo, we provide three type checkpoints, one is EQAT, indicats the original checkpoints of EfficientQAT. The other two are GPTQ and BitBLAS respectively.

Model Zoo

We provide a number of prequantized EfficientQAT models as follows:

  • WikiText2 PPL is measured in 2048 context length.
  • Avg. Accuracy indicate the average accuracy in 5 zero-shot reasoning tasks (WinoGrande,PIQA,HellaSwag,Arc-Easy, Arc-Challenge) with lm-eval v0.4.2.
  • 1GB = $10^9$ Bit
  • Hub Link: EQAT indicates the original checkpoints. We also transfer the checkpoints into GPTQ and BitBLAS formats, which can be loaded directly through GPTQModel. (PS: GPTQModel is a official bug-fixed repo of AutoGPTQ, which would be merged into AutoGPTQ in future.)
ModelQuantizationWikiText2 PPLAvg. AccuracyModel Size (GB)Hub link
Llama-2-7Bfp165.4764.8613.2-
Llama-2-7Bw4g1285.5364.273.7EQAT|GPTQ|BitBLAS
Llama-2-7Bw3g1285.8164.023.1EQAT
Llama-2-7Bw2g646.8660.142.3EQAT|GPTQ|BitBLAS
Llama-2-7Bw2g1287.1759.502.2EQAT|GPTQ|BitBLAS
Llama-2-13Bfp164.8867.8125.4-
Llama-2-13Bw4g1284.9367.526.8EQAT|GPTQ|BitBLAS
Llama-2-13Bw3g1285.1267.285.6EQAT
Llama-2-13Bw2g645.9664.884.0EQAT|GPTQ|BitBLAS
Llama-2-13Bw2g1286.0863.883.8EQAT|GPTQ|BitBLAS
Llama-2-70Bfp163.3272.41131.6-
Llama-2-70Bw4g1283.3972.6235.8EQAT|GPTQ|BitBLAS
Llama-2-70Bw3g1283.6171.7629.1EQAT
Llama-2-70Bw2g644.5269.4820.1EQAT|GPTQ|BitBLAS
Llama-2-70Bw2g1284.6168.9318.9EQAT|GPTQ|BitBLAS
Llama-3-8Bfp166.1468.5813.0-
Llama-3-8Bw4g1286.4768.435.4EQAT|GPTQ|BitBLAS
Llama-3-8Bw3g1287.0967.354.7EQAT
Llama-3-8Bw2g649.4160.763.9EQAT|GPTQ|BitBLAS
Llama-3-8Bw2g1289.8059.363.8EQAT|GPTQ|BitBLAS
Llama-3-70Bfp162.8575.33137.8-
Llama-3-70Bw4g1283.1774.5738.9EQAT|GPTQ|BitBLAS
Llama-3-70Bw3g1284.1972.4232.2EQAT
Llama-3-70Bw2g646.0867.8923.2EQAT|GPTQ
Llama-3-70Bw2g1286.3867.5722.0EQAT|GPTQ|BitBLAS
Llama-3-8B-Instructfp168.2968.4313.0-
Llama-3-8B-Instructw4g1287.9368.395.4EQAT|GPTQ|BitBLAS
Llama-3-8B-Instructw3g1288.5567.244.7EQAT
Llama-3-8B-Instructw2g6411.1960.663.9EQAT|GPTQ|BitBLAS
Llama-3-8B-Instructw2g12811.7360.163.8EQAT|GPTQ|BitBLAS
Llama-3-70B-Instructfp165.3373.78137.8-
Llama-3-70B-Instructw4g1285.3573.4738.9EQAT|GPTQ|BitBLAS
Llama-3-70B-Instructw3g1285.6572.8732.2EQAT
Llama-3-70B-Instructw2g647.8667.6423.2EQAT|GPTQ|BitBLAS
Llama-3-70B-Instructw2g1288.1467.5422.0EQAT|GPTQ|BitBLAS

Usage of EQAT models

Please refer https://github.com/OpenGVLab/EfficientQAT for details.

Usage of GPTQ and BitBLAS models

Below is an example to inference with GPTQ or BitBLAS quantized formats.

from transformers import AutoTokenizer
from gptqmodel import GPTQModel

quant_dir = "ChenMnZ/Llama-2-7b-EfficientQAT-w2g128-GPTQ"
# quant_dir = "ChenMnZ/Llama-2-7b-EfficientQAT-w2g128-BitBLAS"
# or local path

tokenizer = AutoTokenizer.from_pretrained(quant_dir, use_fast=True)


# load quantized model to the first GPU
model = GPTQModel.from_quantized(quant_dir)

# inference with model.generate
print(tokenizer.decode(model.generate(**tokenizer("Model quantization is", return_tensors="pt").to(model.device))[0]))

Citation

If you found this work useful, please consider citing:

@article{efficientqat,
  title={EfficientQAT: Efficient Quantization-Aware Training for Large Language Models},
  author={Chen, Mengzhao and Shao, Wenqi and Xu, Peng and Wang, Jiahao and Gao, Peng and Zhang, Kaipeng and Qiao, Yu and Luo, Ping},
  journal={arXiv preprint arXiv:2407.11062},
  year={2024}
}
4-bit
endpoints_compatible
gptq
llama
safetensors
text-generation
text-generation-inference
transformers

ChenMnZ/Llama-3-70b-EfficientQAT-w4g128-GPTQ

Model

EfficientQAT

0

2 commits

4 linked in READMEs

updated Jul 22, 2024

See the code

README

EfficientQAT

EfficientQAT is a novel quantization technical, which pushes the limitation of uniform (INT) quantization in an efficient manner. Due to the leverage of standard INT quantization, the quantized model of EfficientQAT can also be transferred into other formats, such as GPTQ, BitBLAS, etc.

In this repo, we provide three type checkpoints, one is EQAT, indicats the original checkpoints of EfficientQAT. The other two are GPTQ and BitBLAS respectively.

Model Zoo

We provide a number of prequantized EfficientQAT models as follows:

  • WikiText2 PPL is measured in 2048 context length.
  • Avg. Accuracy indicate the average accuracy in 5 zero-shot reasoning tasks (WinoGrande,PIQA,HellaSwag,Arc-Easy, Arc-Challenge) with lm-eval v0.4.2.
  • 1GB = $10^9$ Bit
  • Hub Link: EQAT indicates the original checkpoints. We also transfer the checkpoints into GPTQ and BitBLAS formats, which can be loaded directly through GPTQModel. (PS: GPTQModel is a official bug-fixed repo of AutoGPTQ, which would be merged into AutoGPTQ in future.)
ModelQuantizationWikiText2 PPLAvg. AccuracyModel Size (GB)Hub link
Llama-2-7Bfp165.4764.8613.2-
Llama-2-7Bw4g1285.5364.273.7EQAT|GPTQ|BitBLAS
Llama-2-7Bw3g1285.8164.023.1EQAT
Llama-2-7Bw2g646.8660.142.3EQAT|GPTQ|BitBLAS
Llama-2-7Bw2g1287.1759.502.2EQAT|GPTQ|BitBLAS
Llama-2-13Bfp164.8867.8125.4-
Llama-2-13Bw4g1284.9367.526.8EQAT|GPTQ|BitBLAS
Llama-2-13Bw3g1285.1267.285.6EQAT
Llama-2-13Bw2g645.9664.884.0EQAT|GPTQ|BitBLAS
Llama-2-13Bw2g1286.0863.883.8EQAT|GPTQ|BitBLAS
Llama-2-70Bfp163.3272.41131.6-
Llama-2-70Bw4g1283.3972.6235.8EQAT|GPTQ|BitBLAS
Llama-2-70Bw3g1283.6171.7629.1EQAT
Llama-2-70Bw2g644.5269.4820.1EQAT|GPTQ|BitBLAS
Llama-2-70Bw2g1284.6168.9318.9EQAT|GPTQ|BitBLAS
Llama-3-8Bfp166.1468.5813.0-
Llama-3-8Bw4g1286.4768.435.4EQAT|GPTQ|BitBLAS
Llama-3-8Bw3g1287.0967.354.7EQAT
Llama-3-8Bw2g649.4160.763.9EQAT|GPTQ|BitBLAS
Llama-3-8Bw2g1289.8059.363.8EQAT|GPTQ|BitBLAS
Llama-3-70Bfp162.8575.33137.8-
Llama-3-70Bw4g1283.1774.5738.9EQAT|GPTQ|BitBLAS
Llama-3-70Bw3g1284.1972.4232.2EQAT
Llama-3-70Bw2g646.0867.8923.2EQAT|GPTQ
Llama-3-70Bw2g1286.3867.5722.0EQAT|GPTQ|BitBLAS
Llama-3-8B-Instructfp168.2968.4313.0-
Llama-3-8B-Instructw4g1287.9368.395.4EQAT|GPTQ|BitBLAS
Llama-3-8B-Instructw3g1288.5567.244.7EQAT
Llama-3-8B-Instructw2g6411.1960.663.9EQAT|GPTQ|BitBLAS
Llama-3-8B-Instructw2g12811.7360.163.8EQAT|GPTQ|BitBLAS
Llama-3-70B-Instructfp165.3373.78137.8-
Llama-3-70B-Instructw4g1285.3573.4738.9EQAT|GPTQ|BitBLAS
Llama-3-70B-Instructw3g1285.6572.8732.2EQAT
Llama-3-70B-Instructw2g647.8667.6423.2EQAT|GPTQ|BitBLAS
Llama-3-70B-Instructw2g1288.1467.5422.0EQAT|GPTQ|BitBLAS

Usage of EQAT models

Please refer https://github.com/OpenGVLab/EfficientQAT for details.

Usage of GPTQ and BitBLAS models

Below is an example to inference with GPTQ or BitBLAS quantized formats.

from transformers import AutoTokenizer
from gptqmodel import GPTQModel

quant_dir = "ChenMnZ/Llama-2-7b-EfficientQAT-w2g128-GPTQ"
# quant_dir = "ChenMnZ/Llama-2-7b-EfficientQAT-w2g128-BitBLAS"
# or local path

tokenizer = AutoTokenizer.from_pretrained(quant_dir, use_fast=True)


# load quantized model to the first GPU
model = GPTQModel.from_quantized(quant_dir)

# inference with model.generate
print(tokenizer.decode(model.generate(**tokenizer("Model quantization is", return_tensors="pt").to(model.device))[0]))

Citation

If you found this work useful, please consider citing:

@article{efficientqat,
  title={EfficientQAT: Efficient Quantization-Aware Training for Large Language Models},
  author={Chen, Mengzhao and Shao, Wenqi and Xu, Peng and Wang, Jiahao and Gao, Peng and Zhang, Kaipeng and Qiao, Yu and Luo, Ping},
  journal={arXiv preprint arXiv:2407.11062},
  year={2024}
}
4-bit
endpoints_compatible
gptq
llama
safetensors
text-generation
text-generation-inference
transformers