Conversation
11 tasks
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
Stop collecting KV eviction candidates once enough unreferenced pages have been found to satisfy the requested free capacity. Candidate collection still finishes before the used-page set is mutated.
Motivation
A request needing one or a few pages previously scanned every used page and built a list of every unreferenced page. Bounded collection avoids the unused tail while retaining the existing eviction order and index cleanup.
Type of Change
perf— performance improvement with unchanged behaviorTest Results of Involved Models on Supported Platforms
Local CPU validation covered capacity boundaries, existing free pages, shared hashes with live peers, failed reclamation, bounded metadata reads, and 4,000 seeded randomized reclaim/reallocate steps against the previous implementation. Return values, free-list order, used-page membership, hashes, and reference counts matched. These checks were performed during development; no unit-test or test-support files are included in the final PR diff. Repository formatting and
git diff --checkpassed.Single-request/offline/sanity/service model tests were not run: this is Python cache-metadata validation without local model weights. Accelerator and model throughput remain unmeasured.
Benchmark / Performance Impact
Intel Core i5-14600KF, Python 3.12.13, integer metadata (dtype N/A), CPU not pinned. Baseline uses the original
try_free_blocksfrom270feb3. Each pool starts fully allocated, with the first indicated pages unreferenced and indexed using three repeating hashes. Onlytry_free_blocksis timed withperf_counter_ns; reclaimed pages are reallocated, republished, and released outside timing. Ten warmups, median of seven rounds of 100 calls. Exact state/output comparison precedes timing. Temporary local harness is not committed.The favorable cases find candidates early. Worst-case work remains linear; the insufficient-capacity case measured about 8.6% slower due to the additional limit check per candidate. These are microbenchmarks, not model throughput.
Notes for Reviewers
Directly based on
270feb3/InfiniLM-v0.2.9c, independent of other optimization PRs. When free capacity already suffices, the legacy behavior still evicts one unreferenced page if one exists. Failed reclamation still evicts all available candidates before returning false. No live page is evicted.CI / ChatOps
Manual CI has not been triggered; model/platform validation remains outstanding.
Checklist
InfiniLM-v0.2.9crelease branch rather thanmain.scripts/format.py; noauto_config.pychanges.