Views
No views yet
meta-llama/Llama-3.2-3B-Instruct quantized from 16-bit floats to 4-bit integers, using xMAD.ai proprietary technology.meta-llama/Llama-3.2-3B-Instruct model. We are on par with the original (fp16) model (see Table 1 below).| MMLU | Arc Challenge | Arc Easy | LAMBADA Standard | LAMBADA OpenAI | PIQA | Winogrande | HellaSwag | |
|---|---|---|---|---|---|---|---|---|
| xmadai/Llama-3.2-3B-Instruct-xMADai-INT4 | 58.60 | 39.93 | 72.10 | 53.77 | 62.49 | 74.27 | 63.69 | 51.28 |
| meta-llama/Llama-3.2-3B-Instruct | 60.48 | 43.69 | 74.24 | 57.75 | 66.54 | 75.73 | 67.40 | 52.20 |
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.2-3B-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)
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=256)
22print(tokenizer.batch_decode(outputs, skip_special_tokens=True))