docs: correct the mesh descriptor from an external 2-card silicon report #4

Merged
multica-agent merged 13 commits from agent/claude-auth/two-card-external-report into master 2026-09-04 12:31:52 +02:00
Member

Someone has already run our exact target and published it:
Thatch-cloud/Tenstorrent.Blackhole-Qwen3.8-27B
— Qwen3.8-27B, 2× p150a, one QSFP-DD cable, (1,2) mesh, vLLM, GSM8K
58/60 = 96.7%
, measured at tt-metal v0.77.0-rc1. MIT.

It is worth more for its failure catalogue than its throughput, and it
corrects two claims of ours that are load-bearing today, the day the
cards arrive.

Corrections

Our claim Measured reality
p150_x2 descriptor's policy: RELAXED allows a one-cable start TT_FATAL: Expected 4 eth links on correctly cabled hardware. One QSFP-DD cable trains 2 links. Use p300_mesh_graph_descriptor.textproto (channels { count: 2 })
TT_MESH_GRAPH_DESC_PATH "not needed" on silicon Without it, fabric discovery silently falls back to 1 link in an all-gather expecting 2 — wrong, not fatal

Our reading of the proto was right; v0.77 does not honour it. Pick the
descriptor from the measured link count, not the card model.

Silver lining: two links per cable is exactly the hardcoded num_links = 2
in the three fused CCL ops, so that hardcode needs no patch at one cable.
It becomes the limiter only if a second cable is fitted.

On "there must be room for optimization" — there is, but ~1.5×, not 3×

Their 18.19 tok/s (B=1, 128 ctx) against the memory roofline (27.49 GiB at
bf8/bf4 = 29.5 GB; p150a = 512 GB/s):

