docs: correct the mesh descriptor from an external 2-card silicon report #4
No reviewers
Labels
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack!4
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/claude-auth/two-card-external-report"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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, GSM8K58/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
p150_x2descriptor'spolicy: RELAXEDallows a one-cable startTT_FATAL: Expected 4 eth linkson correctly cabled hardware. One QSFP-DD cable trains 2 links. Usep300_mesh_graph_descriptor.textproto(channels { count: 2 })TT_MESH_GRAPH_DESC_PATH"not needed" on siliconOur 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 = 2in 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):
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-stagetop-k (biggest, and a real upstream contribution) → second cable (needs the
num_linkspatch 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 -raftercabling; 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 foreach, 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 oftheir own — #53320 had pinned a
ttnn.slicebatch bound to a literal1,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 adependency.
Tier: docs only. No module, package or script changes.
The nixos-llm side is nixos-llm#490, updated in step.
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.mdDerived 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 is2 × 4 kv_heads × 256 head_dim × 16 layers= 32,768 elem/token → 64 KiB at bf16, ~33 KiB atbfloat8_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 × 256kfits at 32 GiB (6% margin — verify, don't assume),8 × 128kfits, and8 × 256kmisses by ~1.9×.cfx-llm0's
kvarn_k4v2_g128(~3 bits) does not transfer, and not for want of a flag: the pinnedvllm-tt-pluginhas zero occurrences ofkv_cache_dtype, readscache_config.cache_dtypeonly for vLLM's block accounting (device allocation is model-side in tt-metal), and resolves it throughSTR_DTYPE_TO_TORCH_DTYPE, which cannot express kvarn. Recorded as a footgun:--kv-cache-dtype fp8on 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.mdUtilization against 1,217 TFLOP/s and 1,024 GB/s (two cards, 110 of 120 Tensix):
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_8is 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-forgeis the MLIR coverage stack and should not replace the serving path, which dispatches to hand-written tt-metal model code via the plugin'sEXTRA_MODELS_DIRcontract — but tt-lang is the right tool for porting Triton-class KV-quant kernels.tt-model-manageris 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.mdThe 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 theTT_METAL_WATCHER=0trap: 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/healthcan 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.slicebatch bound to a literal1and silently discarded every user past the first at B≥2 — it survived because the module's tests only ranbatch_size=1. Hence per-op PCC at B=4, and GSM8K at the serving config and long context, not at 4k, sinceQWEN_SDPA_BF8is upstream-gated with an explicit long-context PCC caveat. Plus a wall-clock wedge watchdog:pytest --timeoutuses 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.
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.