Skip to content

[CI] main2main vllm 0828 - #15410

Closed
LQDLove wants to merge 87 commits into
vllm-project:mainfrom
LQDLove:0.27.1_main2main0828
Closed

LQDLove wants to merge 87 commits into
vllm-project:mainfrom
LQDLove:0.27.1_main2main0828

Conversation

@LQDLove

@LQDLove LQDLove commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

This PR upgrades the verified vLLM main anchor to e6bfe03ad73a3330cb427885aa90d97a12e1c704 while preserving the vLLM v0.27.1 release lane. It adapts vllm-ascend to the upstream contract changes introduced across that range.

All adaptations are gated with vllm_version_is("0.27.1") so the release-lane behavior is unchanged, and each logical change point is a separate commit.

Upstream contract changes covered

Upstream PR Contract adopted here
#50465 skip_gather in vocab parallel embedding / sampling
#51718 KVCacheTensor.shared_bylayers/layer_stride; MLA compress_ratiotokens_per_state; standardized KV cache layout
#52209 Custom routed-expert weight loading
#52560 Qwen3-Omni DSpark support
#52816 / #53435 DFlash2 class factories
#53183 MRV2 becomes the default runner
#53508 Sleep-mode KV allocations / removed wake hook
#53515 Persistent PCP graph input buffers
#53694 Spec-decode dp_sync
#53869 PCP slot mappings for PIECEWISE capture

The branch is rebased onto current origin/main and includes the 310P Mamba KV fixture exposing both shared_by and layers so the same test passes on both lanes.

Does this PR introduce any user-facing change?

No. This is an internal compatibility update; it does not add an Ascend-specific public API.

How was this patch tested?

  • Unit tests adapted/added for both the v0.27.1 and main lanes (KV cache layout, MLA specs, spec-decode, PCP capture, DFlash2 factories, routed experts).

  • CI on the PR (pending).

  • vLLM main: vllm-project/vllm@ba07e4a

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the vllm-ascend codebase to track the latest vLLM main branch while preserving support for the v0.27.1 release lane. It introduces conditional logic to handle breaking upstream contract changes, ensuring compatibility across both development paths without impacting user-facing APIs.

Highlights

  • vLLM Version Upgrade: Upgraded the verified vLLM main anchor to commit e6bfe03ad73a3330cb427885aa90d97a12e1c704 while maintaining compatibility with the v0.27.1 release lane.
  • Upstream Contract Adaptations: Implemented extensive adaptations for upstream contract changes, including standardized KV cache layouts, custom routed-expert weight loading, and new runner defaults, all gated by vllm_version_is checks.
  • KV Cache Layout Refactoring: Updated KV cache tensor descriptors to handle the renaming of 'shared_by' to 'layers' and introduced standardized backing allocation logic to support vLLM main's multi-group layout.
  • CI and Test Coverage: Added and adapted unit tests for both v0.27.1 and main lanes, covering KV cache layout, MLA specs, spec-decode, and DFlash2 factories.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

Suggested PR Title:

[Misc] Adapt KV cache and model runner for vLLM main compatibility

Suggested PR Summary:

