Views
No views yet
meta-llama/Llama-3.1-405B-Instruct quantized from 16-bit floats to 4-bit integers, using xMAD.ai proprietary technology.meta-llama/Llama-3.1-405B-Instruct model (200 GB only). See Table 1 below for model quality benchmarks.| Model | MMLU STEM | MMLU Humanities | MMLU Social Sciences | MMLU Other | LAMBADA Standard | LAMBADA OpenAI | WinoGrande | PIQA |
|---|---|---|---|---|---|---|---|---|
| xmadai/Llama-3.1-405B-Instruct-xMADai-INT4 (this model) | 82.68 | 83.21 | 90.58 | 87.71 | 74.71 | 77.55 | 82.32 | 83.35 |
| hugging-quants/Meta-Llama-3.1-405B-Instruct-GPTQ-INT4 | 82.34 | 82.64 | 90.45 | 87.51 | 73.41 | 76.96 | 81.77 | 82.75 |
1pip install torch==2.4.0 # Run following if you have CUDA version 11.8: pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu118
2pip install transformers accelerate optimum
3pip install -vvv --no-build-isolation "git+https://github.com/PanQiWei/AutoGPTQ.git@v0.7.1"1from transformers import AutoTokenizer
2from auto_gptq import AutoGPTQForCausalLM
3model_id = "xmadai/Llama-3.1-405B-Instruct-xMADai-INT4"
4prompt = [
5 {"role": "system", "content": "You are a helpful assistant, that responds as a pirate."},
6 {"role": "user", "content": "What's Deep Learning?"},
7]
8tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
9inputs = tokenizer.apply_chat_template(
10 prompt,
11 tokenize=True,
12 add_generation_prompt=True,
13 return_tensors="pt",
14 return_dict=True,
15).to("cuda")
16model = AutoGPTQForCausalLM.from_quantized(
17 model_id,
18 device_map='auto',
19 trust_remote_code=True,
20)
21outputs = model.generate(**inputs, do_sample=True, max_new_tokens=1024)
22print(tokenizer.batch_decode(outputs, skip_special_tokens=True))@article{zhang2024leanquant,
title={LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid},
author={Zhang, Tianyi and Shrivastava, Anshumali},
journal={arXiv preprint arXiv:2407.10032},
year={2024},
url={https://arxiv.org/abs/2407.10032},
}