plugin #283 port: a continuing chunked prefill keeps its device state slot #378
No reviewers
Labels
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack!378
Loading…
Reference in a new issue
No description provided.
Delete branch "plugin-283-slot-keep"
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?
Ports vllm-tt-plugin #283 (open upstream) into the served plugin overlay. Served code, no env gate. Deploy only with the next TT arm ship, not on its own (the arm identity sha changes with this file).
Change (
patches/prod-local-plugin/src/vllm_tt_plugin/model_runner.py,_alloc_prefill_state_slots): a request that already owns a device state slot keeps it; only requests without one are placed by row (own row if free, else the first free slot), as before. The map is checked for two requests owning one slot (RuntimeError). Upstream's 8 lines, our docstring.Why it is behaviour-neutral for our served path: the S12 prefix path never reads a continuation's input state from its decode slot. It resumes from the host snapshot
PrefixCache.live[request_id]or from the B=1 scratch tagged (request id, start); the slot is only the slot-copy target, which the final chunk rewrites whole (analysis in #377, §2.5). So the fix changes only which slot a continuing chunk writes.Test
tests/test_state_slot_continuing_chunk.py(host-only, no torch/vLLM, ~12 s,python3 -m unittest tests.test_state_slot_continuing_chunk): 7/7 pass.PrefixCache+prefix_snap.resident_order) decodes identical, correct per-request states under old and new allocators, on #283's scenario and 150 random chunked traces (asserts >= 10 traces where the slot choice differs, so it is not vacuous);Mutation check: with
model_runner.pyreverted to origin/master, tests 1, 2, 4, 6, 7 FAIL (3 and 5 pass, as they must).Needs an independent review before merge.
🤖 Generated with Claude Code
verdict: approve
tier: T1
rationale: Two-file additive port of upstream vllm-tt-plugin #283:
_alloc_prefill_state_slotsnow keeps a request's already-owned state slot (only unowned requests are placed by row) and refuses two owners of one slot; the rest of the allocator is untouched. Served semantics are unaffected by design: the S12 prefix path resumes continuations from the host snapshot or the B=1 scratch, never from the decode slot, so the change only moves which slot a continuing chunk writes.concerns:
waiting(build jobs queued, "Serialized card gate"blockedbehind them) on70d1ad2— thehuman-approvedlabel is held until the head run lands green; re-dispatch or re-check when it completes.verification (in-kernel, no clone):
compare 04eee3cc...70d1ad2:model_runner.pymodified,tests/test_state_slot_continuing_chunk.pyadded); no CI/arm/doc surface touched.model_runner.py: test suite 7/7 pass.model_runner.pyreverted to the PR base, tests 1, 2, 4, 6, 7 FAIL (3, 5 pass) — exactly as the PR body claims.model_runner.py(no torch/vLLM import); the pre-#283 allocator is kept verbatim as the reference; behaviour-neutrality is shown against the realPrefixCache/prefix_snapmodules plus 150 chunked / 600 non-chunked random traces with a moved-slot count floor.Independent review (Opus reviewer agent, read-only): LAND, no blocking defects.
model_runner.py:1722-1737); only the docstring differs.model_runner.pyswapped in, tests 1, 2, 4, 6, 7 fail (4 on its non-vacuity guard); 3 passes on both by design. Worktree restored.prefix["states"]/ scratch (model.py:2887-2908); slot only written (2963/2974/3009; ONESTEP mid readback reads the slot written earlier in the same step). Decode remap moves every map entry by a permutation, so a kept slot cannot collide with a live owner; settle commits before any next prefill allocation. Duplicate-owner RuntimeError not reachable by reading. MTP warm span keyed by request id; checkpoint readback and P/D export use this step's slots; lane mode does not use this allocator.Low-severity notes:
mtp_batch_host.py:1234then runs a full-width decode bucket for that step (perf only, at most one step after a reorder).prefill_paged_slots(realPrefixCache+resident_order); ONESTEP head/tail, the non-device-copy fallback and MTP are covered by code reading, not the test.Deploy with the next TT arm ship only.
agent-gateway closeout (merged): cleared
agent:*labels.Hermes kanban card (if any) is left for Hermes to archive/complete.
Cards skipped
Cards unavailable on
cfx-llm0for PR #37870d1ad2de6a7208d33f081bc7ccd19028ca3b6c9.systemctl is-active tenstorrent-serving.service=active(needinactive)39521140kB (need >= 4000000)No slot taken, no boot. This skip is green.