Downloads · 30 days
400
8% of all-time downloads
amd/Llama-3.1-8B-Instruct-MXFP4-W4A4-MLCAL-C1000-GPTQ
Llama-3.1-8B-Instruct-MXFP4-W4A4-MLCAL-C1000-GPTQ is a machine learning model from amd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as llama3.1.
--- basemodel: meta-llama/Llama-3.1-8B-Instruct license: llama3.1 tags: [amd, quark, mxfp4, w4a4, gptq, smoothquant, vllm] pipelinetag: text-generation ---
Downloads · 30 days
400
8% of all-time downloads
All-time downloads
5.2K
Public
Parameters
4.8B
5.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.8 GB · 100%
How the weights are stored.
U83.7B · 78%
From the Hugging Face model README
MXFP4 (W4A4) quantization of meta-llama/Llama-3.1-8B-Instruct, produced with
AMD Quark for serving under vLLM (ROCm).
min_kv_scale = 1.0)pip install amd-quark==0.11.2 datasets accelerate evaluate nltk rouge-score lm-eval
cd Quark/examples/torch/language_modeling/llm_ptq/
python3 quantize_quark.py \
--model_dir meta-llama/Llama-3.1-8B-Instruct \
--model_attn_implementation sdpa \
--quant_scheme mxfp4 \
--quant_algo smoothquant,gptq \
--quant_algo_config_file smoothquant smoothquant_a0.62.json \
--dataset mlperf_cnn \
--num_calib_data 1000 \
--seq_len 2048 \
--kv_cache_dtype fp8 --min_kv_scale 1.0 \
--model_export hf_format \
--export_weight_format real_quantized \
--skip_evaluation \
--output_dir Llama-3.1-8B-Instruct-MXFP4-W4A4-MLCAL-C1000-GPTQ
smoothquant_a0.62.json:
{
"name": "smooth",
"alpha": 0.62,
"scale_clamp_min": 1e-3,
"scaling_layers": [
{"prev_op": "input_layernorm", "layers": ["self_attn.q_proj", "self_attn.k_proj", "self_attn.v_proj"], "inp": "self_attn.q_proj", "module2inspect": "self_attn"},
{"prev_op": "self_attn.v_proj", "layers": ["self_attn.o_proj"], "inp": "self_attn.o_proj"},
{"prev_op": "post_attention_layernorm", "layers": ["mlp.gate_proj", "mlp.up_proj"], "inp": "mlp.gate_proj", "module2inspect": "mlp"},
{"prev_op": "mlp.up_proj", "layers": ["mlp.down_proj"], "inp": "mlp.down_proj"}
],
"model_decoder_layers": "model.layers"
}
Quark ≥0.11 writes scale tensors as *.weight_quantizer.scale; rename to vLLM
keys (*.weight_scale, *.input_scale, *.output_scale) before serving.
| Metric | Score | Golden | % of golden |
|---|---|---|---|
| ROUGE-1 | 38.4415 | 38.7792 | 99.13% |
| ROUGE-2 | 15.9650 | 15.9075 | 100.36% |
| ROUGE-L | 24.3622 | 24.4957 | 99.46% |
| ROUGE-Lsum | 35.5998 | 35.7930 | 99.46% |