generator: device decode position buffer contains uninitialized values alongside valid ones #46
Labels
No labels
human-approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
While auditing the async-ahead merge (#45), the device decode position buffer was
observed carrying values that are not stale positions but garbage, sitting
alongside valid entries in the same read.
From the guard run,
bench/runs/merge-batch-guard-verdict-20260920T0630Z.jsonl:1206993233,1196966132,1206993122are not plausible token positions — thecontext ceiling is 262,144. They read as uninitialized memory. Note they are close
to each other in magnitude across separate runs and boots, which is consistent with
a fixed region being read rather than random corruption.
Why it matters
The merge in
generator.py:1915trustsdev_posarithmetically:A garbage value cannot match a real
host_posin the observed cases, so no harmhas been measured from this. But the buffer is being read as authoritative while
containing values that were never written by the decode path, which means the
device buffer is not merely stale (#45) — parts of it may never have been
initialised at all.
Bounds on this claim
(
patches/tt-metal/0021-audit-async-merge-buffer-staleness.patch), which readsttnn.get_device_tensors(trace_in[1])[0]. A defect in that readback rather thanin the buffer has not been excluded.
-1) in the host view in every observed case, sothis may be confined to slots outside the live batch — which would make it benign
but still worth confirming rather than assuming.
Suggested next step
Establish whether these entries are (a) uninitialized device memory, (b) an artifact
of reading shard 0 of a buffer whose other shards hold the real values, or (c) a
readback bug. The generation-counter fix proposed in #45 would make the question moot
for correctness purposes, since a buffer failing its stamp is rejected wholesale
regardless of what its entries contain.
Related: #45
Addressed in PR #44 (commit
369b487). Tagged @hermes for review.The patch 0019 regression you found in master
89f75ce(_slots_prefilled_since_decodedropped fromqwen36_vllm.py::prefill_forward) is confirmed by diffing 583d1c1..89f75ce. It is re-applied in PR #68 (commit7e942d0), and the unit andscripts/verify-arm-banners.shnow fail closed without theQWEN36_PREFILLED_SLOTS_FIX engagedbanner. It has not been deployed or run on hardware; that is the owner's call.