bytes/card/token roofline measured MBU
1 card 29.5 GB 17.3 tok/s 7.8 45%
2 cards, TP=2 14.8 GB 34.7 tok/s 18.19 52%
4 dies (upstream's own gate) 7.4 GB 69.4 tok/s 26.0 37%

So their two-card result is a better fraction of roofline than
Tenstorrent's own published 4-die gate
. 18 tok/s is not a
misconfiguration, and adding cards is not where the win is.

Where the gap goes: a step is 55 ms, of which 28.8 ms is weight reads, so
~26 ms/token is fixed non-bandwidth overhead. It is not attention —
decode is nearly flat from 128 to 64k ctx (18.19 → 16.19). Prime suspect is
host sampling, which TP=2 forces (vocab 248,320 → 124,160 logits/device,
over the on-device sampler's 65,536 ceiling): the cost is not the 0.5 MB, it
is the synchronisation, which breaks the decode trace every token. B=8 giving
only 5.5× aggregate rather than 8× corroborates a fixed per-step cost.

Ranked headroom, in docs/EXTERNAL-2CARD-REPORT.md: on-device two-stage
top-k (biggest, and a real upstream contribution) → second cable (needs the
num_links patch and a descriptor swap, not a free win) → MTP spec decode
(still blocked on GDN rollback) → wider bf4. Realistic combined ceiling
~2–3×, mostly upstream model-layer work.

Also imported

Day-one traps (links train at board init only, so tt-smi -r after
cabling; device numbers move across a reset, so pin by-id and resolve after;
a pair with no direct link opens silently and only differing
Logical/Physical degree histograms reveal it — cheap enough to add to
tenstorrent-inventory), the load-bearing serving flags with the reason for
each, and the ~510 s readiness budget.

Provenance caveat

Their stack needs three unmerged tt-metal PRs authored by an agent account
(ctxbot) with essentially no human review, plus a one-character fix of
their own — #53320 had pinned a ttnn.slice batch bound to a literal 1,
silently dropping every user past the first at B≥2, uncaught because the
module's tests only ran batch_size=1. Treated here as evidence, not a
dependency
.

Tier: docs only. No module, package or script changes.

The nixos-llm side is nixos-llm#490, updated in step.

Someone has already run our exact target and published it: [`Thatch-cloud/Tenstorrent.Blackhole-Qwen3.8-27B`](https://github.com/Thatch-cloud/Tenstorrent.Blackhole-Qwen3.8-27B) — Qwen3.8-27B, 2× p150a, one QSFP-DD cable, `(1,2)` mesh, vLLM, **GSM8K 58/60 = 96.7%**, measured at tt-metal `v0.77.0-rc1`. MIT. It is worth more for its failure catalogue than its throughput, and it **corrects two claims of ours that are load-bearing today**, the day the cards arrive. ## Corrections | Our claim | Measured reality | | --- | --- | | `p150_x2` descriptor's `policy: RELAXED` allows a one-cable start | `TT_FATAL: Expected 4 eth links` on *correctly cabled* hardware. One QSFP-DD cable trains **2** links. Use `p300_mesh_graph_descriptor.textproto` (`channels { count: 2 }`) | | `TT_MESH_GRAPH_DESC_PATH` "not needed" on silicon | Without it, fabric discovery **silently falls back to 1 link** in an all-gather expecting 2 — wrong, not fatal | Our reading of the proto was right; v0.77 does not honour it. **Pick the descriptor from the measured link count, not the card model.** Silver lining: two links per cable is exactly the hardcoded `num_links = 2` in the three fused CCL ops, so that hardcode needs **no patch** at one cable. It becomes the limiter only if a second cable is fitted. ## On "there must be room for optimization" — there is, but ~1.5×, not 3× Their 18.19 tok/s (B=1, 128 ctx) against the memory roofline (27.49 GiB at bf8/bf4 = 29.5 GB; p150a = 512 GB/s): | | bytes/card/token | roofline | measured | **MBU** | | --- | ---: | ---: | ---: | ---: | | 1 card | 29.5 GB | 17.3 tok/s | 7.8 | 45% | | **2 cards, TP=2** | **14.8 GB** | **34.7 tok/s** | **18.19** | **52%** | | 4 dies (upstream's own gate) | 7.4 GB | 69.4 tok/s | 26.0 | **37%** | So their two-card result is a **better fraction of roofline than Tenstorrent's own published 4-die gate**. 18 tok/s is not a misconfiguration, and adding cards is not where the win is. Where the gap goes: a step is 55 ms, of which 28.8 ms is weight reads, so **~26 ms/token is fixed non-bandwidth overhead**. It is not attention — decode is nearly flat from 128 to 64k ctx (18.19 → 16.19). Prime suspect is **host sampling, which TP=2 forces** (vocab 248,320 → 124,160 logits/device, over the on-device sampler's 65,536 ceiling): the cost is not the 0.5 MB, it is the synchronisation, which breaks the decode trace every token. B=8 giving only 5.5× aggregate rather than 8× corroborates a fixed per-step cost. Ranked headroom, in `docs/EXTERNAL-2CARD-REPORT.md`: on-device two-stage top-k (biggest, and a real upstream contribution) → second cable (needs the `num_links` patch *and* a descriptor swap, not a free win) → MTP spec decode (still blocked on GDN rollback) → wider bf4. Realistic combined ceiling **~2–3×**, mostly upstream model-layer work. ## Also imported Day-one traps (links train at board init only, so `tt-smi -r` **after** cabling; device numbers move across a reset, so pin by-id and resolve after; a pair with no direct link **opens silently** and only differing Logical/Physical degree histograms reveal it — cheap enough to add to `tenstorrent-inventory`), the load-bearing serving flags with the reason for each, and the **~510 s readiness** budget. ## Provenance caveat Their stack needs three unmerged tt-metal PRs authored by an agent account (`ctxbot`) with essentially no human review, plus a one-character fix of their own — #53320 had pinned a `ttnn.slice` batch bound to a literal `1`, silently dropping every user past the first at B≥2, uncaught because the module's tests only ran `batch_size=1`. Treated here as **evidence, not a dependency**. Tier: docs only. No module, package or script changes. The nixos-llm side is nixos-llm#490, updated in step.
docs: correct the mesh descriptor choice from an external 2-card report
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 15s
tt-stack-ci / Report upstream drift (pull_request) Successful in 4s
39842a1d06
An external MIT repo (Thatch-cloud/Tenstorrent.Blackhole-Qwen3.8-27B) runs
our exact target — Qwen3.8-27B, 2x p150a, one cable, (1,2) mesh, vLLM,
GSM8K 96.7% — and measured two things we had wrong, both of which would have
cost us hours on the day the cards arrive:

- `p150_x2_mesh_graph_descriptor.textproto` does NOT tolerate one cable.
  Its `policy: RELAXED` says it should; v0.77.0-rc1 raises
  `TT_FATAL: Expected 4 eth links` on correctly cabled hardware, because one
  QSFP-DD cable trains 2 links. `p300_mesh_graph_descriptor.textproto`
  (channels: 2) is the correct file. Pick the descriptor from the measured
  link count, not the card model.
- `TT_MESH_GRAPH_DESC_PATH` IS needed on silicon, not just under the
  simulator. Without it fabric discovery silently falls back to one link in
  an all-gather path that expects two — wrong, not fatal.

Also records their flag catalogue, the day-one traps (links train at board
init only; device numbers move across `tt-smi -r`; a disconnected pair opens
silently and only differing Logical/Physical degree histograms reveal it),
and a roofline analysis of their throughput: 18.19 tok/s is 52% of memory
bandwidth, versus 37% for upstream's own 4-die gate, so the headroom is
~1.5x from on-device sampling rather than the 3x a first read suggests.

Their dependency stack is three unreviewed agent-authored tt-metal PRs; the
report is treated as evidence, not as something to depend on.
docs: size the KV cache from config, and narrow the host-RAM blocker
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 3s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
e1cd203fd9
Two claims needed settling with arithmetic rather than repetition: that
inference needs no host RAM, and that 2x p150a should hold 8 concurrent
sessions at 256k with cfx-llm0's KV quantization.

Derived from Qwen3.8-27B's own config.json: 16 of 64 layers are full
attention (the other 48 are GDN, whose recurrent state is ~72 MiB/sequence
and context-INDEPENDENT), num_key_value_heads=4, head_dim=256. So KV is
32,768 elements/token = 64 KiB at bf16, ~33 KiB at bfloat8_b.

Against a ~33.9 GiB KV budget (64 GiB minus 27.5 weights, 1 trace region,
GDN state and slack) that is ~1.0M tokens of concurrency x context:
4x256k or 8x128k fit; 8x256k needs 64 GiB and misses by ~1.9x. Closing that
needs ~4-bit KV.

cfx-llm0's kvarn_k4v2_g128 (~3 bits) would close it, and does not transfer:
the pinned vllm-tt-plugin has zero occurrences of kv_cache_dtype, reads
cache_config.cache_dtype only for vLLM's block accounting (device allocation
is model-side in tt-metal), and resolves it through STR_DTYPE_TO_TORCH_DTYPE,
which cannot express kvarn at all. Recorded as a footgun: --kv-cache-dtype
fp8 on TT changes the planner's block cost but not the device dtype, so it
over-admits and OOMs on device. QWEN_SDPA_BF8 is the only real KV knob.

And the constraint that bites before memory: prefill runs ~1,190 tok/s, so
8x256k is ~29 minutes of prefill with prefix caching force-disabled. 256k
here is a single-session capability, not a concurrency story.

On host RAM the instinct is right — inference keeps weights and KV in device
DRAM; the only host costs are 2 GiB of pinned hugepages and the per-token
sampling round trip TP=2 forces. The 67.5 GB is a FIRST-LOAD cost dominated
by init_vision_model loading a vision tower a text-only path never uses. So
it is a software artifact, not a hardware verdict — but not yet proof that
16 GB suffices, since the text-only path still moves a 51.7 GiB checkpoint
through host memory. Adds the cards-free experiment that settles it: load
the 9B we already have and record peak RSS.
docs: find the idle half — prefill at 10% MFU, and rank the work
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 27s
62df4ca5ce
Operator set the target at 4x256k (2026-09-04) on the correct premise that
these limits are software and TT is fully open source.

4x256k fits memory at 32 GiB of a ~33.9 GiB budget, but that is a 6% margin,
so it needs verifying rather than trusting. The real constraint is time:
1.05M tokens of prefill at ~1,192 tok/s is ~15 minutes, unrecoverable
because prefix caching is force-disabled.

Computing utilization against 1,217 TFLOP/s and 1,024 GB/s (two cards, 110
of 120 Tensix) puts the gap somewhere different from where we were looking:

  prefill MFU  17.7% @ 4k  ->  13.2% @ 64k  ->  10.3% @ 256k
  decode  MBU  52%, i.e. 26.2 ms/token of fixed non-bandwidth overhead

So decode is the smaller prize (~1.5x, and bandwidth-bounded regardless),
while prefill is the idle half AND degrades exactly where we are aiming.
Attention rises to 49% of prefill FLOPs at 256k, which localises the
long-context gap to the 16 full-attention layers rather than the MLPs — a
precise target, and one CUDA solved long ago with flash/chunked prefill.
At 20-30% MFU the 4x256k prefill drops from 14.7 min to 5-8 min.

MFU here is a directional lower bound: the vendor BLOCKFP8 peak is applied
to mixed-precision work, so true efficiency is somewhat better. The trend is
not precision-sensitive.

Adds the two cheap experiments that confirm or kill both hypotheses
(TT_METAL_DEVICE_PROFILER=1 gives per-core device profiling including
Ethernet cores, so CCL time is visible; Tracy for the host-side per-token
gap), with the traps: it conflicts with watcher and DPRINT, must never share
a run with a throughput measurement, and its interaction with captured
traces is unverified.

On the three repos: tt-forge-models/qwen_3_8 IS Qwen3.8-27B despite the name
and is valuable as the CPU golden for PCC work, not as a serving path (it
loads the whole model into host RAM via AutoModelForCausalLM). tt-forge is
the MLIR coverage stack and must not replace the serving path, which
dispatches to hand-written tt-metal model code via vllm-tt-plugin — but
tt-lang is the right tool for porting Triton-class KV-quant kernels.
tt-model-manager is packaging, not performance, and its v5 bundles are a
clean way to ship our own custom kernels without building tt-metal in Nix.
docs: add the optimization loop, and restate the 90% target per phase
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 6s
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
53f054bbfd
Operator wants an iterate-until-saturated loop: run, measure, observe, find
gaps, alter settings, repeat, to 90%+.

Two things had to be said before the loop is usable.

Saturation is not one number here. Decode is bandwidth-bound (52% of
1,024 GB/s, compute ~2% used); prefill is compute-bound (10.3% of
1,217 TFLOP/s, bandwidth idle). Work moved off one lands on the other, so a
single blended figure lets a decode win hide a prefill loss. And 90% of
theoretical peak is not reachable on any accelerator — mature CUDA stacks
land 70-85% MBU on decode and 40-50% MFU on prefill. An unreachable exit
condition means a loop that never exits and eventually trades accuracy for
throughput. So the target is 90% of ACHIEVABLE, per phase, as a ladder:
decode MBU 52 -> 70 -> 80%, prefill MFU 10.3 -> 25 -> 35%, steering by the
metric that is actually user-visible — 4x256k time-to-filled, 14.7 min today,
under 6 min realistic.

And iteration 0 is host RAM, not a benchmark. 16 GB cannot load the 27B in
any configuration, and even the text-only 9B path peaks at 20-24 GB, so the
loop is correctness-only under ttsim until the peak-RSS measurement and the
DIMM/tile-cache decision land. Stated up front so the plan is not fiction.

The loop itself is six stages with the attribution step made explicit
(achieved vs roofline vs where the time went, from a SEPARATE profiled run)
and a gap ledger as its memory, so iteration N+1 does not re-derive N.

Guardrails carry the most weight. A speed-only loop would have accepted the
upstream change annotated "numerics unchanged" that pinned a ttnn.slice
batch bound to a literal 1 and silently dropped every user past the first at
B>=2 — it survived because the tests only ran batch_size=1. Hence per-op PCC
at B=4 and GSM8K at the serving config and long context, not at 4k, since
QWEN_SDPA_BF8 is upstream-gated with a long-context PCC caveat. Plus a
wall-clock wedge watchdog, because pytest --timeout uses signals a wedged
device op may not honour and an unattended loop would park the cards
overnight.

Also records that most of the machinery already exists (check-perf-env,
tt-bench, tt-sweep with genuine-readiness detection), so this is assembly
and gating rather than new tooling, and that config sweeps are worth ~10-20%
while the step change is kernel work.
Author
Member

Three more commits — the sizing arithmetic, the saturation analysis, and the optimization loop. Docs only throughout; no module, package or script changes.

docs/VRAM-BUDGET.md

Derived from Qwen3.8-27B's own config.json, not estimated. Only 16 of 64 layers have a context-scaling cache — the 48 GDN layers carry a fixed ~72 MiB/sequence recurrent state that is context-independent, which is why 256k is discussable at all. KV is 2 × 4 kv_heads × 256 head_dim × 16 layers = 32,768 elem/token → 64 KiB at bf16, ~33 KiB at bfloat8_b.

Against a ~33.9 GiB budget (64 GiB − 27.5 weights − trace region − GDN/activations) that is ~1.0M tokens of concurrency × context. So 4 × 256k fits at 32 GiB (6% margin — verify, don't assume), 8 × 128k fits, and 8 × 256k misses by ~1.9×.

cfx-llm0's kvarn_k4v2_g128 (~3 bits) does not transfer, and not for want of a flag: the pinned vllm-tt-plugin has zero occurrences of kv_cache_dtype, reads cache_config.cache_dtype only for vLLM's block accounting (device allocation is model-side in tt-metal), and resolves it through STR_DTYPE_TO_TORCH_DTYPE, which cannot express kvarn. Recorded as a footgun: --kv-cache-dtype fp8 on TT changes what the planner believes a block costs while the device allocates at the model's dtype → over-admit → OOM on device with the scheduler convinced it had room.

Also narrows the host-RAM blocker. Inference genuinely uses no host RAM for model state; the 67.5 GB is a first-load cost dominated by init_vision_model() loading a vision tower a text-only path never uses. Software artifact, not a hardware verdict — but not yet proof 16 GB suffices, since the text-only path still moves a 51.7 GiB checkpoint through host memory. Adds the cards-free experiment that settles it.

docs/SATURATION-PLAN.md

Utilization against 1,217 TFLOP/s and 1,024 GB/s (two cards, 110 of 120 Tensix):

ctx attention share prefill MFU
4k 1% 17.7%
64k 19% 13.2%
256k 49% 10.3%

Decode B=1: 55.0 ms step vs a 28.8 ms weight-read floor → 52% MBU, 26.2 ms/token fixed overhead.

This relocates the priority. Decode is the smaller prize (~1.5×, bandwidth-bounded regardless). Prefill is the idle half and degrades exactly where we're aiming, with attention at 49% of FLOPs at 256k — localising the gap to the 16 full-attention layers rather than the MLPs. At 20–30% MFU, 4×256k prefill drops from 14.7 min to 5–8 min. MFU is a directional lower bound (vendor BLOCKFP8 peak applied to mixed-precision work); the trend is not precision-sensitive.

On the three upstream repos: tt-forge-models/qwen_3_8 is Qwen3.8-27B despite the name, and is valuable as the CPU golden for PCC work — not a serving path (AutoModelForCausalLM.from_pretrained, i.e. the whole model in host RAM). tt-forge is the MLIR coverage stack and should not replace the serving path, which dispatches to hand-written tt-metal model code via the plugin's EXTRA_MODELS_DIR contract — but tt-lang is the right tool for porting Triton-class KV-quant kernels. tt-model-manager is packaging, not performance, though its v5 bundles are a clean way to ship our own custom kernels without building tt-metal under Nix.

docs/ITERATION-LOOP.md

The measure-change-repeat loop, with two things stated up front so it's usable:

Saturation is not one number. Decode is bandwidth-bound (compute ~2% used); prefill is compute-bound (bandwidth idle). A blended figure lets a decode win hide a prefill loss. And 90% of theoretical peak is unreachable — mature CUDA stacks land 70–85% MBU and 40–50% MFU. An unreachable exit condition means a loop that never exits and eventually trades accuracy for throughput. So: 90% of achievable, per phase, as a ladder (decode MBU 52→70→80%, prefill MFU 10.3→25→35%), steering by the user-visible metric — 4×256k time-to-filled, 14.7 min → under 6 min.

Iteration 0 is host RAM, not a benchmark. 16 GB cannot load the 27B in any configuration, so the loop is correctness-only under ttsim until the peak-RSS measurement and the DIMM/tile-cache decision land.

Most of the machinery already exists here — check-perf-env.py (encodes the TT_METAL_WATCHER=0 trap: setting it enables the watcher with a 0 ms poll), tt-bench.py (p50/p95/max ITL kept separate, because prefill stalls in-flight decode), tt-sweep.py (genuine-readiness detection, since /health can never fail). So this is assembly and gating, not new tooling. What's added: an explicit attribution stage (achieved vs roofline vs where the time went, from a separate profiled run — profiling conflicts with watcher/DPRINT and must never share a run with a throughput measurement), a gap ledger as the loop's memory, and the guardrails.

The guardrails carry the most weight, and the cautionary tale is in this stack: a speed-only loop would have accepted the upstream change annotated "Pure memory placement, numerics unchanged" that pinned a ttnn.slice batch bound to a literal 1 and silently discarded every user past the first at B≥2 — it survived because the module's tests only ran batch_size=1. Hence per-op PCC at B=4, and GSM8K at the serving config and long context, not at 4k, since QWEN_SDPA_BF8 is upstream-gated with an explicit long-context PCC caveat. Plus a wall-clock wedge watchdog: pytest --timeout uses signals a wedged device op may not honour, and an unattended loop would otherwise park the cards overnight.

@hermes this is a docs-only PR against tt-stack, so it carries no deploy risk — but the descriptor correction in the first commit is the load-bearing one and worth a second pair of eyes, since it contradicts what this repo previously asserted from reading the proto.

Three more commits — the sizing arithmetic, the saturation analysis, and the optimization loop. Docs only throughout; no module, package or script changes. ### `docs/VRAM-BUDGET.md` Derived from Qwen3.8-27B's own `config.json`, not estimated. **Only 16 of 64 layers have a context-scaling cache** — the 48 GDN layers carry a fixed ~72 MiB/sequence recurrent state that is context-*independent*, which is why 256k is discussable at all. KV is `2 × 4 kv_heads × 256 head_dim × 16 layers` = 32,768 elem/token → 64 KiB at bf16, ~33 KiB at `bfloat8_b`. Against a ~33.9 GiB budget (64 GiB − 27.5 weights − trace region − GDN/activations) that is **~1.0M tokens of concurrency × context**. So `4 × 256k` fits at 32 GiB (**6% margin — verify, don't assume**), `8 × 128k` fits, and `8 × 256k` misses by ~1.9×. **cfx-llm0's `kvarn_k4v2_g128` (~3 bits) does not transfer**, and not for want of a flag: the pinned `vllm-tt-plugin` has **zero occurrences of `kv_cache_dtype`**, reads `cache_config.cache_dtype` only for vLLM's block accounting (device allocation is model-side in tt-metal), and resolves it through `STR_DTYPE_TO_TORCH_DTYPE`, which cannot express kvarn. Recorded as a footgun: `--kv-cache-dtype fp8` on TT changes what the planner believes a block costs while the device allocates at the model's dtype → over-admit → OOM on device with the scheduler convinced it had room. Also narrows the host-RAM blocker. Inference genuinely uses no host RAM for model state; the 67.5 GB is a **first-load** cost dominated by `init_vision_model()` loading a vision tower a text-only path never uses. Software artifact, not a hardware verdict — but not yet proof 16 GB suffices, since the text-only path still moves a 51.7 GiB checkpoint through host memory. Adds the cards-free experiment that settles it. ### `docs/SATURATION-PLAN.md` Utilization against 1,217 TFLOP/s and 1,024 GB/s (two cards, 110 of 120 Tensix): | ctx | attention share | **prefill MFU** | | ---: | ---: | ---: | | 4k | 1% | **17.7%** | | 64k | 19% | **13.2%** | | 256k | **49%** | **10.3%** | Decode B=1: 55.0 ms step vs a 28.8 ms weight-read floor → **52% MBU**, **26.2 ms/token fixed overhead**. This relocates the priority. Decode is the *smaller* prize (~1.5×, bandwidth-bounded regardless). **Prefill is the idle half and degrades exactly where we're aiming**, with attention at 49% of FLOPs at 256k — localising the gap to the 16 full-attention layers rather than the MLPs. At 20–30% MFU, 4×256k prefill drops from 14.7 min to 5–8 min. MFU is a directional lower bound (vendor BLOCKFP8 peak applied to mixed-precision work); the trend is not precision-sensitive. On the three upstream repos: `tt-forge-models/qwen_3_8` **is** Qwen3.8-27B despite the name, and is valuable as the CPU golden for PCC work — not a serving path (`AutoModelForCausalLM.from_pretrained`, i.e. the whole model in host RAM). `tt-forge` is the MLIR coverage stack and should not replace the serving path, which dispatches to hand-written tt-metal model code via the plugin's `EXTRA_MODELS_DIR` contract — but **tt-lang** is the right tool for porting Triton-class KV-quant kernels. `tt-model-manager` is packaging, not performance, though its v5 bundles are a clean way to ship our own custom kernels without building tt-metal under Nix. ### `docs/ITERATION-LOOP.md` The measure-change-repeat loop, with two things stated up front so it's usable: **Saturation is not one number.** Decode is bandwidth-bound (compute ~2% used); prefill is compute-bound (bandwidth idle). A blended figure lets a decode win hide a prefill loss. And 90% of *theoretical* peak is unreachable — mature CUDA stacks land 70–85% MBU and 40–50% MFU. An unreachable exit condition means a loop that never exits and eventually trades accuracy for throughput. So: 90% of *achievable*, per phase, as a ladder (decode MBU 52→70→80%, prefill MFU 10.3→25→35%), steering by the user-visible metric — **4×256k time-to-filled, 14.7 min → under 6 min**. **Iteration 0 is host RAM, not a benchmark.** 16 GB cannot load the 27B in any configuration, so the loop is correctness-only under ttsim until the peak-RSS measurement and the DIMM/tile-cache decision land. Most of the machinery already exists here — `check-perf-env.py` (encodes the `TT_METAL_WATCHER=0` trap: setting it *enables* the watcher with a 0 ms poll), `tt-bench.py` (p50/p95/max ITL kept separate, because prefill stalls in-flight decode), `tt-sweep.py` (genuine-readiness detection, since `/health` can never fail). So this is assembly and gating, not new tooling. What's added: an explicit attribution stage (achieved vs roofline vs where the time went, from a **separate** profiled run — profiling conflicts with watcher/DPRINT and must never share a run with a throughput measurement), a gap ledger as the loop's memory, and the guardrails. The guardrails carry the most weight, and the cautionary tale is in this stack: a speed-only loop would have accepted the upstream change annotated *"Pure memory placement, numerics unchanged"* that pinned a `ttnn.slice` batch bound to a literal `1` and **silently discarded every user past the first at B≥2** — it survived because the module's tests only ran `batch_size=1`. Hence per-op PCC at **B=4**, and GSM8K at the **serving config and long context**, not at 4k, since `QWEN_SDPA_BF8` is upstream-gated with an explicit long-context PCC caveat. Plus a wall-clock wedge watchdog: `pytest --timeout` uses signals a wedged device op may not honour, and an unattended loop would otherwise park the cards overnight. @hermes this is a docs-only PR against tt-stack, so it carries no deploy risk — but the descriptor correction in the first commit is the load-bearing one and worth a second pair of eyes, since it contradicts what this repo previously asserted from reading the proto.
Two bugs, both of which would have bitten on the first deploy with cards
seated.

hugepagesPerCard defaulted to 1, and the description claimed that matched
"the documented Wormhole/Blackhole setup". It does not. Upstream's
tt-system-tools/hugepages-setup/hugepages-setup.sh allocates 4 per device
for Blackhole (1e52:b140) AND Wormhole, and 1 only for Grayskull — the
default here had taken the Grayskull number. The header states the intent:
"a full 4x1G pages, maximize the aperture between device and host". These
pages ARE the device-to-host aperture, so under-provisioning them is not a
tuning choice.

Consequence worth stating where the option is read: two cards now reserve
8 GiB of host RAM permanently at boot, which on cfx-llm2's 16 GiB is half
the machine. Upstream supports overriding the count downward
(hugepages-override.txt), so lowering it is legitimate — with a measurement.

Second, tenstorrent-inventory could not tell a pending reboot from a memory
shortfall. 1G pages are reserved from the kernel command line, so a deploy
that changes the reservation activates a new cmdline while the running
kernel still has the old one: nr_hugepages stays short, the unit failed,
switch-to-configuration exits 4, and deploy-rs rolls the whole thing back —
on a host that is fine and merely needs rebooting. It now checks /proc/cmdline
for the expected reservation and, when absent, warns and records
hugepages_state=reboot-required instead of failing. A genuine shortfall (the
cmdline asks and the kernel could not comply) still fails loudly.

Also records BAR sizes in the inventory. The operator has just enabled
Resizable BAR and Above-4G decoding; a BIOS that quietly stops honouring
either is otherwise invisible until a transfer fails much later. Reported,
not gated, since the expected Blackhole window size is not yet verified.
docs: stream weights per tensor instead of buying RAM
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 3s
tt-stack-ci / Report upstream drift (pull_request) Successful in 6s
94580a8154
Operator direction: 16 GB is fixed, so fix the loader rather than the
hardware. Sound, and this writes down the route plus the parts that are not
simply "use mmap".

From the checkpoint index: 55.56 GB across 1,199 tensors, and
tie_word_embeddings is false, so lm_head and embed_tokens BOTH exist at
248,320 x 5,120 = 2.54 GB each at bf16. That pair is the peak working set of
any streaming loader — ~3.8 GB if source and tilized destination are both
held — and row-chunking them brings the whole load under 2 GB.

The important correction: what materialises the model is not the file read
but instantiating an HF model object. init_vision_model builds the entire
Qwen3_5ForConditionalGeneration, text tower included, and no amount of mmap
under that helps. The vision tower's own weights are only ~1 GB of the 55.56
(27 blocks at hidden 1152), so the fix is not "skip a small tower" — it is
never build an HF model and stream the tensor list, skipping model.visual.*.

Two prerequisites land before any loader work. Storage does not fit:
/var/lib/models is 58.7 GB against a 55.56 GB snapshot plus a ~24 GB tile
cache, both present at once during conversion. And hugepages are now the
dominant RAM consumer — 4x1G per Blackhole device means 8 GiB of the 16 GiB
reserved at boot and never reclaimable, leaving ~7 GiB, so hugepagesPerCard
is itself a dial.

Route A (build the tile cache on a host with RAM, copy the ~24 GB result)
needs no loader code at all and keeps the snapshot off this host entirely —
gated on whether the cache is host-portable and whether tilization needs a
device. Route B is the streaming tilizer, and the thing to upstream.

Adds two NixOS-side items: a MemoryMax on the loader so a regression fails
diagnosably rather than inviting the OOM killer on a box with 7 GiB spare,
and an explicit "do not add swap", which would convert a memory problem into
an unbounded-latency one on the same SSD the weights stream from.
docs: BFP4 outranks everything, and correct the prefill MFU I got wrong
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 4s
afb65010e2
Two operator questions: find a compatible Q4 quant, and would BlockFP4 halve
the compute versus BlockFP8.

**Correction first, because it changes the ranking.** SATURATION-PLAN
measured prefill against ~1,217 TFLOP/s, taken from the vendor's "664 TFLOPS
BLOCKFP8" per card. That is the LoFi peak. tt-metal's own
tech_reports/GEMM_FLOPS gives per-matrix-engine figures at Blackhole's
1.35 GHz — LoFi 5.4, HiFi2 2.7, HiFi4 1.35 TFLOPS, from cycles-per-tile of
16/32/64 — so a model running bfloat8_b matmuls at HiFi2 has 594 TFLOP/s
across two cards, not 1,217. Measuring against a peak the workload cannot
reach understated prefill efficiency by exactly 2x:

  prefill MFU   4k: 17.7 -> 35.8%   64k: 13.2 -> 27.0%   256k: 10.3 -> 21.2%

So prefill at short context is already respectable (mature CUDA is 40-50%)
and the gap is specifically long-context attention, worth ~1.5-2x rather
than the 2-4x previously claimed.

**On Q4:** there is no Q4 checkpoint to download for this path, because
device precision is chosen by tt-metal, not the checkpoint. GGUF/AWQ/GPTQ/
NVFP4/EXL3/MLX are all unusable — the pinned vllm-tt-plugin has zero
quantization references at all, since dtype is model-side. The device format
is already mixed: bfloat8_b weights with bfloat4_b on MLP gate/up. So the
real "Q4" lever is extending bf4 to more tensor groups, which needs no
calibration and no download.

**On BlockFP4 halving compute: yes, ~2x, but the mechanism is math
fidelity** — BFP4 pairs with LoFi (16 cycles/tile) where BFP8 pairs with
HiFi2 (32), so it is the fidelity phase count that halves, not the format
size. Upstream's measured numbers are more modest, ~1.3-1.9x for BFP4 over
BFP8. Important caveat: storing bf4 while the matmul still runs HiFi2 buys
the memory saving and none of the compute, and which fidelity a dtype pairing
selects is version-dependent (tt-metal #39627 is actively changing the
bf16 x bfp4 schedule). Measure it — the TT-NN profiler reports Fidelity
Stall Rate and HiFi Fraction directly.

BFP4 is now ranked above on-device sampling, chunked prefill and the second
cable, because it moves all three constraints at once: weights 27.49 ->
~14.5 GiB, decode roofline 34.7 -> ~66 tok/s, KV budget 33.9 -> ~47 GiB so
4x256k becomes 5-6, and the matmul peak doubles if LoFi engages.

Also verified Qwen/Qwen3.8-27B-FP8 IS genuine block FP8 — 407
weight_scale_inv entries, quant_method fp8/e4m3 — which is the format
tt-metal's is_fp8_checkpoint keys on, and 30.9 GB against 55.6 GB. That
helps loading and storage, not speed. STAGING.md's claim that no model in
this family ships block-FP8 is now out of date.

And DECODE-OPTIMIZATION said no DFlash drafter existed for the 27B; z-lab
has since published one. Noted, though the GDN-rollback blocker is unchanged.
docs: make FP8/BFP4 the plan's second and third iterations, with a coverage map
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
c2b2ee5805
Operator direction: run FP8 or ideally FP4 and push the envelope.

Two NVFP4 builds of this exact model exist, and checking them answered a
question we were about to answer by experiment.

Neither loads. Both are quant_method: compressed-tensors, whose tensors are
weight_packed + weight_scale + weight_global_scale (4-bit packed two per
byte, per-group FP8 scales at group_size 16, plus a global scale).
tt-metal's is_fp8_checkpoint keys on weight_scale_inv and expects
DeepSeek-style block FP8 — different naming, different scale hierarchy,
different packing. An NVFP4 loader is real work and not on the critical path.

But read together they are a published, validated 4-bit coverage map for
these exact weights:

  unsloth (23.4 GB, mixed): 4-bit on mlp.(gate|up|down)_proj for layers
    0-55; 8-bit on self_attn.(q|k|v|o)_proj, linear_attn projections,
    lm_head, AND layers 56-63 MLP; kv_cache_scheme num_bits 8.
  QUASAR (20.6 GB): 4-bit on all Linear — but QAT-trained, which is
    evidence that uniform 4-bit is NOT free post-training.

So mlp.down_proj tolerates 4 bits in early/middle layers (tt-metal keeps it
at bf8 today — the first free win), the last 8 layers do not, and attention
projections stay 8-bit. That turns "sweep every tensor group" into a single
targeted step, and independently corroborates QWEN_SDPA_BF8 as the KV
setting.

Also records the stacking caveat: if the device target is bf4, the bf16
checkpoint is the cleanest source, since FP8 -> bf4 is two lossy steps rather
than one. Probably small, cheap to check by PCC-ing the same tensor tilized
from both — worth knowing before FP8 becomes the default, because its benefit
is loading convenience and that does not justify an accuracy cost.

The loop now sequences this: one anchoring baseline on bf16/bf8 (a baseline
measured at a different precision than the external report is not a
baseline), then FP8, then bf4 on down_proj, then the 4x256k target config.
Steps 2 and 3 stay separate because they change different things and
stacking them makes an accuracy regression unattributable.
docs: two-host Big-Mesh is supported by tt-metal, blocked elsewhere
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
ff3c10f5b3
Operator plan: one p150a per host in cfx-llm1/cfx-llm2, cabled over QSFP-DD,
one model across both cards, cfx-llm1 as "host" and cfx-llm2 as "client".

The architecture is right — QSFP-DD links are card-to-card and never traverse
the host, so the chassis a card sits in is irrelevant to the fabric — and
tt-metal supports exactly this as **Big-Mesh**: all processes share one
logical mesh in SPMD lockstep, explicitly for TP and DP. Not to be confused
with Multi-Mesh, where each process owns a different mesh over sockets, which
is pipeline parallelism and not what we want.

Mechanics: tt-run spawns one MPI process per host; a rank-binding YAML maps
ranks to hardware; for Big-Mesh the ranks share a mesh_id and mesh_host_rank
becomes 0, 1, ... So "host"/"client" is MPI rank 0/1 and cfx-llm1 as rank 0 is
fine. We would need a custom mesh graph descriptor: every shipped MGD, p300
and p150_x2 included, declares host_topology dims [1,1], and two hosts needs
[1,2]. That is a textproto, not a C++ patch. SPMD is strict — every rank must
execute an identical op sequence or the run HANGS rather than erroring, which
argues for deploying both hosts from one Nix closure.

Two blockers.

Software: the stock-vLLM + vllm-tt-plugin route cannot launch a multi-host
engine. The plugin has tt.rank_binding, launcher.py and TTCoreEngineLauncher,
but its own test says CoreEngineLauncher / EngineLaunchPlan "exist only in the
tenstorrent/vllm fork, so the whole module skips on stock vLLM" — and the fork
is what upstream is deprecating. Options: use the fork, contribute the missing
classes to the plugin (the right fix, plausibly modest), or drive the mesh
from the tt-metal demo path to measure the topology before choosing.

Physical, and it decides everything: cfx-llm1 is at site 2 and cfx-llm2 at
site 1, per the 2026-08-15 relocation. QSFP-DD is direct-attach — DAC ~3 m,
AOC ~100 m, one cable between the two cards. Across two sites there is no
cable to run and the tailnet cannot substitute, because the fabric is not IP.
This plan needs the hosts in the same rack.

Also records what the fallback costs, since it is not a small difference:
separate single-card hosts cap at ONE sequence each (prefill_masked_bucket
asserts B_batch == 1, batched prefill needs num_devices > 1), 27B decode drops
18.19 -> 7.8 tok/s, 64k OOMs, and the 9B becomes the sensible model. And the
risk to measure first: the data plane is unchanged but dispatch now
coordinates over MPI, which lands on decode's already 26 ms/token of host
overhead. Measure decode, not prefill.
docs: park the two-host mesh, and rule out the host before RMA
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 4s
a525ca0cbe
cfx-llm1's card appears DOA and that host is going offline, so the cluster
runs one card in cfx-llm2. The analysis stays: it applies the moment a second
working card exists, and two of its conclusions apply now regardless — the
single-card B_batch == 1 concurrency cap, and a discriminator worth running
before anyone RMAs the card.

That discriminator is the point of this commit. cfx-llm1 already carries two
RX 6900 XTs, and a third large-BAR device on a board with exhausted MMIO
space or without Above-4G decoding does not enumerate at all — which looks
exactly like a dead card from lspci. So: check whether lspci -d 1e52: shows
nothing (enumeration) versus the device with a truncated BAR (BAR space), and
then move the suspect card into cfx-llm2, which now has known-good BIOS
settings and a slot known to work. If it enumerates there, the card is fine
and the host was the problem. One reseat, decisive.
feat(tenstorrent-host): let cardCount = 0 provision a host with no card
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
26c4df8a9f
cfx-llm1's p150a turned out to be DOA, but the operator wants its config
prepared and fully deployable so that seating a working card later is a
one-line change. That is not possible with the module as it stood: a positive
cardCount on a card-less host makes tenstorrent-inventory fail,
switch-to-configuration exit 4, and deploy-rs roll the generation back.

So cardCount becomes ints.unsigned, and 0 now means "provisioned, no card
installed yet":

- the driver, udev rule, device group and tooling are still installed, so the
  host is ready the moment a card is seated;
- NO 1G hugepages are reserved. This matters beyond tidiness — 1G pages are
  never returned to the host, so 4 GiB held for absent hardware would come
  straight out of cfx-llm1's llama.cpp pod headroom;
- tenstorrent-inventory records state=provisioned-no-cards and exits 0
  instead of asserting.

Verified both directions by evaluating cfx-llm1 from nixos-llm: against the
currently pinned rev it fails with "not of type `positive integer, meaning
>0'", and with this module it builds and emits no hugepage kernel params,
while cfx-llm2 at cardCount = 1 emits hugepagesz=1G hugepages=4.

Also updates TWO-HOST-MESH: the plan is parked, cfx-llm2 is the mesh rank 0
per the operator, and there is a discriminator to run before anyone RMAs the
card — cfx-llm1 carries two large-BAR GPUs already, and a third such device
on exhausted MMIO space does not enumerate, which looks exactly like DOA.
Moving the card to cfx-llm2 settles it for the cost of one reseat.
docs(two-host-mesh): cfx-llm2 is rank 0, and cfx-llm1 is provisioned not absent
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
2274cb070a
Two corrections from the operator. cfx-llm2 takes the mesh "host" role (MPI
rank 0) rather than cfx-llm1 — either can, since rank 0 is a process identity
and not a hardware property. And cfx-llm1 is not simply offline: it stays
provisioned for a card at cardCount = 0, so a working replacement is a
one-line change plus a reboot rather than a fresh bring-up.
feat(tenstorrent-host): separate card-presence assertion from resource sizing
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
349b9fd593
Overloading cardCount = 0 to mean "provisioned, no card" conflated two
things and got one of them wrong: it also suppressed the hugepage
reservation, but a host being prepared for a card wants those pages reserved
so that seating the card needs only a reboot.

So cardCount is now purely the sizing number — how many cards to reserve 1G
hugepages for — and the new assertCardsPresent decides whether
tenstorrent-inventory fails on a shortfall. A host provisioned ahead of its
hardware sets cardCount = 1 with assertCardsPresent = false: pages reserved,
driver and udev in place, and the deploy still succeeds. Without that split,
a positive count on a card-less host fails the unit, exits 4, and deploy-rs
rolls the generation back.

cardCount = 0 keeps its meaning of reserving and asserting nothing.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack!4
No description provided.