Skip to content

[Fix][Runtime] Keep sliding-window page metadata separate from global attention - #20699

Open
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:fix/kv-cache-sliding-metadata
Open

akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:fix/kv-cache-sliding-metadata

Conversation

@akaashrp

Copy link
Copy Markdown
Contributor

PlainPagedKVCacheAuxDataManager reuses the same device arrays for global and per-layer sliding attention. Preparing the sliding page table therefore overwrites the global one before either layer uses it. In Gemma 4, a global layer then attends to only the sliding window and loses the earlier context.

Give the plain manager separate storage for the sliding page indptr, page indices and length info, and select it at the per-layer sliding copy calls. Allocate it only when the cache has sliding layers. The cached manager already assigns each copy its own region.

@akaashrp
akaashrp requested review from tlopex and removed request for tlopex October 13, 2026 06:25
@akaashrp

Copy link
Copy Markdown
Contributor Author

@tlopex

This branch has not been deployed

No deployments
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