Make LRU prefix caching eviction policy only evict child blocks#5822
Make LRU prefix caching eviction policy only evict child blocks#5822santhnm2 wants to merge 13 commits into
Conversation
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
|
/claude strict-review |
|
/ok to test 0fd9e62 |
|
Strict Review Summary Findings: CRITICAL: 0 · IMPORTANT: 2 · SUGGESTION: 0 This is a well-constructed fix. The core eviction algorithm — keying each cached block by its subtree-max timestamp with a depth tie-break so children always precede parents in the eviction order — is sound, and the parent-chain invariant it preserves is exactly what Most impactful findings
Risk assessment Low-to-moderate. No correctness or backward-compatibility regressions found — the new |
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
|
/ok to test 90b8f29 |
Cherry-picked from NVIDIA#5822. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Siddharth Singh <sidsingh@nvidia.com>
Signed-off-by: Keshav Santhanam <ksanthanam@nvidia.com>
|
/ok to test 646b343 |
What does this PR do?
The LRU prefix eviction policy only considered timestamps when selecting block to evict, but this could lead to parent blocks being evicted and leaving holes in the prefix chain. Instead, this PR ensures that parent <-> child relationships are taken into account by the LRU eviction policy so that only leaf node blocks are evicted. This PR also makes ref-count updates happen BEFORE allocation rather than AFTER allocation so that pending matched blocks are not accidentally evicted because their ref-counts were 0.
Issue tracking
For PRs from open-source community contributors:
Linked issue:
Contribution process
Pre-checks
Code review
Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.