Qwen3.5 for Tenstorrent Tensix
Collection
6 items • Updated
These weights from Qwen/Qwen3.5-4B are quantized for Tenstorrent Tensix NPUs (Wormhole, Blackhole), with each format in its own folder.
| Folder | Formats | Size (GB, packed) | Mean KL to BF16 |
|---|---|---|---|
bfp4/ |
Attention, DeltaNet and MLP bfloat4_b; the rest bf16/float32 | 3.281 | 0.04447 |
bfp8/ |
Attention, DeltaNet and MLP bfloat8_b; the rest bf16/float32 | 5.065 | 0.00084 |
| BF16 (Qwen/Qwen3.5-4B) | - | 8.41 | 0 |
| Q4_K_M (llama.cpp) | - | 2.783 | 0.03981 |
KL covers 16,312 positions of English and Korean text (WikiText-2 test, Korean Wikipedia), plain and in the chat template, with a mean-KL limit of 1.5 times the Q4_K_M reference.
hf download Xylolabs/Qwen3.5-4B-Tenstorrent-Tensix --include "bfp4/*" --local-dir Qwen3.5-4B-Tenstorrent-Tensix
export WEIGHTS_DIR="$PWD/Qwen3.5-4B-Tenstorrent-Tensix/bfp4"
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Qwen3.5-4B-Tenstorrent-Tensix/bfp4")
model = AutoModelForCausalLM.from_pretrained("Qwen3.5-4B-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))
Set MESH_DEVICE for your Tensix environment before running the demo.
Pack one matrix:
import json
import torch
import ttnn
from safetensors import safe_open
d = "Qwen3.5-4B-Tenstorrent-Tensix/bfp4"
name = "model.language_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 Qwen3.5-4B-Tenstorrent-Tensix/bfp4/pack_tensix.py Qwen3.5-4B-Tenstorrent-Tensix/bfp4
python Qwen3.5-4B-Tenstorrent-Tensix/bfp4/verify_grid.py Qwen3.5-4B-Tenstorrent-Tensix/bfp4
Add --device to round-trip the packed values.
# build tt-metal v0.81.1 as its INSTALLING.md describes, then
export HF_MODEL="$WEIGHTS_DIR"
pytest models/demos/blackhole/qwen36/demo/text_demo.py -v -s -k "traced_128 and not traced_128k"
To use another format, download its folder the same way and substitute its local path.
Apache 2.0, as the base model (LICENSE). The changes are listed in NOTICE. pack_tensix.py and
verify_grid.py are by Xylolabs under the same license.
Each folder carries its own LICENSE and NOTICE.
@misc{qwen3.5,
title = {{Qwen3.5}: Towards Native Multimodal Agents},
author = {{Qwen Team}},
month = {February},
year = {2026},
url = {https://qwen.ai/blog?id=qwen3.5}
}