Downloads · 30 days
158
1% of all-time downloads
RedHatAI/Llama-3.3-70B-Instruct-FP8-block
Llama-3.3-70B-Instruct-FP8-block is a text generation model from RedHatAI. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
- Model Architecture: LlamaForCausalLM - Input: Text - Output: Text - Model Optimizations: - Weight quantization: FP8 - Activation quantization: FP8 - Release Date: - Version: 1.0 - Model Developers:: Red Hat
Downloads · 30 days
158
1% of all-time downloads
All-time downloads
26.6K
Public
Parameters
70.6B
72.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors72.7 GB · 100%
How the weights are stored.
F8_E4M368.5B · 97%
From the Hugging Face model README
Quantized version of meta-llama/Llama-3.3-70B-Instruct.
This model was obtained by quantizing the weights and activations of meta-llama/Llama-3.3-70B-Instruct to FP8 data type. This optimization reduces the number of bits per parameter from 16 to 8, reducing the disk size and GPU memory requirements by approximately 50%. Only the weights and activations of the linear operators within transformers blocks of the language model are quantized.
vllm serve nm-testing/Llama-3.3-70B-Instruct-FP8-block --tensor_parallel_size 4
from openai import OpenAI
# Modify OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://<your-server-host>:8000/v1"
client = OpenAI(
api_key=openai_api_key,
base_url=openai_api_base,
)
model = "nm-testing/Llama-3.3-70B-Instruct-FP8-block"
messages = [
{"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
]
outputs = client.chat.completions.create(
model=model,
messages=messages,
)
generated_text = outputs.choices[0].message.content
print(generated_text)
This model was quantized using the llm-compressor library as shown below.
<details> <summary>Creation details</summary>from transformers import AutoProcessor, LlamaForCausalLM
from llmcompressor import oneshot
from llmcompressor.modeling import replace_modules_for_calibration
from llmcompressor.modifiers.quantization import QuantizationModifier
MODEL_ID = "meta-llama/Llama-3.3-70B-Instruct"
# Load model.
model = LlamaForCausalLM.from_pretrained(MODEL_ID, dtype="auto")
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = replace_modules_for_calibration(model)
# Configure the quantization algorithm and scheme.
# In this case, we:
# * quantize the weights to fp8 with per-block quantization
# * quantize the activations to fp8 with dynamic token activations
recipe = QuantizationModifier(
targets="Linear",
scheme="FP8_BLOCK",
ignore=["lm_head"],
)
# Apply quantization.
oneshot(model=model, recipe=recipe)
# Save to disk in compressed-tensors format.
SAVE_DIR = MODEL_ID.rstrip("/").split("/")[-1] + "-FP8-block"
model.save_pretrained(SAVE_DIR)
processor.save_pretrained(SAVE_DIR)
</details>
The model was evaluated on the OpenLLMv1 leaderboard task, using lm-evaluation-harness, on reasoning tasks using lighteval. vLLM was used for all evaluations.
<details> <summary>Evaluation details</summary>Openllm V1
lm_eval \
--model vllm \
--model_args pretrained="nm-testing/Llama-3.3-70B-Instruct-FP8-block",dtype=auto,add_bos_token=True,max_model_len=16384,tensor_parallel_size=4,gpu_memory_utilization=0.9,enable_chunked_prefill=True,trust_remote_code=True \
--tasks openllm \
--write_out \
--batch_size auto \
--show_config
Openllm V2
lm_eval \
--model vllm \
--model_args pretrained="nm-testing/Llama-3.3-70B-Instruct-FP8-block",dtype=auto,add_bos_token=False,max_model_len=16384,tensor_parallel_size=4,gpu_memory_utilization=0.7,disable_log_stats=True,enable_chunked_prefill=True,trust_remote_code=True \
--tasks leaderboard \
--apply_chat_template \
--fewshot_as_multiturn \
--write_out \
--batch_size auto \
--show_config
Coding Benchmarks
evalplus.evaluate --model "nm-testing/Llama-3.3-70B-Instruct-FP8-block" \
--dataset "humaneval" \
--backend vllm \
--tp 4 \
--greedy
evalplus.evaluate --model "nm-testing/Llama-3.3-70B-Instruct-FP8-block" \
--dataset "mbpp" \
--backend vllm \
--tp 4 \
--greedy
</details>