Run this model with HF Jobs

Run Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Xylolabs

Gemma 4 26B-A4B QAT for Tenstorrent Tensix

Base model Formats License Code Tenstorrent Tensix

These weights from google/gemma-4-26B-A4B-it-qat-q4_0-unquantized are quantized for Tenstorrent Tensix NPUs, with each format in its own folder.

Folders

Folder Formats Size (GB, packed) Mean KL to BF16 Top-1 (%)
bfp4-mlp/ MLP and routed experts bfloat4_b (GPTQ with per-block exponent search), attention bfloat8_b (round to nearest), router and per-expert scales, tied LM head, embedding, norms, vision and all other tensors bf16 15.826 0.06233 90.87
bfp8/ Attention, MLP and routed experts bfloat8_b (GPTQ), router and per-expert scales, tied LM head, embedding, norms, vision and all other tensors bf16 27.513 0.00567 97.39
BF16 (Google checkpoint) - 50.47 0 100
Q4_0 (llama.cpp) - 14.439 0.05293 91.55

KL and top-1 cover 8,048 positions of English and Korean text (WikiText-2 test, Korean Wikipedia), in the chat template. Q4_0 was made from the same checkpoint with llama.cpp v0.9.0 (cd959bae) and no importance matrix. Its SHA-256 is 0f70faabfedac04c31f7ef661601c3fca4fc80069cef7e9eaf509b4b0e1e3c85. Q4_0 is the reference because Google ships this QAT checkpoint as Q4_0.

How to run

Download one format.

hf download Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix --include "bfp4-mlp/*" --local-dir gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
hf download Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix --include "bfp8/*" --local-dir gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
from transformers import AutoTokenizer, Gemma4ForConditionalGeneration

d = "gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix/bfp4-mlp"
tok = AutoTokenizer.from_pretrained(d)
model = Gemma4ForConditionalGeneration.from_pretrained(d, dtype="bfloat16", device_map="auto")

messages = [{"role": "user", "content": "What is the capital of France?"}]
inputs = tok.apply_chat_template(messages, tokenize=True, 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.

import json
import torch
import ttnn
from safetensors import safe_open

d = "gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix/bfp4-mlp"
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)
d=gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix/bfp4-mlp
python "$d/pack_tensix.py" "$d"
python "$d/verify_grid.py" "$d"

Add --device to pack_tensix.py to round-trip the packed values. The helpers cover the attention and shared MLP projections and skip the routed experts. For BFP8, use bfp8 in the local paths.

Updates

  • 2026-11-29: Merged the BFP4-MLP and BFP8 repos into one repo with a folder per format.
  • 2026-11-22: Corrected the BF16 size in the bfp4-mlp/ and bfp8/ summaries to match the evaluation table.
  • 2026-11-13: First release of bfp4-mlp/, following bfp8/ on 2026-11-12.

License

Apache 2.0, as declared by the base model. The root and each folder carry LICENSE and NOTICE. The scripts pack_tensix.py and verify_grid.py ship unchanged from tensix-bfp-gptq at commit 5c52065 under the same license.

Citation

@misc{gemmateam2026gemma4,
      title={Gemma 4 Technical Report},
      author={Gemma Team},
      year={2026},
      eprint={2607.02770},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2607.02770},
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix

Collections including Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix

Paper for Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix