Skip to content

[Performance][NIXL] Optimize nixl descriptors for block-outermost kv cache layout - #60851

Open
ilmarkov wants to merge 8 commits into
vllm-project:mainfrom
neuralmagic:imarkov/glm53-optimize-nixl-packing
Open

ilmarkov wants to merge 8 commits into
vllm-project:mainfrom
neuralmagic:imarkov/glm53-optimize-nixl-packing

Conversation

@ilmarkov

@ilmarkov ilmarkov commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Coalesce eligible, physically adjacent MLA KV-cache layer views into packed NIXL memory regions within each transfer group. This reduces repeated block-descriptor registration while preserving the transfer-group mappings.
The new partial-span coalescing applies to NIXL pull workers only. Push keeps its existing packed-row registration; this change does not add partial-span coalescing or mixed-layout fallback for push. Push can be supported with this optimization in follow-up PRs.

Claims

The optimization requires a block-outermost KV-cache layout; the GLM-5.3 deployment used BLHNC. Coalescing also requires compatible region geometry and adjacency. Other layouts and ineligible regions use the standard registration path.

Validated with RedHatAI/GLM-5.3-MXFP4 on a GB200 NVL72, using one EP8 prefill replica and one EP8 decode replica. The deployment used the block-outermost BLHNC layout. The workload was Weka agentic multi-turn replay, with roughly 110–160K input tokens and 900–1,000 output tokens per request.

At concurrency 32, the NIXL numbers are:

  • NIXL post p95: about 3.85 s before optimization, with spikes to 5 s; about 52 ms after.
  • NIXL transfer p95: about 4.52 s before; about 81 ms after.
  • Pool-level registered descriptors: 3,234,222 before versus 121,580 after, about 96% fewer, assuming comparable KV-pool sizes and configuration.

Latency figures are medians across the dashboards’ repeated p95 estimates during each run.

Validation

Added unit coverage for NIXL descriptor geometry and push-connector layout metadata.

gsm8k validation
RedHatAI/GLM-5.3-MXFP4, P/D deployment prefill DEP8, decode DEP8, VLLM_KV_CACHE_LAYOUT: "BLHNC", dspark(RedHatAI/GLM-5.3-speculator.dspark)

|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9598|±  |0.0054|
|     |       |strict-match    |     5|exact_match|↑  |0.9598|±  |0.0054|

Details

Root problem

With GLM-5.3’s block-outermost KV layout, adjacent MLA layer views can occupy contiguous memory. NIXL’s registration loop still registers those views separately, repeating block descriptors across layers. This increases registered descriptor volume and contributes to NIXL post overhead.

Design

Coalesce adjacent, geometry-compatible MLA views into a wider NIXL region within the same transfer group. Preserve the layer-to-region mapping and exclude packed-span regions from later address-based deduplication.

The optimization is guarded by backing-storage, device, cache-spec, stride, block-count, and adjacency checks. Ineligible regions continue through the normal registration path.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (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.

Signed-off-by: Markov Ilya <markovilya197@gmail.com>
@mergify

mergify Bot commented Oct 9, 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, @ilmarkov.

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

…kov/glm53-optimize-nixl-packing

Signed-off-by: Markov Ilya <markovilya197@gmail.com>
@mergify mergify Bot removed the needs-rebase label Oct 9, 2026
Signed-off-by: Markov Ilya <markovilya197@gmail.com>
@mergify

mergify Bot commented Oct 9, 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, @ilmarkov.

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

Signed-off-by: Markov Ilya <markovilya197@gmail.com>
…e-nixl-packing

# Conflicts:
#	vllm/distributed/kv_transfer/kv_connector/v1/nixl/base_worker.py

Signed-off-by: Markov Ilya <markovilya197@gmail.com>
@mergify mergify Bot removed the needs-rebase label Oct 12, 2026
Signed-off-by: Markov Ilya <markovilya197@gmail.com>
Signed-off-by: Markov Ilya <markovilya197@gmail.com>
@ilmarkov ilmarkov changed the title Optimize nixl descriptors for block-outermost kv cache layout [Performance][NIXL] Optimize nixl descriptors for block-outermost kv cache layout Oct 12, 2026
Signed-off-by: Markov Ilya <markovilya197@gmail.com>
@ilmarkov
ilmarkov marked this pull request as ready for review October 12, 2026 11:05

@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.

@ilmarkov

Copy link
Copy Markdown
Contributor Author

Related to #60564

@mergify

mergify Bot commented Oct 14, 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, @ilmarkov.

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 Oct 14, 2026
@mergify mergify Bot added the nixl NIXL KV connector / multi-tiered KV offloading (KVCR) label Oct 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kv-connector needs-rebase nixl NIXL KV connector / multi-tiered KV offloading (KVCR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant