gdn: key cached qkvzab.abpad on the a/b gap; sim-run SIM_KERNEL_OVERLAY #293

Merged
Grok merged 2 commits from fix/abpad-cache-key into master 2026-10-21 15:24:49 +02:00
Owner

Two small host-side fixes, neither changes what the cards serve.

1. Key the cached qkvzab.abpad weight on the a/b gap (u-models review finding)
The fused GDN in-projection [qkv|z|a|(gap zeros)|b] was cached as qkvzab.{il,dramshard}.abpad regardless of the gap. A different gap (other Nv/chip, TP or checkpoint) would load a weight laid out for the old gap from a warm cache, silently.

  • New qkvzab_cache_name(proj1d, gap) in gdn/tp.py.
  • Gap 8 (the served gap, (-24) % 32 at Nv/chip = 24) keeps the bare .abpad name, so the shared cfx-llm2 tensor cache stays warm (no cold rebuild for the production arms). Any other non-zero gap gets .abpad<gap>; gap 0 keeps the unpadded name.
  • The served arm's cache keys are byte-identical to master.
  • Test: tests/test_gdn_abpad_cache_key.py (pure host, AST-lifted, python3 -m unittest tests/test_gdn_abpad_cache_key.py). It checks that distinct gaps give distinct keys and that gaps 0 and 8 match the old expression.

2. scripts/sim-run.sh: SIM_KERNEL_OVERLAY from free/u-ccl
This is d9fc4258 + 4b431338 + the sim-run.sh part of 545543b3: done || exit 3 for the pipeline subshell, and an optional enforcing SIM_KERNEL_OVERLAY_MARKER replacing the RS_UNI-hard-coded marker check. Only the script is taken, with no rsuni lever files, arms, records or LEVERS rows. It is ttsim-only, and shellcheck is clean.

Checks: check-cited-records OK, utilization --check OK, shellcheck rc=0, ttx unittest 703 OK.

🤖 Generated with Claude Code

Two small host-side fixes, neither changes what the cards serve. **1. Key the cached `qkvzab.abpad` weight on the a/b gap** (u-models review finding) The fused GDN in-projection `[qkv|z|a|(gap zeros)|b]` was cached as `qkvzab.{il,dramshard}.abpad` regardless of the gap. A different gap (other Nv/chip, TP or checkpoint) would load a weight laid out for the old gap from a warm cache, silently. - New `qkvzab_cache_name(proj1d, gap)` in `gdn/tp.py`. - Gap 8 (the served gap, `(-24) % 32` at Nv/chip = 24) keeps the bare `.abpad` name, so the shared cfx-llm2 tensor cache stays warm (no cold rebuild for the production arms). Any other non-zero gap gets `.abpad<gap>`; gap 0 keeps the unpadded name. - The served arm's cache keys are byte-identical to master. - Test: `tests/test_gdn_abpad_cache_key.py` (pure host, AST-lifted, `python3 -m unittest tests/test_gdn_abpad_cache_key.py`). It checks that distinct gaps give distinct keys and that gaps 0 and 8 match the old expression. **2. `scripts/sim-run.sh`: SIM_KERNEL_OVERLAY from free/u-ccl** This is d9fc4258 + 4b431338 + the sim-run.sh part of 545543b3: `done || exit 3` for the pipeline subshell, and an optional enforcing `SIM_KERNEL_OVERLAY_MARKER` replacing the RS_UNI-hard-coded marker check. Only the script is taken, with no rsuni lever files, arms, records or LEVERS rows. It is ttsim-only, and shellcheck is clean. Checks: check-cited-records OK, utilization --check OK, shellcheck rc=0, ttx unittest 703 OK. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Believed: the ".abpad" suffix was enough to tell the padded fused GDN in-projection
apart from the unpadded one. The u-models review showed it is not: the suffix says
only "some gap", while the zero rows between a and b change the weight's layout, so
if QWEN36_GDN_AB_PAD's gap ever differs (another Nv/chip, TP, or checkpoint) a warm
tensor cache silently serves a weight padded for the old gap.

The name is now built by qkvzab_cache_name(proj1d, gap). The served gap (8, from
Nv/chip = 24) keeps the bare ".abpad" name so the cfx-llm2 tensor cache, shared with
the production arms, stays warm with no cold rebuild; every other non-zero gap gets
".abpad<gap>"; gap 0 keeps the unpadded name. The served arm's keys are byte-identical.

