Repository navigation
Conversation
With kv_buffer_device=cpu, sync_recved_kv_to_device copied every layer's host buffer for all groups' block ids. NIXL fills a layer's host buffer only at its own group's blocks and never for KV-sharing layers, so the copies overwrote received KV in device tensors shared across groups or with a KV-sharing target. Each group now copies only its own layers. Signed-off-by: Luca Motz <luca.motz@icloud.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lucamotz
force-pushed
the
nixl-host-buffer-h2d-per-group
branch
from
October 9, 2026 08:04
f62c2fd to
ff55fa3
Compare
lucamotz
marked this pull request as ready for review
October 9, 2026 17:43
lucamotz
requested review from
ApostaC,
NickLucche,
ivanium,
orozery,
wzhao18 and
xuechendi
as code owners
October 9, 2026 17:43
6 tasks done
This branch has not been deployed
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.
Overview
With
kv_buffer_device="cpu",sync_recved_kv_to_deviceoverwrites D's received KV with host pages NIXL never filled, for models with several KV cache groups or KV-sharing layers. Each group now copies only its own layers' host buffers; the multi-group case regressed in #53780.Claims
Validation
CPU, this PR (
ff55fa35ed) on mainefaca9547d:pytest tests/v1/kv_connector/unit/test_nixl_connector_hma.py -k test_sync_recved_kv_copies_each_group_own_layers: [KV Connector][NIXL] Coalesce host-buffer KV copies across cache groups #54483's parametrized test now checks which layers and block ids each h2d copy gets, with a KV-sharing layer added. All 3 rows fail on main; with this PR they pass. The rest oftest_nixl_connector_hma.py,test_nixl_connector.pyandtest_nixl_push_connector.pyhas the same pass/fail set as main.allocate_kv_cachetensors,save_kv_to_host, NIXL replayed between host buffers andsync_recved_kv_to_deviceon toy models at TP 1/1 and 2/2. On main, D's KV differs from P's in all 16 multi-group cases, which mix sliding-window and full-attention layers, and matches in all 4 full-attention-only cases. With this PR it matches in all 20.GB10, Gemma-4-E2B-it, which has sliding-window and full-attention groups and 20 KV-sharing layers, P TP1 → D TP1,
kv_buffer_device="cpu"on both sides, against the same run with device buffers:a3e0243b1c: 0/4 outputs identical, max |Δlogprob| per prompt 2.44, 2.63, 2.56, 3.04.f62c2fdc78on maina3e0243b1c): 4/4 outputs identical, Δlogprob 0 on all 4 prompts, also in a repeat run.GB10 setup
Both runs, P and D:
--attention-backend TRITON_ATTN --enforce-eager --max-model-len 8192 --block-size 64 --no-enable-prefix-caching, greedy, 4 prompts of 1100–1300 tokens; D read 4880 tokens over NIXL.Host-buffer run, P and D:
"kv_buffer_device": "cpu"and--num-gpu-blocks-override 2048; both loggeduse_host_buffer: True.Details
On D, with
kv_buffer_device="cpu":sync_recved_kv_to_devicecopies the host buffers into the device tensors, which layers of different KV cache groups share, as does a KV-sharing layer with its target.The byte-level check matches in all 10 multi-group cases that build at #53780's parent and differs in all 10 at #53780.
save_kv_to_hoststill copies every layer for all groups' blocks; NIXL never reads the extra host pages.#59037, a 60-file draft for hidden-state extraction with packed layouts, contains the same per-group copy; this PR is the standalone fix.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
AI assistance (Claude Code) was used for the analysis, patch and tests. I reviewed every changed line.
🤖 Generated with Claude Code