Skip to content

[KV Connector] Support NIXL P/D for hybrid MLA+SSM models - #49762

Merged
ZJY0516 merged 2 commits into
vllm-project:mainfrom
njhill:kda-mla-nixl-pd
Jul 29, 2026
Merged

[KV Connector] Support NIXL P/D for hybrid MLA+SSM models #49762
ZJY0516 merged 2 commits into
vllm-project:mainfrom
njhill:kda-mla-nixl-pd

Conversation

@njhill

@njhill njhill commented Jul 24, 2026

Copy link
Copy Markdown
Member

Re-implements the intent of #44848 on top of the reworked NIXL connector, from the current architecture rather than the original patch. KimiLinear pools its KDA (GDN-typed MambaSpec) and MLA layers into shared HMA tensors, making every region dual-purpose. Since the mamba-page unification raises the attention block size until the MLA page equals the unified page, and FlashMLA fixes the kernel block at 64 tokens, both sides always exchange kernel-granularity geometry that is TP-independent for MLA: block_size_ratio stays 1 and TP variance is absorbed by the existing per-engine physical_blocks_per_logical handling. What remains are three real gaps:

  • register_kv_caches marked a shared region's FA view by whichever layer registered it first; a KDA-first ordering left dual-purpose regions flagged as head-sharded. Merge the MLA flag on the HMA dedup path so split handles replicate their FA descriptors.
  • The push worker's replicated-MLA WRITE branch asserted a single source rank, which hybrid MLA+SSM violates (sharded SSM targets every covered D rank). Replicate only the attention groups across the write ranks and route hybrid writes through the per-rank split handles, mirroring the pull side.
  • Handshake validation skipped all FA block_len checks for mamba models; hybrid MLA can and now does enforce the TP-independent invariant that kernel-granularity block_lens match exactly.

The KDA conv state decomposes as GDN (equal Q/K/V sub-projections), so the existing 3-read conv transfer applies unchanged. Heterogeneous physical_blocks_per_logical still requires disabling prefix caching, as already enforced at handshake time.

Claude was used for this.

@JaredforReal JaredforReal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good to me, cc @NickLucche @ZhanqiuHu

@mergify

mergify Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @njhill.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Jul 28, 2026
@njhill
njhill force-pushed the kda-mla-nixl-pd branch from 637afa2 to eec2991 Compare July 28, 2026 14:25
@mergify mergify Bot removed the needs-rebase label Jul 28, 2026
@njhill
njhill marked this pull request as ready for review July 28, 2026 16:23

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 28, 2026
njhill and others added 2 commits July 28, 2026 11:45
Re-implements the intent of vllm-project#44848 on top of the reworked NIXL
connector, from the current architecture rather than the original
patch. KimiLinear pools its KDA (GDN-typed MambaSpec) and MLA layers
into shared HMA tensors, making every region dual-purpose. Since the
mamba-page unification raises the attention block size until the MLA
page equals the unified page, and FlashMLA fixes the kernel block at 64
tokens, both sides always exchange kernel-granularity geometry that is
TP-independent for MLA: block_size_ratio stays 1 and TP variance is
absorbed by the existing per-engine physical_blocks_per_logical
handling. What remains are three real gaps:

- register_kv_caches marked a shared region's FA view by whichever
  layer registered it first; a KDA-first ordering left dual-purpose
  regions flagged as head-sharded. Merge the MLA flag on the HMA dedup
  path so split handles replicate their FA descriptors.
- The push worker's replicated-MLA WRITE branch asserted a single
  source rank, which hybrid MLA+SSM violates (sharded SSM targets every
  covered D rank). Replicate only the attention groups across the write
  ranks and route hybrid writes through the per-rank split handles,
  mirroring the pull side.
- Handshake validation skipped all FA block_len checks for mamba
  models; hybrid MLA can and now does enforce the TP-independent
  invariant that kernel-granularity block_lens match exactly.

The KDA conv state decomposes as GDN (equal Q/K/V sub-projections), so
the existing 3-read conv transfer applies unchanged. Heterogeneous
physical_blocks_per_logical still requires disabling prefix caching,
as already enforced at handshake time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Co-authored-by: Jared Wen <w13431838023@gmail.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>
…el pages

The MLA per-token page is TP-independent, so kernel block lengths that
differ by anything other than the block-size ratio must fail the
handshake loudly rather than transfer at mismatched geometry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QVJLHN2a1DP6iBJjayotrs

Signed-off-by: Nick Hill <nickhill123@gmail.com>
@njhill
njhill force-pushed the kda-mla-nixl-pd branch from eec2991 to 56a2a13 Compare July 28, 2026 18:50
# KDA+MLA in KimiLinear); the region's FA view is MLA whichever
# layer registered it first.
idx = seen_base_addresses.index(base_addr)
self._region_is_mla[idx] |= is_mla_region

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
self._region_is_mla[idx] = self._region_is_mla[idx] or is_mla_region for readibility

@ZJY0516
ZJY0516 merged commit f37f03d into vllm-project:main Jul 29, 2026
104 checks passed
@njhill
njhill deleted the kda-mla-nixl-pd branch July 29, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kv-connector ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants