Skip to content

Add chunked prefill with prefix KV cache reuse to Tunix Gemma 4.#1597

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_933189977
Open

Add chunked prefill with prefix KV cache reuse to Tunix Gemma 4.#1597
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_933189977

Conversation

@copybara-service

Copy link
Copy Markdown

Add chunked prefill with prefix KV cache reuse to Tunix Gemma 4.

  • Refactor attention into focused methods for KV projection,
    cache update with prefix concatenation, and mask construction.
  • Support sliding window (ring buffer) and linear cache layouts.
  • Handle PAD masking, KV sharing, and flash attention fallback.
  • Comprehensive tests for chunked prefill, decode, KV sharing,
    and PAD masking.

@google-cla

google-cla Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

- Refactor attention into focused methods for KV projection,
  cache update with prefix concatenation, and mask construction.
- Support sliding window (ring buffer) and linear cache layouts.
- Handle PAD masking, KV sharing, and flash attention fallback.
- Comprehensive tests for chunked prefill, decode, KV sharing,
  and PAD masking.

PiperOrigin-RevId: 933189977
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