Repository navigation
contract: every chip checks each chip's qwen27 control edit matches its source once, so an M4 run sees a stale M5 edit - #3343
Conversation
|
@cshintov READY. The validation checks all three applicable edits across both tensor-unit settings before selecting the device path. The contract host compile and five launch-map tests pass. A source-only probe also catches missing and repeated M5 anchors. This applies cleanly beside the Llama GEMM control repair. Serving and kernel arithmetic are unchanged. Queued to land after the 1.2.9 cut.
|
14ba0d0 to
738e5e1
Compare
|
Rebased onto main e7e2424 after the 1.2.9 cut (head 738e5e1). The only change is the changelog line, which moved back under Unreleased; a plain merge would have put it in 1.2.9. |
…ts source once, so an M4 run sees a stale M5 edit
738e5e1 to
ad1a895
Compare
|
Thank you @cshintov. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Thanks @cshintov! This is in TensorFold 1.2.10, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.10
|
…ask 2) The ashhart#3343 loop in Suite.collect passed each tensor-unit flag to controlEdit and at_.geometry, which now take the shared-prefix decision, so on the pre-M5 source the decode edit was never checked though the control is registered there. Call sharedPrefix as Attn.init does, so the decode control edit is checked against the pre-M5 source too.
…ask 2) The ashhart#3343 loop in Suite.collect passed each tensor-unit flag to controlEdit and at_.geometry, which now take the shared-prefix decision, so on the pre-M5 source the decode edit was never checked though the control is registered there. Call sharedPrefix as Attn.init does, so the decode control edit is checked against the pre-M5 source too.
…ask 2) The ashhart#3343 loop in Suite.collect passed each tensor-unit flag to controlEdit and at_.geometry, which now take the shared-prefix decision, so on the pre-M5 source the decode edit was never checked though the control is registered there. Call sharedPrefix as Attn.init does, so the decode control edit is checked against the pre-M5 source too.
…ask 2) The #3343 loop in Suite.collect passed each tensor-unit flag to controlEdit and at_.geometry, which now take the shared-prefix decision, so on the pre-M5 source the decode edit was never checked though the control is registered there. Call sharedPrefix as Attn.init does, so the decode control edit is checked against the pre-M5 source too.
What this changes
Suite.collectinmetal_q27_attn_rows.zigfirst builds the attention source for both tensor-unit settings and requires each control's edit to occur exactly once. On a mismatch it prints which control, which setting and the count, and returnserror.ControlEdit.Why: #2106's last commit changed
q27_attn_prefix's line toMASKED && q27_nonfinite(, and the M5 decode control's edit went stale (fixed in207ebc7fd). Before M5 the decode control isn't registered, so a pre-M5 run never built that edit, and our M4 contract passed. With this check, a pre-M5 run fails on a stale M5 edit too.Design
Choice: check the edit's source text once, up front, for both settings, on every chip. It reads source only, so it costs milliseconds and needs no device with tensor units.
Alternatives considered:
Checks
4ddc28cfc, an M4 Pro (no tensor units).tf-kernel-contract --only qwen27:SUMMARY 30 kernels: 30 pass gates 1-4, 0 fail, 0 known findings; 3 controls: 3 red as planted, 0 missed; 0 limit problems, exit 0.fromput back toconst bool masked = q27_nonfinite((the text before207ebc7fd), the same run on the M4 exits 1:control edit for decode rows (tensor units true) matches 0 times, not once: const bool masked = q27_nonfinite(, thenerror: ControlEdit.zig fmt --check: clean.tools/pr_check.py: 0 errors, lean 341 against 341 (0 new).