feat(tenstorrent): allowlist MistralForCausalLM + device-aware gate - #431
feat(tenstorrent): allowlist MistralForCausalLM + device-aware gate#431lu-zero wants to merge 2 commits into
Conversation
|
The Blackhole device evidence and restored backend-proof assertions make this worth re-reviewing, but the branch is currently conflicting with |
ec9e73e to
61be154
Compare
…den is binary, so no golden-bearing PR could merge (#615) (#619) Retires the fail-closed binary guard in scripts/check-pr-size.py (#615), and classifies .agents/oracles/* (#668). WHY THE BINARY GUARD GOES. It errored on any path git reports as binary, with no exemption route. Parity goldens ARE binary, so no PR capturing an oracle golden could merge -- blocking #431 and every future golden across the ROCm, Tenstorrent and Nemotron lanes. The guard also contradicted this checker's own model (the SITE_ASSET note says binaries "take the `asset` class the same way any other shipped artwork does"), post-dated the golden precedent it rejected by one day (450a1b6 2026-08-10 vs 971d550 2026-08-09), and a commit already on main (5080983, 16 .npy files) trips it. A rule nothing in the tree can satisfy is not enforcing a standard. Explicit classification is KEPT and still refuses an unclassified binary, now with a message naming the real defect instead of an unfixable property of the file. No allowlist was added: a roster of blessed binary paths is a shared must-write surface, which is the lock AGENTS.md forbids. This removes no size rule because none was left -- the per-class budgets were retired 2026-08-10. Nothing in this file measures a diff. Reviewed by a fresh agent that did not write it: every claimed number reproduced, all four sabotage mutations were caught (reintroduce the guard, break classification, disable the evidence contract, break the PR-required check), and seven adversarial commits confirmed the checker still refuses an unclassified binary, a checker change without evidence, and a binary posing as its own evidence. Its scope finding -- that goldens classify as `product`, so this admits binaries to src/ and scripts/ too -- is recorded in the spec as an accepted trade rather than argued away. ALSO FIXES #668. The secondary-oracle registry landed .agents/oracles/<id>.md with no pattern here, so all eight files were unclassified and classify_path RAISED on unmodified main -- meaning any PR recording an oracle pin was refused by a required check. Takes the same `procedure` class as .agents/specs/ and .agents/claims/, which it is structurally identical to. Deliberately a pattern, not a directory exemption: a non-.md or nested path there still fails closed. device-leakage and sanitize-cpu are red on main itself and inherited by the merge; this PR touches no C++. Both are being fixed separately. Closes #615. Closes #668.
|
I've pushed two commits to this branch ( The blocker that was ours is gone. Merged main in rather than rebasing. A rebase would rewrite your commits and need a force-push to your fork. The merge keeps them byte-identical, and as a side effect it makes Three real gate defects, all in the copied Qwen3 pattern:
Records. Filed #670 — the row, spec and claim all cited PR #354, which is a merged PR rather than an issue, so nothing in the tree pointed at anything trackable. It's now linked in the roadmap table, the spec and the PR body. Three records disagreed on lifecycle state (matrix The oracle was named wrong in four places — comments and the spec's port map said Added the mutation evidence the BACKEND ratchet bump requires ( On the remaining red check. I also diffed the final tree against a clean merge of main with your head: it differs by exactly the edits above, nothing of yours or of main's was lost. Merging once CI settles. The gate work itself was sound — the Blackhole numbers reproduce from your committed goldens, and |
BACKEND-TENSTORRENT-MISTRAL (child of BACKEND-TENSTORRENT). Allowlist MistralForCausalLM (Mistral-7B-v0.3, Apache-2.0: GQA 32/8, head_dim 128, plain rope theta 1e6, untied lm_head, full attention) on the TT platform, and make test_mistral_paged_engine.cpp device-aware so it runs on Blackhole against a Tenstorrent-appropriate golden pair (not the CUDA one). Mistral reuses the Qwen3-dense forward verbatim (mistral_registry.cpp:7-11: MistralModel == Qwen3DenseModel with qk-norm skipped + plain rope + untied lm_head). Every op the forward dispatches is already registered on kTENSTORRENT; the one new op vs Qwen3-0.6B is an untied kMatmul lm_head (Qwen3-0.6B ties it), already registered. No new kernel, no model code change -- the change is the platform allowlist line + the test's device-awareness, mirroring test_qwen3_paged_engine.cpp:221-296. On-card verified (real Blackhole P150): the platform allowlist assertion passes (814/814, +1), and the gate loads the 7B checkpoint (caa1feb0e54d415e2df31207e5f4e273e33509b1, downloaded for this row), selects device type 6 (TENSTORRENT), and the op-registration proof passes (20/21 assertions; the 1 failure is the intended "TT golden pair absent" REQUIRE_MESSAGE -- the golden capture is pending, not a code defect). The e2e golden capture + full gate run are pending a persistent shell + the dgx vLLM oracle (the qwen3-neartie-gap.py teacher-force belongs on the dgx, not this AArch64 box; the 7B cold-JIT bootstrap is too long for this session's foreground tool calls). Exact resume recipe is in the spec's FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: Maki:glm-5.2 [Maki]
…goldens
The e2e gate ran on real Blackhole P150 via the setsid background-monitor
pattern (this harness reaps foreground calls at 120s but a setsid job
persists and is pollable across calls).
Chain:
1. VT_DUMP_IDS=1 bootstrap (~6min cold JIT) -> our_ids_tenstorrent.i32
2. scripts/qwen3-neartie-gap-transformers.py (Grok's AArch64-vLLM-free
tool, already on main; same one used for the Qwen3-0.6B TT golden)
with python_env (torch 2.7.1+cpu, transformers 5.8.1) ->
our_ids_tenstorrent.npy + neartie_gap_mnats_tenstorrent.npy.
max gap 0.0625 nats.
3. Full gate on the card vs the TT golden pair.
Result: 16/16 prompts PASS (0 forward-divergent); 12/16 STRICT token-exact,
4/16 near-tie-only; max gap 0.062 nats (well under 0.5). BACKEND PROOF:
Mistral ops on device type 6 with 0 declines (kMatmul selections=256 =
the untied lm_head ran on device; kPagedAttention=8192).
DEVIATION recorded (POL-ORACLE): the gap golden is transformers-
teacher-forced, NOT vLLM 0.25.0 -- same ratified Qwen3-0.6B TT precedent.
Process-exit SIGSEGV (139) is the known MeshDevice teardown crash (handoff
§7.5), NOT a gate failure: 127/128 doctest assertions passed, the one
"failure" is doctest counting the SIGSEGV at exit; the gate's own
REQUIRE(fail==0) held and 16/16 + BACKEND PROOF printed before the crash.
Matrix row -> ACTIVE.
FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: Maki:glm-5.2 [Maki]
0854b2d to
9a178a2
Compare
Status: READY FOR REVIEW — Mistral-7B-v0.3 gate PASSED on Blackhole
BACKEND-TENSTORRENT-MISTRAL(child ofBACKEND-TENSTORRENT). AllowlistMistralForCausalLM(Mistral-7B-v0.3, Apache-2.0) on the TT platform and maketest_mistral_paged_engine.cppdevice-aware so it runs on Blackhole against a Tenstorrent-appropriate golden pair.Mistral reuses the Qwen3-dense forward verbatim (
mistral_registry.cpp:7-11:MistralModel == Qwen3DenseModelwith qk-norm skipped, plain rope theta 1e6, untied lm_head). Every op is already registered onkTENSTORRENT. The one new op vs Qwen3-0.6B is an untiedkMatmullm_head (Qwen3-0.6B ties it), already registered. No new op, no new kernel, no model code change.On-card result (real Blackhole P150)
Full e2e gate ran via a background-monitor pattern; chain:
VT_DUMP_IDS=1bootstrap (~6 min cold JIT) →our_ids_tenstorrent.i32scripts/qwen3-neartie-gap-transformers.py(the AArch64-vLLM-free oracle Grok wrote for the Qwen3-0.6B TT golden, already on main) withpython_env(torch 2.7.1+cpu, transformers 5.8.1) →our_ids_tenstorrent.npy+neartie_gap_mnats_tenstorrent.npyGate: 16/16 prompts PASS, 0 forward-divergent
Process-exit SIGSEGV (139) is the known MeshDevice teardown crash (handoff §7.5), not a gate failure: 127/128 doctest assertions passed (the 128th is doctest counting the SIGSEGV at exit); the gate's own
REQUIRE(fail == 0)held and 16/16 + BACKEND PROOF printed before the crash. Same property the Qwen3-0.6B TT gate has.DEVIATION recorded (POL-ORACLE)
The gap golden is transformers-teacher-forced, not vLLM 0.25.0 (which doesn't install on this AArch64 box). This matches the ratified Qwen3-0.6B TT precedent:
scripts/qwen3-neartie-gap-transformers.pywas written and merged for exactly this situation. The near-tie band is reused; the anchor/gap pair is transformers-based and is NOT compared to the CUDAneartie_gap_mnats.npy. Recorded in the spec's## Outcomeand the matrix row.Changes
src/vllm/platforms/tenstorrent.cpp— one allowlist line.tests/vt/test_tenstorrent_backend.cpp— platform assertion extended (814/814 on Blackhole, +1).tests/parity/test_mistral_paged_engine.cpp— device-aware wiring mirroringtest_qwen3_paged_engine.cpp:221-296+ the post-loop Backend Proof block (:373-400): onkTENSTORRENTit proves the Mistral op set actually ran on the TT provider (selections > 0,declines == 0), gates againstour_ids_tenstorrent.npy/neartie_gap_mnats_tenstorrent.npy, and bootstraps viaVT_DUMP_IDS=1→our_ids_tenstorrent.i32when absent.tests/parity/goldens/mistral_greedy_7b/{our_ids_tenstorrent.npy, our_ids_tenstorrent.i32, neartie_gap_mnats_tenstorrent.npy}..agents/specs/tenstorrent-mistral.md(spec + measured## Outcome).BACKEND-TENSTORRENT-MISTRALrow in.agents/backend-matrix.md(ACTIVE), claim in.agents/coordination.md,scripts/check-agent-record.pyBACKEND 80→81.Review
Fresh static + mutation review returned CHANGES-REQUESTED on the first pass: the post-loop Backend Proof block (
selections > 0/declines == 0) had been dropped, leaving the op-registration instrumentation vacuous. Fixed (94dc2b6f): the proof block is restored againstkMistralOps, guarded by!bootstrap_only. All other review findings (kMatmul correctly included for the untied lm_head, device-golden load-bearing, allowlist routing, bootstrap-suffix data-integrity, band not weakened, seam invariant) were green.