tests/test_gdn_abpad_cache_key.py (pure host, AST-lifted) checks distinct gaps give
distinct keys and that gap 0 / 8 match the old expression.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sim-run: SIM_KERNEL_OVERLAY from free/u-ccl, so ttsim gates compile kernel-overlay levers
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 12m0s
tt-stack-ci / Report upstream drift (pull_request) Successful in 2m12s
cards-fresh cards: queued (fingerprint has no successful verdict on this PR) fp=c3935d55d7fa8ed1
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 8m39s
tt-stack-ci / Serialized card gate (pull_request) Has been cancelled
cards-fresh / Re-check cards-fresh on open PRs (push) Successful in 13m24s
5bac97af09
Believed: a ttsim gate exercised a lever's kernel change. LEDGER R-2026-10-20-sgate
found it never did: the JIT compiled the stock kernels from the store. free/u-ccl
added SIM_KERNEL_OVERLAY (d9fc4258), fixed the swap so the overlay actually reaches
the JIT (4b431338), and in its review (545543b3) made a failed overlay stop the
script (`done || exit 3`; the loop's exit ran in a pipeline subshell) and replaced
the RS_UNI-specific marker warning with an optional, enforcing
SIM_KERNEL_OVERLAY_MARKER. Only scripts/sim-run.sh is taken; the rsuni lever is
NOGO and stays on its branch. No served path changes: sim-run.sh is ttsim-only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner

verdict: approve
tier: T1

rationale: Two small host-side, off-by-default fixes that change nothing served. (1) qkvzab_cache_name() keys the fused GDN in-projection tensor cache on the a/b gap; gap 8 (served: (-24)%32 at Nv/chip=24) keeps the bare .abpad name so the cfx-llm2 cache stays byte-identical to master, gap 0 keeps the unpadded name, any other gap gets .abpad<gap> — closing the warm-cache-serves-wrong-gap hole. (2) sim-run.sh gains an optional SIM_KERNEL_OVERLAY (symlink farm + per-file replace, chmod u+w on store dirs, trailing-newline read guard, done || exit 3 for the pipeline subshell, optional SIM_KERNEL_OVERLAY_MARKER that refuses a silently-stock kernel) — pure ttsim tooling, unset = no-op, cited as d9fc4258+4b431338+545543b3 with no rsuni lever files taken.

concerns:

  • [warn] scripts/sim-run.sh — once merged, SIM_KERNEL_OVERLAY / SIM_KERNEL_OVERLAY_MARKER become the standing default for every future sim run (they default empty, so today's behavior is byte-identical, but the enforcing-marker semantics become the repo norm). Deliberate, per the PR, but flag at close-out.
  • [warn] Card A/B not part of this PR — no arms/records ship; nothing to re-screen, but the gdn cache-key fix is only exercised on a card by any future gap≠8 arm run.
**verdict:** approve **tier:** T1 **rationale:** Two small host-side, off-by-default fixes that change nothing served. (1) `qkvzab_cache_name()` keys the fused GDN in-projection tensor cache on the a/b gap; gap 8 (served: `(-24)%32` at Nv/chip=24) keeps the bare `.abpad` name so the cfx-llm2 cache stays byte-identical to master, gap 0 keeps the unpadded name, any other gap gets `.abpad<gap>` — closing the warm-cache-serves-wrong-gap hole. (2) `sim-run.sh` gains an optional `SIM_KERNEL_OVERLAY` (symlink farm + per-file replace, `chmod u+w` on store dirs, trailing-newline `read` guard, `done || exit 3` for the pipeline subshell, optional `SIM_KERNEL_OVERLAY_MARKER` that refuses a silently-stock kernel) — pure ttsim tooling, unset = no-op, cited as d9fc4258+4b431338+545543b3 with no rsuni lever files taken. **concerns:** - [warn] `scripts/sim-run.sh` — once merged, `SIM_KERNEL_OVERLAY` / `SIM_KERNEL_OVERLAY_MARKER` become the standing default for every future sim run (they default empty, so today's behavior is byte-identical, but the enforcing-marker semantics become the repo norm). Deliberate, per the PR, but flag at close-out. - [warn] Card A/B not part of this PR — no arms/records ship; nothing to re-screen, but the gdn cache-key fix is only exercised on a card by any future gap≠8 arm run.
Author
Owner

Cancelled CI run #9767 before the Serialized card gate. The build and check jobs had passed (Build simulators and check the host module: success; Report upstream drift: success).

Why: the plan (action: run, reason: fingerprint has no successful verdict on this PR) would have screened prod. Its fingerprint touches one card file, gdn/tp.py. There the cache name qkvzab.{il,dramshard}.abpad now comes from qkvzab_cache_name(proj1d, gap). For gaps 0 and 8 that function returns the same string as the old expression, and the served arm runs at gap 8 (QWEN36_GDN_AB_PAD engaged: 8 zero columns). The weight bytes, memory config and dtype are unchanged. So the served arm loads the same cached tensor and runs the same ops, and a card screen would measure master again. tests/test_gdn_abpad_cache_key.py checks that these keys match. scripts/sim-run.sh is ttsim-only and is not in the card file set.

🤖 Generated with Claude Code

Cancelled CI run #9767 before the Serialized card gate. The build and check jobs had passed (Build simulators and check the host module: success; Report upstream drift: success). Why: the plan (`action: run`, `reason: fingerprint has no successful verdict on this PR`) would have screened `prod`. Its fingerprint touches one card file, `gdn/tp.py`. There the cache name `qkvzab.{il,dramshard}.abpad` now comes from `qkvzab_cache_name(proj1d, gap)`. For gaps 0 and 8 that function returns the same string as the old expression, and the served arm runs at gap 8 (`QWEN36_GDN_AB_PAD engaged: 8 zero columns`). The weight bytes, memory config and dtype are unchanged. So the served arm loads the same cached tensor and runs the same ops, and a card screen would measure master again. `tests/test_gdn_abpad_cache_key.py` checks that these keys match. `scripts/sim-run.sh` is ttsim-only and is not in the card file set. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grok merged commit 5bac97af09 into master 2026-10-21 15:24:49 +02:00
Author
Owner

agent-gateway closeout (merged): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (merged): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!293
No description provided.