fix(tenstorrent-host): a not-yet-booted generation is not a card fault #5

Merged
multica-agent merged 1 commit from agent/claude-auth/inventory-pre-reboot into master 2026-09-04 13:14:06 +02:00
Member

Fixes a real rollback. nixos-llm CI run 1449 deployed cfx-llm2 and then reverted it, because tenstorrent-inventory asserted on the card count before checking whether the generation had booted.

On a first deploy the running kernel has neither the 1G hugepage reservation nor tt-kmd loaded, so /dev/tenstorrent is empty and found is 0. The unit failed → switch-to-configuration exit 4 → deploy-rs read a broken activation and rolled back. So a correctly configured host with a perfectly healthy card could never reach the reboot that would have made the check pass.

The reboot detection was already there — I added it in #4 — but it only guarded the hugepage branch. The card branch ran first and unconditionally, which made the guard useless on exactly the deploy it was written for.

Fix: hoist the "has this configuration actually booted?" test above both checks. If the running cmdline does not carry the expected hugepages=N, record state=reboot-required and exit 0 regardless of card count. After a boot with the reservation in place both assertions apply as before, so a card that stops enumerating or a genuine contiguous-memory shortfall still fails loudly. Also drops the now-duplicated cmdline grep.

Evidence this is the right diagnosis, from the deploy tracker for run 1449:

host result
cfx-llm1 success (41 s) assertCardsPresent = false — worked as intended
cfx-llm2 failed (189 s) assertCardsPresent = true, no boot yet → card check fired
cfx-mgmt, reborn_new, cfx-llm3, cfx-llm0 success
nixos failed unrelated: a gitea-runner-fluxion breakage dating to 2026-09-02

Docs only otherwise. Tier: module change, no packaging or spec impact.

Fixes a real rollback. nixos-llm CI [run 1449](https://git.bitp.cz/bitpartner/nixos-llm/actions/runs/1449) deployed cfx-llm2 and then reverted it, because `tenstorrent-inventory` asserted on the card count **before** checking whether the generation had booted. On a first deploy the running kernel has neither the 1G hugepage reservation nor `tt-kmd` loaded, so `/dev/tenstorrent` is empty and `found` is `0`. The unit failed → `switch-to-configuration` exit 4 → deploy-rs read a broken activation and rolled back. **So a correctly configured host with a perfectly healthy card could never reach the reboot that would have made the check pass.** The reboot detection was already there — I added it in #4 — but it only guarded the *hugepage* branch. The card branch ran first and unconditionally, which made the guard useless on exactly the deploy it was written for. Fix: hoist the "has this configuration actually booted?" test above both checks. If the running cmdline does not carry the expected `hugepages=N`, record `state=reboot-required` and exit 0 regardless of card count. After a boot with the reservation in place both assertions apply as before, so a card that stops enumerating or a genuine contiguous-memory shortfall still fails loudly. Also drops the now-duplicated cmdline grep. Evidence this is the right diagnosis, from the deploy tracker for run 1449: | host | result | | | --- | --- | --- | | cfx-llm1 | **success** (41 s) | `assertCardsPresent = false` — worked as intended | | cfx-llm2 | **failed** (189 s) | `assertCardsPresent = true`, no boot yet → card check fired | | cfx-mgmt, reborn_new, cfx-llm3, cfx-llm0 | success | | | nixos | failed | unrelated: a `gitea-runner-fluxion` breakage dating to 2026-09-02 | Docs only otherwise. Tier: module change, no packaging or spec impact.
fix(tenstorrent-host): a not-yet-booted generation is not a card fault
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
714e339ab8
This failed a real deploy. nixos-llm CI run 1449 deployed cfx-llm2
successfully and then rolled it back, because tenstorrent-inventory asserted
on the card count before checking whether the generation had booted.

On a first deploy the running kernel has neither the 1G hugepage reservation
nor tt-kmd loaded, so /dev/tenstorrent is empty and `found` is 0. The unit
failed, switch-to-configuration exited 4, deploy-rs read that as a broken
activation and reverted — which means a correctly configured host with a
perfectly healthy card could never reach the reboot that would have made the
check pass. The reboot detection existed but only guarded the hugepage
branch, so the card branch fired first and unconditionally.

Fixed by hoisting the "has this configuration actually booted?" test above
both checks: if the running cmdline does not carry the expected
`hugepages=N`, report state=reboot-required and exit 0 regardless of card
count. After a boot with the reservation in place, both assertions apply as
before, so a card that stops enumerating or a genuine contiguous-memory
shortfall still fails loudly. Also removes the duplicated cmdline grep.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!5
No description provided.