Conversation
Signed-off-by: Stanislaw Wozniak <stw@zurich.ibm.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
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.
Purpose
Recently
prefix_cache_retention_intervalhas been introduced (#43447 #45845), affecting hybrid models such as DeepSeekv4, KIMI K3, Qwen 3.5, etc. Whenprefix_cache_retention_intervalis notNone, cache entries with low matching probabilities are masked, skipped hash assignment, and evicted in FIFO manner rather than LIFO (LRU). Cache hits can only occur then at designated blocks and via specific mechanisms, such as Marconi shared prefix detection (#37898) that provides cache hits on 3rd appearance of shared prefix.In this PR, we notice that the resulting masked blocks:
Rather than completely discarding them, we enable opportunistic APC hits. To achieve this the PR:
[hash-less blocks | LOW PRIORITY | ... | NORMAL PRIORITY]A synthetic test with truncated shared prefixes that simulates:
demonstrates valid cache hits for masked blocks and 35% prefill time reduction for
prefix_cache_retention_interval=0withQwen/Qwen3.5-9BAI assistance disclosure: development of the code in this PR (all tests, some parts of core logic) was assisted with AI.
@tdoublep
Test Plan
Test Result
Main:
This PR:
Executed on 1x A100.