Downloads · 30 days
11
1% of all-time downloads
JongYeop/Llama-3.1-8B-Instruct-MXFP4-W4A4
Llama-3.1-8B-Instruct-MXFP4-W4A4 is a text generation model from JongYeop. 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.1.
This is an MXFP4 (Microscaling FP4) quantized version of meta-llama/Llama-3.1-8B-Instruct using the compressed-tensors quantization method.
Downloads · 30 days
11
1% of all-time downloads
All-time downloads
872
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
This is an MXFP4 (Microscaling FP4) quantized version of meta-llama/Llama-3.1-8B-Instruct using the compressed-tensors quantization method.
This model uses MXFP4 (Microscaling FP4) quantization with block-scaled quantization (group size 32) for both weights and activations. MXFP4 uses E8M0 (8-bit exponent-only) block scales shared across groups of 32 elements, following the OCP MX specification.
MXFP4 inference requires NVIDIA Blackwell (SM120+) GPUs with CUDA 12.8+ for native CUTLASS MXFP4 GEMM support.
from vllm import LLM, SamplingParams
model_id = "JongYeop/Llama-3.1-8B-Instruct-MXFP4-W4A4"
llm = LLM(model=model_id, max_model_len=4096, enforce_eager=True)
outputs = llm.generate(
["The capital of France is"],
SamplingParams(max_tokens=64, temperature=0)
)
for output in outputs:
print(output.outputs[0].text)
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "JongYeop/Llama-3.1-8B-Instruct-MXFP4-W4A4"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto"
)
messages = [
{"role": "user", "content": "What is machine learning?"}
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(
input_ids,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
print(response)
| Feature | MXFP4 | NVFP4 |
|---|---|---|
| Scale Format | E8M0 (uint8 exponent) | E4M3 + FP32 global scale |
| Group Size | 32 | 16 |
| Standard | OCP MX Specification | NVIDIA proprietary |
| Hardware | SM120+ (Blackwell) | SM89+ (Ada/Hopper/Blackwell) |
This quantized model is intended for efficient inference with significantly reduced memory footprint. It is suitable for:
Same as the base model: Llama 3.1 Community License