Downloads · 30 days
18
22% of all-time downloads
barryke/granite-4.1-8b-FP8-DYNAMIC
granite-4.1-8b-FP8-DYNAMIC is a text generation model from barryke. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is an FP8 dynamic quantized version of ibm-granite/granite-4.1-8b, IBM Granite's 8B-parameter long-context instruct model. Granite-4.1-8B was finetuned from Granite-4.1-8B-Base with supervised fine-tuning and rei…
Downloads · 30 days
18
22% of all-time downloads
All-time downloads
81
Public
Parameters
8.8B
9.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors9.6 GB · 100%
How the weights are stored.
F8_E4M38B · 91%
From the Hugging Face model README
This is an FP8 dynamic quantized version of ibm-granite/granite-4.1-8b, IBM Granite's 8B-parameter long-context instruct model. Granite-4.1-8B was finetuned from Granite-4.1-8B-Base with supervised fine-tuning and reinforcement-learning alignment for strong tool-calling, instruction-following, and chat — with a native 128K context window.
Quantization was performed using LLM Compressor v0.11.0 via a post-training one-shot method (no calibration data required). The checkpoint is saved in the compressed-tensors format, natively supported by vLLM and transformers.
| Property | Value |
|---|---|
| Base model | ibm-granite/granite-4.1-8b |
| Quantization method | compressed-tensors (via LLM Compressor oneshot) |
| Scheme | FP8_DYNAMIC |
| Weight quantization | FP8 (float-quantized), per-channel, symmetric |
| Activation quantization | FP8 (float-quantized), per-token, dynamic |
| Targets | All Linear layers |
| Ignored layers | lm_head (kept in original precision; tied to embed_tokens) |
| LLM Compressor version | 0.11.0 |
| compressed-tensors version | 0.16.0 |
| Calibration data | None required (dynamic activations) |
| Total size on disk | ~9 GB (down from ~18 GB original BF16, ~50% reduction) |
default_stage:
default_modifiers:
QuantizationModifier:
targets: [Linear]
ignore: [lm_head]
scheme: FP8_DYNAMIC
bypass_divisibility_checks: false
from llmcompressor import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-4.1-8b", dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("ibm-granite/granite-4.1-8b")
recipe = QuantizationModifier(targets="Linear", scheme="FP8_DYNAMIC", ignore=["lm_head"])
oneshot(model=model, recipe=recipe)
model.save_pretrained("./granite-4.1-8b-FP8-DYNAMIC")
tokenizer.save_pretrained("./granite-4.1-8b-FP8-DYNAMIC")
Granite-4.1-8B is a decoder-only dense transformer with GQA, RoPE, SwiGLU MLP, RMSNorm, and tied input/output embeddings. It also uses Granite's scaled-multiplier scheme (attention_multiplier, embedding_multiplier, logits_scaling, residual_multiplier) baked into the forward pass — these are preserved verbatim by quantization.
| Hyperparameter | Value |
|---|---|
| Architecture | GraniteForCausalLM |
| Model type | granite |
| Total parameters | ~8B (counted as ~9B on the HF card, including tied embeddings) |
| Layers | 40 |
| Hidden size | 4096 |
| MLP intermediate size | 12800 |
| Attention heads | 32 |
| KV heads (GQA) | 8 |
| Head dimension | 128 |
| Vocabulary size | 100,352 |
| Max position embeddings | 131,072 (128K native context) |
| Activation | SwiGLU (silu) |
| RoPE theta | 10,000,000 |
| RMS norm epsilon | 1e-5 |
| Attention multiplier | 0.0078125 |
| Embedding multiplier | 12.0 |
| Logits scaling | 16.0 |
| Residual multiplier | 0.22 |
| Tied embeddings | Yes (lm_head.weight = model.embed_tokens.weight) |
| Original dtype | bfloat16 |
Unlike RoPE-scaled models, Granite-4.1-8B natively supports 131,072-token contexts out of the box — no YaRN factor or max_position_embeddings edits required. Just make sure your serving stack (vLLM ≥ 0.6, transformers ≥ 4.45) allocates enough KV-cache memory.
This quantized model preserves the capabilities of the original granite-4.1-8b:
<tool_call>...</tool_call> JSON for OpenAI-style tool schemas (see below).| Benchmark | Setting | Score |
|---|---|---|
| MMLU | 5-shot | 73.84 |
| MMLU-Pro | 5-shot, CoT | 55.99 |
| BBH | 3-shot, CoT | 80.51 |
| GPQA | 0-shot, CoT | 41.96 |
| IFEval Avg | — | 87.06 |
| GSM8K | 8-shot | 92.49 |
| HumanEval | pass@1 | 85.37 |
| MBPP | pass@1 | 87.30 |
| BFCL v3 | — | 68.27 |
pip install vllm
vllm serve barryke/granite-4.1-8b-FP8-DYNAMIC
With tool-calling support (Granite's native tool parser):
vllm serve barryke/granite-4.1-8b-FP8-DYNAMIC \
--enable-auto-tool-choice \
--tool-call-parser granite
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "barryke/granite-4.1-8b-FP8-DYNAMIC"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
chat = [
{"role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location."},
]
input_ids = tokenizer.apply_chat_template(
chat,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
output_ids = model.generate(
input_ids,
max_new_tokens=100,
pad_token_id=tokenizer.eos_token_id,
)
response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True)
print(response)
# IBM Almaden Research Laboratory, San Jose, California, United States.
tools = [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather for a specified city.",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string", "description": "Name of the city"}},
"required": ["city"],
},
},
}
]
chat = [{"role": "user", "content": "What's the weather like in Boston right now?"}]
input_ids = tokenizer.apply_chat_template(
chat, tools=tools, add_generation_prompt=True, return_tensors="pt",
).to(model.device)
out = model.generate(input_ids, max_new_tokens=100, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(out[0][input_ids.shape[-1]:], skip_special_tokens=False))
# <tool_call>
# {"name": "get_current_weather", "arguments": {"city": "Boston"}}
# </tool_call>
pip install sglang
python3 -m sglang.launch_server \
--model-path barryke/granite-4.1-8b-FP8-DYNAMIC \
--host 0.0.0.0 \
--port 30000
tokenizer.apply_chat_template(...) with add_generation_prompt=True. The template wraps messages with <|start_of_role|> / <|end_of_role|> markers the model was trained on.--gpu-memory-utilization / max-model-len accordingly when serving.This model inherits the Apache License 2.0 from the base model.
@misc{granite41,
title = {Granite 4.1 Language Models},
author = {{IBM Granite Team}},
year = {2026},
url = {https://huggingface.co/ibm-granite/granite-4.1-8b},
note = {Apache 2.0 licensed 8B dense instruct model with 128K context}
}
@software{llm-compressor,
title = {{LLM Compressor: An easy-to-use library for compressing LLMs}},
author = {{Neuralmagic, vLLM Project}},
url = {https://github.com/vllm-project/llm-compressor},
note = {Used v0.11.0 to produce this FP8-DYNAMIC checkpoint}
}