Repository navigation
Resident decode planning: decode rows on device tables #1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+3,291
−34
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6d92b2e
resident planning: decode rows on device tables
4c77688
Merge origin/main into users/atindra/resident-plan
merceod dc22936
resident: laps follow #852's plan phase, tests where the two meet
merceod 6661f1e
Merge origin/main into users/atindra/resident-plan
merceod 147c6f7
tests: the chunked prefill engine stub knows about the planner
merceod fa20064
resident: a refused admit drops the stage, as the runner's does
merceod 946816e
Merge main into resident-plan
merceod 13a4637
Merge main into resident-plan
merceod de9824c
fmha reads a row's used columns off the resident table
merceod f7dada0
Merge main into resident-plan
merceod bfcf640
tests: the LoRA graph engine stub knows about the planner
merceod 863cf87
Merge main into resident-plan
merceod e9322f6
Merge remote-tracking branch 'origin/main' into rs3_work
merceod e0cee95
Resident hooks go in a mixin Resource inherits
merceod 4d71489
Qwen3.5 decode is resident on every config
merceod 00ab09a
Resident slots are a cache sized by the batch cap
merceod d279b7a
test_resident_delta's engine stub binds the slot release
merceod 254e0fd
An abandoned stage is staged again, and capture refuses commit=False
merceod 7d2a6cd
Merge main into resident-plan
merceod 0af5053
Resident state per resource key, and pools a step only reads
merceod 8c3af2a
tests: name the read-only context test for what it checks
merceod 225197e
Merge main into resident-plan
merceod f4b14f2
resident_walks: a stream a resource, or one it only reads
merceod eb9500b
Merge main into resident-plan
merceod 8922682
Merge branch 'main' into users/atindra/resident-plan
merceod cf77040
Stub resident_walks in the workspace seal test
merceod 45f3866
Merge main e7f3c3c75 into users/atindra/resident-plan
merceod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: if
resident.planraises here (out of slots),pre_admithas already reserved, and this block has only afinally. The worker's pre-plan wrapper logs it and calls_reset_skip_plan_flags. Does anything roll back whatpre_admittook before exec re-drives the step?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing leaks, on
mainor here.pre_admitputs its pages on the streams and marks them in flight. A raise anywhere after it in that block, fromresident.planor from the runner's ownpre_plan, unwinds toWorker._preplan_spec'sexcept, then_reset_skip_plan_flags,reset_pre_plan_for_batch,StepRunner.clear_preplan. That drops_pre_admittedandbatch.step, so exec declares and admits afresh, and KV'sclear_preplanclears the in-flight marks and removes any labels the stage invented. The reserved pages stay with their streams, where exec's admit finds them: the decode row's pages already cover its token, so it acquires nothing (kv/manager.py, thelen(page_indices) * page_size >= seq_lencheck). If the row isn't in the retried step, the page waits on its stream for the row's next step or its teardown.ctx.resident.plansits inside the sametryas the runner's pre-plan, so it gets the same unwind, and there's a comment at the call saying so.test_a_raise_in_the_preplan_leaves_the_reservation_for_execruns the real_preplan_specand_pre_plan_for_batchwith a raise from each, then checks the free page count and the stream's pages across the re-driven step.What could leak was the planner's own marks: a build that raised after taking rows off
_stalelost them._buildnow hands them back on any raise (test_a_plan_that_raises_leaves_its_rows_to_the_next_step).