feat(connector): support Gemma4 hybrid KV cache - #455
Open
GentleCold wants to merge 19 commits into
Open
GentleCold wants to merge 19 commits into
GentleCold wants to merge 19 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate issues affect heterogeneous layout validation, namespace safety, lease cleanup, and save/load correctness.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Gemma4 hybrid KV-cache support with per-group mappings, sliding-window leases, synchronous loading, and related tests/documentation.
Changes:
- Adds hybrid cache-group layout and namespace handling.
- Implements per-group query, save/load, and lease management.
- Adds synchronous-load safeguards and regression coverage.
File summaries
| File | Description |
|---|---|
python/tests/test_hybrid_group_mapping.py |
Tests hybrid mapping and lease behavior. |
python/tests/test_connector_fault_tolerance.py |
Tests synchronous-load failures. |
python/tests/test_combine_hashes.py |
Covers asynchronous-mode behavior. |
python/tests/test_cache_group_layout.py |
Tests cache-layout validation. |
python/README.md |
Documents synchronous loading. |
python/pegaflow/connector/worker.py |
Handles per-group registration and loading. |
python/pegaflow/connector/tp_shards.py |
Extends query results with group metadata. |
python/pegaflow/connector/scheduler.py |
Plans hybrid queries, saves, loads, and leases. |
python/pegaflow/connector/common.py |
Defines cache layouts and intent metadata. |
python/pegaflow/connector/__init__.py |
Configures hybrid layouts and load scheduling. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 10
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Kaon-v3/Gemma4 uses dense attention and sliding-window KV groups with different logical block sizes. The connector now plans hashes, storage queries, GPU destinations, and asynchronous save/load for each group's cadence when vLLM's Hybrid KV Cache Manager is enabled.
Sliding-window membership queries verify the retained window at the selected dense hit boundary. Partial hits shrink to a boundary supported by every group, and groups sharing a query share one lease/load entry. Sliding saves pin their source blocks until all workers report completion; null block 0 is filtered together with its hash. Full32 + Sliding16 is supported; layouts whose sliding block size does not divide the dense block size are rejected during initialization.
The implementation uses one block-size value per group, reuses the existing request-hash validation, and carries the final contiguous load window as a block range. It removes redundant per-layer size state, duplicate load-destination construction, and unreachable heterogeneous tail-save branches. Both dense and sliding layouts use the asynchronous load path.
Validation on the refactored implementation (
c5dee4f):git diff --checkpassed.Benchmark scripts, launch files, logs, and results are excluded from the commits. Remote evidence:
/root/kexi/kaon_validation/pr455-refactor-20260916/on192.168.172.86.Related: AIINF-294.