### What this PR does / why we need it?
This PR introduces compatibility updates to support both vLLM v0.27.1 and newer vLLM main snapshots. It addresses upstream changes such as the renaming of `compress_ratio` to `tokens_per_state`, `shared_by` to `layers`, and the introduction of standardized shared KV backing allocations (vLLM #51718). It also adapts speculators, model runners, and the PCP manager to handle updated keyword arguments and graph capture contracts.

Feedback on current changes:
- In `vllm_ascend/worker/v2/pcp_manager.py`, `self.input_buffers` must be explicitly assigned to `self._input_buffers` to prevent runtime errors where sequence length views are missing.
- In `vllm_ascend/worker/v2/attn_utils.py`, `AttentionLayerBase` and `UniformTypeKVCacheSpecs` are referenced in `allocate_kv_cache_main` but are not imported, which will raise a `NameError` at runtime.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Tested with updated unit tests covering both v0.27.1 and newer vLLM main branches.

Comment on lines +79 to +84
if max_num_reqs is not None and max_num_tokens is not None:
self._input_buffers = AscendInputBuffers(
max_num_reqs=2 * max_num_reqs,
max_num_tokens=max_num_tokens,
device=device,
)

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.

critical

The base class PCPManager initializes and uses self.input_buffers for persistent local buffers. Since AscendPCPManager overrides this with self._input_buffers (an instance of AscendInputBuffers), you must explicitly assign self.input_buffers = self._input_buffers. Otherwise, self.input_buffers remains the base InputBuffers instance, which lacks the Ascend-specific sequence length views and metadata, leading to runtime errors and test failures (e.g., in test_pcp_manager_uses_persistent_ascend_input_buffers).

Suggested change
if max_num_reqs is not None and max_num_tokens is not None:
self._input_buffers = AscendInputBuffers(
max_num_reqs=2 * max_num_reqs,
max_num_tokens=max_num_tokens,
device=device,
)
if max_num_reqs is not None and max_num_tokens is not None:
self._input_buffers = AscendInputBuffers(
max_num_reqs=2 * max_num_reqs,
max_num_tokens=max_num_tokens,
device=device,
)
self.input_buffers = self._input_buffers

Comment on lines +793 to +794
vllm_config = get_current_vllm_config()
attn_layers = get_layers_from_vllm_config(vllm_config, AttentionLayerBase)

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.

critical

AttentionLayerBase and UniformTypeKVCacheSpecs are referenced in allocate_kv_cache_main but are not imported in this file, which will raise a NameError at runtime when this function is called. Please import both classes (importing them inline inside the function is safe and avoids circular dependencies).

    vllm_config = get_current_vllm_config()
    from vllm.v1.attention.layer import AttentionLayerBase
    from vllm.v1.kv_cache_interface import UniformTypeKVCacheSpecs
    attn_layers = get_layers_from_vllm_config(vllm_config, AttentionLayerBase)

@LQDLove
LQDLove force-pushed the 0.27.1_main2main0828 branch from 1c28e1c to 32a1b66 Compare August 31, 2026 10:36
@mergify

mergify Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ The sha of the head commit of this PR conflicts with #14872. Mergify cannot evaluate rules on this PR. Once #14872 is merged or closed, Mergify will resume processing this PR. ⚠️

@LQDLove
LQDLove force-pushed the 0.27.1_main2main0828 branch from 32a1b66 to 808333f Compare August 31, 2026 10:43
@zhao-stack zhao-stack added the ready-all run all e2e test for pr label Aug 31, 2026
@LQDLove

LQDLove commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

/cancel
[Bot]: successfully force-cancelled the following runs:

https://github.com/vllm-project/vllm-ascend/actions/runs/33385103557

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@LQDLove LQDLove closed this Sep 1, 2026
@LQDLove LQDLove reopened this Sep 2, 2026
@LQDLove
LQDLove force-pushed the 0.27.1_main2main0828 branch from 808333f to 435a40f Compare September 2, 2026 02:17
@LQDLove

LQDLove commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

/e2e tests/e2e/pull_request/four_card/_310p/test_model_runner_v2_310p.py tests/e2e/pull_request/four_card/spec_decode/test_dspark_deepseekv4.py tests/e2e/pull_request/four_card/context_parallel/test_accuracy.py
[Bot]: e2e command triggered. See workflow run for details.
[Bot]: e2e command failed.

@github-actions github-actions Bot removed the ci/build label Sep 2, 2026
@LQDLove
LQDLove force-pushed the 0.27.1_main2main0828 branch from 435a40f to ea8c600 Compare September 2, 2026 02:20
@LQDLove

LQDLove commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

/e2e tests/e2e/pull_request/four_card/_310p/test_model_runner_v2_310p.py tests/e2e/pull_request/four_card/spec_decode/test_dspark_deepseekv4.py tests/e2e/pull_request/four_card/context_parallel/test_accuracy.py
[Bot]: e2e command triggered. See workflow run for details.
[Bot]: e2e command failed.

@LQDLove

LQDLove commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

/e2e tests/e2e/pull_request/four_card/_310p/test_model_runner_v2_310p.py tests/e2e/pull_request/four_card/spec_decode/test_dspark_deepseekv4.py tests/e2e/pull_request/four_card/context_parallel/test_accuracy.py
[Bot]: e2e command triggered. See workflow run for details.
[Bot]: e2e command failed.

shenzhao and others added 12 commits September 5, 2026 17:56
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Use the PCP-local block table backing during full graph capture so replay reads the same storage that runtime prepare_attn updates. Add a regression test for the captured pointer contract.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Recover aligned KV backing regions from tensor storage and register each physical allocation once across aliased KVCacheTensor descriptors. Keep support for private per-layer storage by registering the actual strided address span, and cover both Mooncake connector paths with regression tests.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
Drop the shared Mooncake registration refactor and limit the PR 14872 fix to the legacy hybrid connector. Register each descriptor's actual tensor byte range and merge only overlapping ranges before handing them to Mooncake.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
vLLM #51718 removed AttentionSpec.indexes_kv_by_block_stride on main. AscendMLAAttentionSpec.merge(), the kpool MLA spec construction, and the GLM-5.3 kpool indexer spec opt-in still read or wrote that field unconditionally, raising AttributeError on the main lane. Gate all three usages behind vllm_version_is(0.27.1).

Signed-off-by: liaoqidan <1107297340@qq.com>
Signed-off-by: liaoqidan <1107297340@qq.com>
- Gate mamba_has_prefill_checkpoint_blocks on the mock scheduler (added in
  vLLM main, absent in v0.27.1) for the mamba block-aligned split patch tests
- Gate dp_sync in the v2 ExecuteModelState construction (added in vLLM main)
  for the PCP manager sample_tokens tests

Signed-off-by: liaoqidan <1107297340@qq.com>
Signed-off-by: liaoqidan <1107297340@qq.com>
Provide _hidden_restore_idx and a real compilation_config so the merged is_full_decode_graph padding path works under UT mocks.

Signed-off-by: liaoqidan <1107297340@qq.com>
…PC regions

Hybrid KV cache tensors shared across layer groups only registered the minimum address of each descriptor, leaving overlay groups (full attention, SWA, state cache) with zero registered addresses so their block-id mappings were never transferred and decode read misaligned KV. Collect every unique address with the full set of referencing groups. Also align IPC regions down/up to 2MB pages so devmm IPC export no longer rejects unaligned registrations with Invalid para (-22).

Signed-off-by: liaoqidan <1107297340@qq.com>
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions Bot added documentation Improvements or additions to documentation module:quantization module:tools labels Sep 5, 2026
Extend the run-selected-tests, run-selected-tests-upstream, and run-selected-tests-a5 matrices to include both the vLLM main verified commit and the v0.27.1 release tag, so a single PR exercises both pipelines. main_commit stays for cpu-ut and the mypy checkout.

Signed-off-by: liaoqidan <1107297340@qq.com>
@LQDLove
LQDLove force-pushed the 0.27.1_main2main0828 branch from bdd31fa to fc00e1c Compare September 5, 2026 10:24
@mergify

mergify Bot commented Sep 5, 2026

Copy link
Copy Markdown

⚠️ The sha of the head commit of this PR conflicts with #14872. Mergify cannot evaluate rules on this PR. Once #14872 is merged or closed, Mergify will resume processing this PR. ⚠️

@LQDLove

LQDLove commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

/cancel
[Bot]: successfully force-cancelled the following runs:

https://github.com/vllm-project/vllm-ascend/actions/runs/33960594456
https://github.com/vllm-project/vllm-ascend/actions/runs/33959824868

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@LQDLove LQDLove closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants