Skip to content

[Core][Feat] Pluggable KVCacheConfigBuilder for platform/model-specific KV cache planning - #53558

Open
wangxiyuan wants to merge 2 commits into
vllm-project:mainfrom
wangxiyuan:kv_config_builder
Open

wangxiyuan wants to merge 2 commits into
vllm-project:mainfrom
wangxiyuan:kv_config_builder

Conversation

@wangxiyuan

Copy link
Copy Markdown
Contributor

Purpose

Pick from #42309 to follow up kv cache config builder implementation.

Add a pluggable KVCacheConfigBuilder so platforms or models can override KV cache planning end-to-end. Resolution order: platform override > model declaration > default. Default builder forwards to existing get_kv_cache_configs, so behavior is unchanged today.

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Co-Authored-By: Yifan Qiao yifanqiao@inferact.ai
Co-Authored-By: Mengqing Cao cmq0113@163.com

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

@mergify mergify Bot added nvidia mrv2 Model Runner V2 specific labels Aug 24, 2026
@wangxiyuan wangxiyuan changed the title [Core][Feat] Pluggable KVCacheConfigBuilder for platform/model-specif… [Core][Feat] Pluggable KVCacheConfigBuilder for platform/model-specific KV cache planning- #42309 Aug 24, 2026
@wangxiyuan wangxiyuan changed the title [Core][Feat] Pluggable KVCacheConfigBuilder for platform/model-specific KV cache planning- #42309 [Core][Feat] Pluggable KVCacheConfigBuilder for platform/model-specific KV cache planning Aug 25, 2026
@mergify

mergify Bot commented Aug 29, 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, @wangxiyuan.

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

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

@wangxiyuan, CI is now available for this PR.

  • /ci run starts upstream CI; /amd-ci run starts AMD CI only.
  • /ci retry retries failed jobs in the CI build for the current PR head. If the current head has no CI build, it starts a new CI build for the current head containing only jobs that failed in the latest earlier CI build for this PR.
  • /amd-ci retry retries failed jobs in AMD CI for the current PR head. Use /amd-ci run when the current head has no AMD CI build.
  • /ci cancel cancels scheduled or running CI builds for this PR branch; /amd-ci cancel does the same for AMD CI only.

yzeyu71 added a commit to yzeyu71/vllm-ascend that referenced this pull request Sep 10, 2026
The branch is merged after vllm-project/vllm#53558 lands, so the
try/except import fallbacks in worker.py and the dynamic patch target in
patch_kv_cache_utils.py are no longer needed: the KV cache planning entry
points are always in vllm.v1.core.kv_cache_planning.

Signed-off-by: yangzeyu <532183776@qq.com>
yzeyu71 added a commit to yzeyu71/vllm-ascend that referenced this pull request Sep 10, 2026
The branch merges after vllm-project/vllm#53558, so the superseded
DeepSeekV4 planning monkey-patches and the pre-#53558 kv_cache_utils
targets are dropped:

- patch/platform/patch_kv_cache_utils.py: keep only
  resolve_kv_cache_block_sizes, the Kimi K3 DSpark grouping,
  KVCacheConfig.has_mamba_layers and the GLM5-Next cache layout
  (ported from main), all wired to vllm.v1.core.kv_cache_planning.
  DeepSeekV4 planning lives in AscendKVCacheConfigBuilder.
- tests/ut: restore the builder-based assertions for
  test_prefix_cache_cp_patches.py and test_attn_utils_v2.py.

Signed-off-by: yangzeyu <532183776@qq.com>
yzeyu71 added a commit to yzeyu71/vllm-ascend that referenced this pull request Sep 10, 2026
The branch merges after vllm-project/vllm#53558, so the superseded
DeepSeekV4 planning monkey-patches and the pre-#53558 kv_cache_utils
targets are dropped:

- patch/platform/patch_kv_cache_utils.py: keep only
  resolve_kv_cache_block_sizes, the Kimi K3 DSpark grouping,
  KVCacheConfig.has_mamba_layers and the GLM5-Next cache layout
  (ported from main), all wired to vllm.v1.core.kv_cache_planning.
  DeepSeekV4 planning lives in AscendKVCacheConfigBuilder.
- tests/ut: restore the builder-based assertions for
  test_prefix_cache_cp_patches.py and test_attn_utils_v2.py.

Signed-off-by: yangzeyu <532183776@qq.com>
@wangxiyuan
wangxiyuan force-pushed the kv_config_builder branch 2 times, most recently from 35a8b5a to 604e7c4 Compare September 10, 2026 07:26
@wangxiyuan

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #88075 for commit 604e7c487b0c.

@mergify

mergify Bot commented Sep 11, 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, @wangxiyuan.

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

@wangxiyuan

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #88712 for commit 70c1f9f5cbd7.

@wangxiyuan

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #88755 for commit d921fa3d6499.

@mergify

mergify Bot commented Sep 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, @wangxiyuan.

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 Sep 14, 2026
…ic KV cache planning

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
@wangxiyuan

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

❌ This PR is 11 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

@wangxiyuan

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89032 for commit b2cdb1e6da66.

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

Labels

kv-cache-manager kv-connector mrv2 Model Runner V2 specific nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants