Nanbeige for Tenstorrent Tensix
Collection
1 item • Updated
These weights from Nanbeige/Nanbeige4.3-33B are quantized for Tenstorrent Tensix NPUs, with the files in bfp4/.
| Folder | Formats | Size (GB, packed) | Mean KL to BF16 |
|---|---|---|---|
Xylolabs BFP4 bfp4/ |
Attention and MLP bfloat4_b; the rest bf16 | 22.070 | 0.0702 |
All files and rivals: BENCHMARKS.md
KL covers 16,220 positions of English and Korean text (WikiText-2 test, Korean Wikipedia).
hf download Xylolabs/Nanbeige4.3-33B-Tenstorrent-Tensix --include "bfp4/*" --local-dir Nanbeige4.3-33B-Tenstorrent-Tensix
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4")
model = AutoModelForCausalLM.from_pretrained("Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4", dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "What is the capital of France?"}]
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)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Use Transformers 5.22.2 or newer for the quickstart.
Pack one matrix:
import json
import torch
import ttnn
from safetensors import safe_open
d = "Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4"
name = "model.layers.0.mlp.down_proj.weight"
fmt = json.load(open(f"{d}/quant4.json"))["layers"]["0"]["mlp.down_proj"]["format"]
dtype = {"bfp4": ttnn.bfloat4_b, "bfp8": ttnn.bfloat8_b}[fmt]
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=dtype, 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 Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4/pack_tensix.py Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4
python Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4/verify_grid.py Nanbeige4.3-33B-Tenstorrent-Tensix/bfp4
Add --device to round-trip the packed values.
Apache 2.0, as the base model's card says (LICENSE). The changes are listed in NOTICE.
pack_tensix.py and verify_grid.py are from tensix-bfp-gptq v0.1.0, under the same license.
@misc{nanbeige43chat2026,
title = {Nanbeige4.3-33B},
author = {Nanbeige Team},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Nanbeige/Nanbeige4.3-33B}}
}
Base model
Nanbeige/Nanbeige4.3-33B-Base