Downloads · 30 days
9
1% of all-time downloads
xmadai/Llama-3.2-3B-Instruct-xMADai-INT4
Llama-3.2-3B-Instruct-xMADai-INT4 is a text generation model from xmadai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.2.
This repository contains meta-llama/Llama-3.2-3B-Instruct quantized from 16-bit floats to 4-bit integers, using xMAD.ai proprietary technology.
Downloads · 30 days
9
1% of all-time downloads
All-time downloads
710
Public
Repo size
9 GB
Likes
6
Public
Click a slice to open those files.
.safetensors6 GB · 100%
From the Hugging Face model README
This repository contains meta-llama/Llama-3.2-3B-Instruct quantized from 16-bit floats to 4-bit integers, using xMAD.ai proprietary technology.
Accuracy: This xMADified model is the best quantized version of the meta-llama/Llama-3.2-3B-Instruct model. We are on par with the original (fp16) model (see Table 1 below).
Memory-efficiency: This xMADified model (3 GB) is >50% less memory than the full-precision model (6.5 GB). You can run this on any laptop GPU.
Fine-tuning: These models are fine-tunable over the same reduced (3 GB) hardware in mere 3-clicks. Watch our product demo here
| 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 |
Loading the model checkpoint of this xMADified model requires less than 3 GiB of VRAM. Hence it can be efficiently run on most laptop GPUs.
Package prerequisites: Run the following commands to install the required packages.
pip 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
pip install transformers accelerate optimum
pip install -vvv --no-build-isolation "git+https://github.com/PanQiWei/[email protected]"
Sample Inference Code
from transformers import AutoTokenizer
from auto_gptq import AutoGPTQForCausalLM
model_id = "xmadai/Llama-3.2-3B-Instruct-xMADai-INT4"
prompt = [
{"role": "system", "content": "You are a helpful assistant, that responds as a pirate."},
{"role": "user", "content": "What's Deep Learning?"},
]
tokenizer = AutoTokenizer.from_pretrained(model_id)
inputs = tokenizer.apply_chat_template(
prompt,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
).to("cuda")
model = AutoGPTQForCausalLM.from_quantized(
model_id,
device_map='auto',
trust_remote_code=True,
)
outputs = model.generate(**inputs, do_sample=True, max_new_tokens=256)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
For additional xMADified models, access to fine-tuning, and general questions, please contact us at [email protected] and join our waiting list.