--- license: apache-2.0 base_model: - openai/gpt-oss-20b base_model_relation: quantized pipeline_tag: text-generation tags: - tenstorrent - tensix - tt-metal - ttnn - tt-forge - block-floating-point - bfloat4_b - bfloat8_b - quantized ---
Xylolabs

gpt-oss-20b for Tenstorrent Tensix

[![Base model](https://img.shields.io/badge/base-openai%2Fgpt--oss--20b-blue)](https://huggingface.co/openai/gpt-oss-20b) [![Formats](https://img.shields.io/badge/formats-BFP4%20%2F%20BFP8-5B2C83)](#folders) [![License](https://img.shields.io/badge/license-Apache--2.0-green)](https://huggingface.co/Xylolabs/gpt-oss-20b-Tenstorrent-Tensix/blob/main/LICENSE) [![Code](https://img.shields.io/badge/code-tensix--bfp--gptq-black)](https://github.com/XylolabsInc/tensix-bfp-gptq) [![Tenstorrent Tensix](https://img.shields.io/badge/Tenstorrent-Tensix-5B2C83)](https://docs.tenstorrent.com)
These weights from [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b) are quantized for Tenstorrent Tensix NPUs (Wormhole, Blackhole), with each format in its own folder. ## Folders | Folder | Formats | Size (GB, packed) | Mean KL to BF16 | | --- | --- | --- | --- | | `bfp4/` | Routed experts bfloat4_b; attention and LM head bfloat8_b; the rest bf16 | 13.218 | 0.0636 | | `bfp8/` | Attention and routed experts and LM head bfloat8_b; the rest bf16 | 22.773 | 0.0488 | | BF16 ([openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b/tree/6cee5e81ee83917806bbde320786a8fb61efebee)) | - | 41.83 | 0 | | MXFP4 (llama.cpp) | - | 12.110 | 0.0678 | KL covers 8,188 positions of English and Korean text (WikiText-2 test, Korean Wikipedia), as plain text. ## How to run ```bash hf download Xylolabs/gpt-oss-20b-Tenstorrent-Tensix --include "bfp4/*" --local-dir gpt-oss-20b-Tenstorrent-Tensix ``` ```python from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("gpt-oss-20b-Tenstorrent-Tensix/bfp4") model = AutoModelForCausalLM.from_pretrained("gpt-oss-20b-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)) ``` ### Run on Tensix Pack one matrix: ```python import json import torch import ttnn from safetensors import safe_open d = "gpt-oss-20b-Tenstorrent-Tensix/bfp4" name = "model.layers.0.self_attn.o_proj.weight" fmt = json.load(open(f"{d}/quant4.json"))["layers"]["0"]["self_attn.o_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) ``` ```bash python gpt-oss-20b-Tenstorrent-Tensix/bfp4/pack_tensix.py gpt-oss-20b-Tenstorrent-Tensix/bfp4 python gpt-oss-20b-Tenstorrent-Tensix/bfp4/verify_grid.py gpt-oss-20b-Tenstorrent-Tensix/bfp4 ``` Add `--device` to round-trip the packed values. To use another format, download its folder the same way and substitute its local path. ## Updates - 2026-11-27: BFP4 and BFP8 now in one repo, formerly gpt-oss-20b-Tenstorrent-Tensix-BFP4 and gpt-oss-20b-Tenstorrent-Tensix-BFP8. ## License Apache 2.0, as the base model (`LICENSE`), with its usage policy (`USAGE_POLICY`). 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`. ## Citation ```bibtex @misc{openai2025gptoss120bgptoss20bmodel, title={gpt-oss-120b & gpt-oss-20b Model Card}, author={OpenAI}, year={2025}, eprint={2508.10925}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2508.10925}, } ```