Downloads · 30 days
21
9% of all-time downloads
JongYeop/Llama-3.1-70B-Instruct-NVFP4-W4A4
Llama-3.1-70B-Instruct-NVFP4-W4A4 is a machine learning model from JongYeop. 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.
This is an NVFP4 (4-bit floating point) quantized version of meta-llama/Llama-3.1-70B-Instruct created using llm-compressor.
Downloads · 30 days
21
9% of all-time downloads
All-time downloads
245
Public
Parameters
40.6B
42.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors42.7 GB · 100%
How the weights are stored.
U834.2B · 84%
From the Hugging Face model README
This is an NVFP4 (4-bit floating point) quantized version of meta-llama/Llama-3.1-70B-Instruct created using llm-compressor.
Note: This model quantizes Weights and Activations to FP4. KV cache is NOT quantized and remains in bf16 (original precision).
lm_head onlypip install vllm>=0.6.0
from vllm import LLM, SamplingParams
# Load the NVFP4 W4A4 quantized model
llm = LLM(
model="JongYeop/Llama-3.1-70B-Instruct-NVFP4-W4A4",
quantization="fp4" # or "nvfp4"
)
# Generate text
prompts = ["Hello, my name is"]
sampling_params = SamplingParams(temperature=0.7, top_p=0.9, max_tokens=100)
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
print(output.outputs[0].text)
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("JongYeop/Llama-3.1-70B-Instruct-NVFP4-W4A4")
model = AutoModelForCausalLM.from_pretrained(
"JongYeop/Llama-3.1-70B-Instruct-NVFP4-W4A4",
device_map="auto"
)
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
]
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
output = model.generate(input_ids, max_new_tokens=100)
print(tokenizer.decode(output[0], skip_special_tokens=True))
NVFP4 W4A4 quantization provides:
NVFP4 (NVIDIA FP4) is a 4-bit floating-point format that provides:
KV Cache remains in bf16 because:
The quantization recipe used for this model is included in the repository as recipe.yaml.
Key configuration:
quant_stage:
quant_modifiers:
QuantizationModifier:
ignore: ["lm_head"]
scheme: "NVFP4" # NVIDIA FP4 format
targets: ["Linear"]
| Format | Model Size | Compression | KV Cache | Notes |
|---|---|---|---|---|
| BF16 (Original) | ~140GB | 1.0x | bf16 | Full precision |
| FP8 W8A8 | ~70GB | 2.0x | bf16 | Good balance |
| NVFP4 W4A4 | ~40GB | 3.5x | bf16 | Higher compression |
| FP8 W8A8+KV | ~65GB | 2.2x | fp8 | Full quantization |
If you use this model, please cite:
@software{llm-compressor,
title = {LLM Compressor},
author = {vLLM Team},
url = {https://github.com/vllm-project/llm-compressor},
year = {2024}
}
@article{llama3,
title={Llama 3 Model Card},
author={AI@Meta},
year={2024},
url={https://github.com/meta-llama/llama3}
}
This model inherits the license from the original Llama 3.1 model.