[KV Connector] Fragment-major canonical CPU layout for KV offload#48414
Draft
Etelis wants to merge 2 commits into
Draft
[KV Connector] Fragment-major canonical CPU layout for KV offload#48414Etelis wants to merge 2 commits into
Etelis wants to merge 2 commits into
Conversation
Signed-off-by: Itay Etelis <itay.etelis@ibm.com>
Signed-off-by: Itay Etelis <itay.etelis@ibm.com>
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.
Uses the per-layer head-region schema (#48408) to store offloaded KV in a
TP-invariant layout: behind an opt-in flag, each worker scatters its page
fragments to rank-interleaved positions in the shared CPU row.
Groundwork for cross-TP cache consumption (PD-disagg, parallel-
agnostic file sharing); stacked on #48408.
Configuration
kv_connector_extra_config: {"canonical_layout": true}onTieringOffloadingSpeconly (requires the shared mmap); auto-disabled unlessworld_size == tensor_parallel_size. Flag off (default): the legacy transferpath is byte-for-byte unchanged. HND KV-cache layout recommended when
enabling (NHD fragments per token: more, smaller copy ops).
Test plan
Unit (
tests/v1/kv_offload/cpu/test_fragment_layout.py, no GPU): NHD/HNDexpansions against hand-computed offsets, opaque single-slot, store/load
offset mirror, and all-slots tiling (destinations partition the region with
no gaps/overlaps).
E2E on 2x H100 (Qwen2.5-0.5B, generate -> reset_prefix_cache -> regenerate,
compare token ids):