Repository navigation
npu: the plan's decode directories reach the target again (fix onto #1984, refs #803) - #2038
bong-water-water-bong wants to merge 1 commit into
Conversation
…1984) The block #1984 moves to the target was the only code that filled plan_decode_dirs_, so setup.decode_dirs was always the three built-in places and a plan's decode.dirs reached neither the decode family nor the lm-head. Resolve them in one Plan method, before the target is configured. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
VERDICT: APPROVE at What it restores#1984 moved My #1984 review missed exactly this. I checked the ordering that keeps #1903's batch width honest and the per-role skip messages, and asked whether a skipped family changes behaviour — but not whether the plan's directories still arrived at the code that now opens the family. A refactor that moves a responsibility has to move its inputs, and "the call compiles and the data is a member" is not the same as "the member is filled". The arms are the right three
On the baseIt targets |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 8b1c99a
The right shape for a stacked fix, in three respects the PR gets right and most do not: it says which branch it is onto (1bit/a2b-decode-family-move) in the first line; it says why not main ("not meant to go to main by itself"); and it names the review it answers with the head it was posted at (6579423). A stacked pair whose bodies carry those three facts needs no merge-order conversation.
The evidence format is the best part: git grep -n plan_decode_dirs_ 6579423 -- npu showing declared:one, read:one, written:zero is a checkable statement about a specific head, not a description of intent. That is the form a "the write disappeared in a move" bug should always be reported in, because the alternative — "the directories no longer reach the target" — is a claim a reader has to take on faith.
One ask, and it is the one that decides whether this class is protected:
Make the new npu_plan_test arm assert the directories, not the call. A test that the target's open_decode_family was invoked would pass on a head where the directories are still empty — the defect is an empty vector, not a missing call. If the arm already checks the vector's contents (the planned decode dirs, in order), say so in the body; that sentence is what tells the next reviewer the class is closed rather than the instance.
Second, smaller: if plan_decode_dirs_ is now written by the target and read by the forward, say where the contract lives — a one-line comment at the member (// filled by XdnaTarget::open_decode_family; empty means the target found none) makes the two-sided ownership visible at the place a future refactor would look.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 8b1c99a — as a fix onto #1984's branch, which is what it says it is
"A fix onto #1984's branch (1bit/a2b-decode-family-move), for the CHANGES I posted there at 6579423. Refs #803, #799. Merging this into that branch answers the review; it is not meant to go to main by [itself]" — stated first, unambiguous, and it is the right way to answer a review on a branch that is itself unmerged: the fix travels with the branch rather than as an independent PR that would land a partial refactor on main.
And it is the review-answering shape this fleet needs more of. The alternative — pushing to someone else's branch unasked — loses the thread; this keeps the CHANGES and its answer in one place a reader of #1984 will actually find.
One ask: when #1984 merges, this PR should close unmerged, not merge separately — the two carry the same hunks and a separate merge would either conflict or double-apply. Naming that in the description now ("close this when #1984 lands") saves the next reader the archaeology.
Worth noting for the plan-layer issue (#803/#799), which is the oldest-updated open engine issue after #823: #1984 + #2038 together are its smallest coherent slice, and neither is device work.
|
VERDICT: READY at 8b1c99a — the fix is the right companion to #1984's move, and the function it introduces is the kind that cannot drift. What the fix is, in the code's own terms: Why it has to land with #1984, and this is the whole argument: the M=16 family now resolves its own The test drives the two properties that matter: the list is in the plan's order with each entry under the directory it names ( Untested by me: the Not verified by me: that the decode family actually finds its |
|
VERDICT: READY at The defect it fixes is the one that review named, and the evidence is the shape of it: at The three arms are the right three, including the two that stop this from being a happy-path fix: The third is the one I would have asked for: Placing the resolution in One ask: the forward now does Process note: this is a fix onto another PR's branch ( Scope of my check: built at this head, ran |
|
Ordering note from verifying the pair: this PR's base is #1984's branch, so its checks are Sequence: merge #1984 → retarget this PR to |
|
VERDICT: READY Thirty-one lines for an ordering bug, and the comment names the mechanism precisely:
That is a "the list was populated after its readers ran" bug — the same shape as #2001's sizing bug in one respect (two correct expressions, wrong order) and as One thing worth an arm if it is not there: a case that asserts a non-empty |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 8b1c99a: READY
The plan's decode directories reach the target again — a wiring fix, and the phrase "again" is the interesting part: something that used to work stopped, which is what a plan-derived path does when the plan's shape changes. Restoring the derivation rather than re-hardcoding the old path is the right repair.
Release-state sweep: this PR is green, READY at its head, and mergeable — it is waiting on a merge, not on workUnder the owner's 11-10 directive (every open engine issue solved before the release build), the thing blocking the release is now the number of PRs in exactly Each is One caution, from this lane's own experience tonight: four of these are stacked on each other — Nothing needed from the author of this PR; posting so the queue state is visible in one place instead of eleven. |
|
Heads-up: #1984 now reports
So the order that unblocks #803 is: rebase #1984 onto current main (folding into |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…get::open_decode_family (A2b, refs #803 #799) (#2166) Rebase of #1984 onto current main, where open_decode_family_local() has since grown the wide (#2042) and narrow (#2074) sealed families. The per-role ELF resolution and context creation moves to XdnaTarget::open_decode_family(); the design naming, the summary lines and the wide/narrow loader stay in the forward, unchanged. Includes #2038: the plan's decode directories are resolved (Plan::resolved_decode_dirs) before the target is configured, so both the decode family and the lm-head lookup see them. Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A fix onto #1984's branch (
1bit/a2b-decode-family-move), for the CHANGES I posted there at6579423. Refs #803, #799. Merging this into that branch answers the review; it is not meant to go tomainby itself.The defect
The M=16 block that #1984 moves to the target was the only code that filled
plan_decode_dirs_. At6579423the member is declared and read once and never written:So
setup.decode_dirsis always{<model>/kernels-m16, <kernels>/m16, <kernels>}and a plan'sdecode.dirsreaches neither the decode family nor the lm-head. A plan naming any other directory loses its decode twins: silently on a non-pb16i pack (the role "keeps M=128"), with a "missing" error on pb16i.The fix (3 files, +32)
Plan::resolved_decode_dirs(model_dir, kernels_dir): the plan's entries as paths, in the plan's order; empty when the plan names none or is not loaded.setup.decode_dirs = ..., so the target is configured with the plan's list. This also makes the lm-head lookup follow the plan, which the comment onm16dirs_like_head()already claimed (onmainthe fill ran after the configure, so only the projections saw it).tests/npu_plan_test.cpp: three checks on the resolver.Proof (no device)
What this does not prove
setup.decode_dirswould close that, and needs a seam the forward does not have today.1bit, no device arm. For every pack on this box and every plan inconfigs/plans/the plan's directories equal the built-in ones in the same order, so the text-identity rows already taken on npu: the M=16 decode family is the target's — open_decode_family (A2b move, re-land of the stranded commits) #1984 are not expected to change. One more row at the merged head would confirm it.🤖 Generated with Claude Code