feat(server): add draft residency policy#290
Draft
weicj wants to merge 1 commit into
Draft
Conversation
b1cc5a8 to
8cef6bb
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR turns the existing draft park/unpark and
--lazy-draftbehavior into an explicit C++ server residency policy shared by PFlash and DFlash.On smaller or tightly split GPU setups, draft weights can remain resident after their active work is finished and compete with target restore, target shards, or the next draft load. This PR adds one shared policy surface so PFlash can release the drafter after compression and DFlash can keep its existing lazy-draft lifecycle through the same resolver.
Changes
Shared residency policy
server/src/placement/draft_residency.has the common C++ policy layer on top of the existing draft park/unpark capability.auto: preserve the existing resident behavior by default, while still honoring the low-VRAM / lazy-draft hint.persistent: keep draft weights loaded across requests.request-scoped: release or park draft weights after the request-side draft work is complete.--draft-residency auto|persistent|request-scopedto the server CLI/config surface.--lazy-draftas a compatibility alias for--draft-residency=request-scoped, so existing callers do not break while the lifecycle logic moves into the shared resolver./props.runtime.draft_residency.PFlash lifecycle
DFlash lifecycle
lazy_draftbehavior available, but express it through the same residency resolver used by PFlash.Backend coverage
server/src/placement/, so future draft-producing paths can reuse it without adding another lifecycle flag.Notes
/propsreporting.test_server_unitpassed with1568 assertions, 0 failures.init().