ttx: rapid-prototyping loop for 1 and 2 P150a cards (Phase C) #70
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!70
Loading…
Reference in a new issue
No description provided.
Delete branch "ttx"
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?
Phase C of the harness overhaul: the rapid-prototyping loop for 1 and 2 P150a cards.
What lands
tools/ttx: one stdlib-Python CLI. It covers the arm TOML (bench/arms/), per-card slots over flock (it holds the legacy/tmp/ttlockfor unmigrated drivers), content-addressed overlay staging, a keyed tensor cache (model/rev/weight-env hash, seeded by hardlinks), passthrough of only the arm's cards, and a fail-closed identity check (verify-arm-banners.sh,[expect], served root). It also has the smoke/sweep32k/infbench suites, schema-v1 records, a gracefuldown, a paired TP=1abwith card swap, and thedev sync|cycle|restartedit loop.bench/arms/prod.toml==modules/tenstorrent-serving.nix, enforced by a test that builds the ExecStart and diffs it (plus the prefix-caching variant).scripts/vllm-tt-serve.shis a thin shim overttx serve-legacythat keeps its CLI. A test diffs it against the frozen pre-ttx script.bench/ab/sweep-32k.shruns overttx run --suite sweep32k, and there is a newbench/ab/smoke.sh.images/+tools/tt-image+pins/: tt-base per pin from the nightly ttnn. It was built on nixos and pushed to git.bitp.cz/bitpartner/tt-base (verify_onecommit passes; the negative control fails as it should). tt-serve@digest is design-only in docs/BUILD.md, and the unit is unchanged.tt-card-slotandtt-bench, plus the updated docs/DEV-LOOP.md.Hardware
Measurements are pending on the shared lock and will be posted as a comment with records in
bench/runs/ttx-*.jsonl. They cover TP=1 load, boot and RSS solo and side by side on G2 bfp4, the TP=2 edit->measure cycle, and a prod boot with the B=1 PP/TG probe. TP=1 decode is not usable yet: the MTP branch hits TT_THROW program.cpp:2066 after load. So TP=1 is measured as load and hold only.Not done
🤖 Generated with Claude Code
👀 Security review of PR #70 (ttx: rapid-prototyping loop for 1 and 2 P150a cards, Phase C)
Verdict
approve — security-sensitive surface is clean. No findings.
Tier
T1 — internal developer workflow tool on cfx-llm2 (P150a inference), self-hosted, runs under operator-owned Tailscale. No public exposure, no network egress, no secrets.
Concerns
Injection
Secrets / credentials
Supply chain / remote code fetch
Concurrency / resource
Notes (non-blocking)
Added in
3b7ad10: a disk guard, a cache registry and gc.Why: a tensor-cache build crashed in tt-metal (serialization.cpp written==bytes) when a parallel agent's 20 GB cache filled /var/lib/models-sata.
ttx upreserves what the cache still needs before it boots. That is the expected size (registry-measured for the same checkpoint and mesh, else models.toml cache_gb) minus what is present, plus a 3 GB margin. It subtracts the other ttx builds in flight, and refuses with a record if the space is short.ttx cache ls [--du]lists them.ttx cache gc --keep-days N [--dry-run]deletes only keyed caches ttx built. It never deletes one that the prod unit, a running container, a held slot or a build in flight references.cache lsandgc --dry-runboth run, and gc would delete 0 GB.reserverefuses with rc 3 on box python.Heads-up on a merge interaction, from the deploy work in #73.
#73 changes what
modules/tenstorrent-serving.nixrenders whenenablePrefixCaching = true: block size 2048 instead of 64 (the cache hashes whole blocks, so hash_block_size must divide every KV group and the attention and mamba block sizes must be equal — vLLM refuses unequal ones), plus--mamba-ssm-cache-dtype bfloat16, plus an assertion thatpoolTokens <= 786432(a traced decode at POOL 1M with caching on is on record OOMing the device).Run against this branch's arms with #73's module,
tools/ttx/testsis 40/41. The one failure isProdPrefixMatchesNix.test_serve_args, exactly as designed —bench/arms/prod-prefix.tomlstill says--block_size 64and lacks--mamba-ssm-cache-dtype. Whichever of the two PRs lands second should update that file; I did not touch it because it does not exist on master and I did not want to carry your file in an unrelated PR.Two other notes for this branch, both from the same work:
models.tomlwants an entry for the packed G2 checkpoint. #73 serves/var/lib/models-sata/bfpq/packed-G2(bfp4-packed-v1, 20.6 GB) rather than the unpackedckpt-G2. The entry is quoted verbatim in the header ofbench/arms/prod-g2-prefix.tomlin #73 so it can be pasted in.prod.tomlpins the tensor cache to/var/lib/models/tt-cachebecause that is what the unit did. #73 makes that acacheDiroption, because the unit's hard-coded path is a live hazard on any checkpoint change: tensorbins are named for the tensor and its dtype, never the checkpoint, and ThinkingCap has the same keys and shapes as Qwen3.8, so amodelDirchange would not miss and rebuild — it would hit, and serve the other checkpoint's weights with every banner green. Yourmodels.tomlalready warns about this forttx cache seed; it now applies to the unit too.Separately:
ttxearned its keep here.ttx renderagainst the unit's rendered ExecStart caught both the cache-path bug and the prefix block-size/pool bug before any card time was spent, which is the whole argument fortest_prod_matches_nix.pyexisting.Merge-train review (merging
ttxinto master as part of the 2026-09-25 push-to-master directive).Production behaviour: unchanged, and the checks that prove it now actually run.
modules/tenstorrent-serving.nixis untouched by this branch.tools/ttx/tests/test_prod_matches_nix.pybuilds the unit's rendered ExecStart and diffs env, devices, docker options, mounts, image and vLLM argv againstbench/arms/prod.tomland the prefix variant — passing.scripts/vllm-tt-serve.shkeeps its CLI, profiles and env knobs.test_legacy_serve.pyruns the frozen pre-ttx script withsudostubbed and diffs the docker argv across 10 profile/env cases, comparing mounts by file CONTENT (ttx mounts a content-addressed staged copy) — passing.modules/tenstorrent-host.nixonly gainsleakSampler, default off.CI was red on this branch since #199 and is now green (task #222). The cause:
lib/slot.shshells out toflockandawk, the runner has neither, and the step invokedpython3alone, so all 9test_slotcases failed on a PATH they never declared. The step now runs undernix shellwith bash/util-linux/gawk/coreutils from the flake-locked nixpkgs, andsetUpnames the missing tool instead of asserting on an exit code. Found with temporary per-gate and per-module diagnostic jobs, now reverted. All 41 tests pass in CI and locally.Post-PR-#68 hygiene after merging master in: docs/ still 11 files, no root CLAUDE.md, AGENTS.md still the lean rewrite,
QWEN36_PREFILLED_SLOTS_FIXstill present inqwen36_vllm.py, and nothing PR #68 deleted came back — the 78 files added versus master are all new ttx/arms/images/records. The one conflict wasdocs/LEDGER.md:R-2026-09-25-hostleakandR-2026-09-25-dspark-tcwere both kept, in date order.agent-gateway closeout (merged): cleared
agent:*labels.Hermes kanban card (if any) is left for Hermes to archive/complete.