Repository navigation
Regrow: one owner, and no survivor grows while an idle unload is pending - #2844
Merged
Merged
Conversation
Follow-up to the review of #2807. - With [backend] regrow_idle_unload on, a regrow that picks an idle victim now applies the survivors' shrinks first, then the victim's ceiling 0, and grows no survivor while a victim it queued is still resident. Until the unload runs, every ceiling fits the live budget, which still counts the victim's weights; the unload's own regrow then grows the survivors. - A new test, "T1 strict", holds the unload and checks on both hosts that the ceilings fit the contracted budget at the victim's ceiling 0 and right after the regrow. - One regrow owner: EngineV2RegrowHost (EngineV2Regrow.swift) holds the regrow that ProviderLoop and StandaloneServer each carried. Each host keeps only its reads, its unload and its log wording, and both check reclamation before every grant change. One floor function, EngineV2KVSizing.serviceabilityFloor(declared:), serves the load re-slice and the regrow. - Each further victim is judged against the durable budget the earlier victims leave once their weights are freed, so a regrow no longer unloads more models than it needs. A plan test covers it; R-ii keeps its two victims with a 64 MiB first victim. - Queued unload tasks remove themselves when they end; the test hold and its wait loop are DEBUG only. Refs #2807
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Refs #2807 (review follow-up).
For the next release. Review required. This only changes what happens when
[backend] regrow_idle_unloadis on (defaultfalse). The new owner and floor function are refactors.Problem.
ProviderLoop+EngineV2.swiftandStandaloneServer.swifteach had a copy of the same ~150-line regrow, with separate floor logic.regrowUnloadTaskswas cleared only by a test helper. The test hold flag and its wait loop were production state.Change.
EngineV2RegrowHost(Inference/Memory/EngineV2Regrow.swift) is an actor protocol, and its extension holds the regrow:ProviderLoopandStandaloneServereach conform and supply their own:unloadModel(forEviction:), or anevictSlotbehind the load gate);ProviderLoop's shrinks used to skip this check.EngineV2KVSizing.serviceabilityFloor(declared:)serves both the load re-slice and the regrow.regrowPlangains adurableFleetKVBudgetBytesExcluding:overload. Each further victim is judged against the durable budget left once the earlier victims' weights are freed. TheUInt64overload delegates to it, so the existing plan tests are unchanged.regrowUnloadTasksis keyed byUUID, and each task removes itself when it ends.regrowUnloadHeldand its wait loop are#if DEBUG.changelog.d/regrow-one-owner.md.Tests.
EngineV2RegrowFloorWiringTests). The unload is held. The test checks that the total ceiling stays within the contracted budget at the victim's ceiling 0 and right afterregrow()returns, then checks the post-unload state. It fails on the old order: at the hold, the busy survivors still hold their large previous share.EngineV2RegrowPlanTestscase. When one unload frees enough, the plan picks one victim.EngineV2Regrow.swiftandEngineV2Reslice.swiftagainst a fake host whose unload runs its own regrow. All 18 checks pass, covering:Not covered by CI. Nothing beyond what the existing regrow wiring tests drive.
Rollback. Revert. No state or config format changes.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.