Skip to content

Fix radix cache duplicate prefix remapping - #142

Open
Rapheal-zc wants to merge 1 commit into
sgl-project:mainfrom
Rapheal-zc:fix/radix-cache-remap-duplicate-pages
Open

Fix radix cache duplicate prefix remapping#142
Rapheal-zc wants to merge 1 commit into
sgl-project:mainfrom
Rapheal-zc:fix/radix-cache-remap-duplicate-pages

Conversation

@Rapheal-zc

Copy link
Copy Markdown

Summary

This PR fixes radix prefix cache handling for unfinished requests.

When CacheManager.cache_req() inserts a request prefix into the radix cache, part of the current request's computed prefix may already exist in the cache. The previous logic freed those duplicate request-local pages directly, but the request's page_table could still point to the freed pages. Later decode steps could then read KV pages that had already been returned to the free pool and potentially reused.

This PR remaps the unfinished request's page_table entries to the canonical radix-cache page indices before freeing the duplicate request-local pages.

Validation

Validated with Qwen3-32B AIME26 repeat testing using radix cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant