Add FLOP_EFFICIENCY eviction policy for prefix caching#3923
Open
lmcafee-nvidia wants to merge 6 commits intoNVIDIA:mainfrom
Open
Add FLOP_EFFICIENCY eviction policy for prefix caching#3923lmcafee-nvidia wants to merge 6 commits intoNVIDIA:mainfrom
lmcafee-nvidia wants to merge 6 commits intoNVIDIA:mainfrom
Conversation
Implements a FLOP-aware eviction policy (inspired by Marconi, arxiv 2411.19379) that combines recency and per-block FLOP efficiency into a utility score. Blocks representing longer prefixes save more FLOPs per byte of cache and are preferentially retained under memory pressure. The utility score is: recency + alpha * flop_efficiency, both normalized to (0,1) via min-max across cached blocks. Alpha is configurable via --inference-dynamic-batching-prefix-caching-flop-alpha (default 1.0). Setting alpha=0 falls back to pure LRU behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e above FLOP-specific tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace test_flop_efficiency_prefers_longer_prefix and test_flop_efficiency_alpha_zero_fallback with a single test_flop_efficiency_eviction_ordering parameterized over alpha (0.0/1.0/100.0) to demonstrate all 3 eviction regimes: oldest-first, medium-first, and shallowest-first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
/ok to test 42d89dd |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
/ok to test 5399cc7 |
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
FLOP_EFFICIENCYeviction policy that prioritizes evicting blocks based on computational cost efficiencyTest plan
test_dynamic_prefix_caching.pypass🤖 Generated with Claude Code