ibm-granite/granite-3.0-8b-instruct, its weights prepared in bf16 for Tenstorrent Tensix NPUs (Wormhole, Blackhole), with no quantization.
- The residual multiplier (0.22) folded into the 80 attention-output and MLP-down matrices (multiplied in float32, then converted to bf16), with
residual_multiplierset to 1.0 in the config; the other 282 tensors are the original bf16. TT-NN packs these bf16 values without changing them. - Accuracy against llama.cpp Q4_K_M: mean KL to bf16 0.0008, 0.01 times Q4_K_M's.
- Code: the included
pack_bf16.py, which checks every tensor through TT-NN host packing; tensix-bfp-gptq v0.1.0 (quantization and format checks), tensix-kernels v0.1.0 and tensix-runner v0.1.0 (kernels and runner for Tensix).
Formats
| Tensors | Format and change |
|---|---|
| Attention output and MLP down projections, 80 matrices | Original BF16 values multiplied by 0.22 in float32, then converted to BF16 |
| Every other stored tensor, 282 entries | Original BF16, byte-identical |
All 362 stored entries remain BF16: 8.170848 billion stored parameters and 16.34 GB of weight data. The tied
head shares the input embedding. The supplied config changes only residual_multiplier from 0.22 to 1.0.
Quickstart
Use Transformers 5.23.0 with PyTorch. Keep the supplied residual_multiplier: 1.0 configuration so the
already-folded scale is applied once.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Xylolabs/granite-3.0-8b-instruct-Tenstorrent-Tensix-BF16-Folded"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "What is the capital of France? Reply with the city name only."}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt",
return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The original model's tokenizer, template, vocabulary and EOS settings are retained.
Run on Tensix
All 362 stored BF16 tensors pass TT-NN host packing with unchanged values. The shown matrix also passes a DRAM round trip on the Blackhole simulator, checked with TT-NN 0.81.1. After downloading this repository locally, pack one output matrix in TT-NN's [in, out] layout:
import json
import torch
import ttnn
from safetensors import safe_open
d = "granite-3.0-8b-instruct-Tenstorrent-Tensix-BF16-Folded" # hf download Xylolabs/granite-3.0-8b-instruct-Tenstorrent-Tensix-BF16-Folded --local-dir granite-3.0-8b-instruct-Tenstorrent-Tensix-BF16-Folded
name = "model.layers.0.mlp.down_proj.weight"
shard = json.load(open(f"{d}/model.safetensors.index.json"))["weight_map"][name]
with safe_open(f"{d}/{shard}", "pt") as f:
w = f.get_tensor(name).t().contiguous()
device = ttnn.open_device(device_id=0)
w_tt = ttnn.as_tensor(w, dtype=ttnn.bfloat16, layout=ttnn.TILE_LAYOUT,
device=device, memory_config=ttnn.DRAM_MEMORY_CONFIG)
assert torch.equal(ttnn.to_torch(w_tt).float(), w.float())
ttnn.close_device(device)
python pack_bf16.py granite-3.0-8b-instruct-Tenstorrent-Tensix-BF16-Folded checks every indexed tensor through TT-NN
host packing; --device also round-trips it through device DRAM.
Evaluation
| Profile | Mean KL to original unfolded BF16 | Normal right / 33 | Thinking right / 7 |
|---|---|---|---|
| Original unfolded BF16 | 0 | 25 | 0 |
| This BF16 folded export | 0.000832725213 | 24 | 0 |
| Q4_K_M from the same original unfolded model | 0.059211 | 23 | 0 |
IEEE host KL covers all 16,248 scored positions in the original saved 16-sequence English/Korean raw/chat reference, with identical token IDs and masks. The original unfolded BF16 distributions are the denominator on both sides. The llama.cpp BF16 floor against that reference is 0.000295. These measurements include BF16 conversion and runner differences.
Source: ibm-granite/granite-3.0-8b-instruct at 5af56291a1c6ca9056df597aab0cff53edabddb0.
Updates
- 2026-11-22: Removed the statement that the pack and grid-check scripts ship in this repository.
- 2026-11-14: First release.
License
Apache 2.0 (LICENSE), as declared by the original IBM release. Changes are documented in NOTICE; the
original Xylolabs packing helpers use Apache 2.0 (CODE_LICENSE). Not affiliated with Tenstorrent.