Skip to content

[CI] main2main-0717 - #12218

Closed
zhao-stack wants to merge 34 commits into
vllm-project:mainfrom
zhao-stack:codex/m2m-0717-latest-main
Closed

[CI] main2main-0717#12218
zhao-stack wants to merge 34 commits into
vllm-project:mainfrom
zhao-stack:codex/m2m-0717-latest-main

Conversation

@zhao-stack

@zhao-stack zhao-stack commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

Baselines

v0.25 compatibility decisions

Area Decision
Grouped block hashes (vLLM #45939) v0.25 and the verified main target both use the terminal chained fine-grained hash. The old release-only rehash branch was removed instead of moving its gate to v0.25.
FLA relocation (vLLM #48500) Keep a v0.25 gate: release imports vllm.model_executor.layers.fla, while the verified main target imports vllm.third_party.flash_linear_attention.
KV-cache contracts (vLLM #46384/#47782) Keep v0.25 gates for manager-side hash resolution, exact hit lengths, allocation signatures, and coordinator return shapes. The per-group hit API returns a length tuple on both lanes, so that part is ungated; Recompute/Balance schedulers consume it with max(). Main-only partial Mamba-align hits use hash-block alignment.
GDN ABI (vLLM #46998) Reuse the unified adapter already present on latest vllm-ascend main. Tests exercise the v0.25 two-argument/output-buffer call and the verified-main one-argument/tensor-return call; no duplicate production ABI branch is kept.
Qwen sequence parallel / logits (vLLM #47006/#48429/#48390) Keep v0.25 gates because the release tag still has the older decoder, gather, and logits-head contracts.
MRV2 / speculative decode (vLLM #48261/#48167) Target the verified main node only: use the unified graph manager, target buffers/groups, parameterless capture, and _group_causal. Model Runner V2 speculative decoding does not claim v0.25 tag compatibility until formal bring-up and debugging.
Hunyuan processor Preserve the bundled v0.25 processor and clean its stale registry; use the native Transformers processor on verified main. Bare image-token wrapping is backported only to v0.25.
swap_space cleanup (vLLM #48549) The removed test argument is compatible with both supported lanes, so no version gate is needed.

Rebase notes

  • The original PR branch was backed up before rewriting.
  • The first rebase dropped the obsolete GDN production split because latest vllm-ascend main already contains the unified v0.25-compatible adapter from [Misc] Upgrade vllm to 0.25.0 #12233.
  • vllm-ascend main advanced once more during this update. The final rebase onto 69d1d6fe was conflict-free, and git range-diff reported all 32 commits patch-equivalent to the already reviewed intermediate head.

Does this PR introduce any user-facing change?

Yes. The supported release lane is now vLLM v0.25.0; the verified main lane remains pinned to fe784ff2. Model Runner V2 speculative decoding in this PR is intentionally main-only and does not claim release-tag compatibility.

How was this patch tested?

  • Ruff lint and format checks passed for the six files changed by the final MRV2 main-only cleanup.

  • Focused mypy with the CI Python 3.10 settings passed for those six files; the previous no-redef, valid-type, and misc failures are eliminated.

  • GitHub Actions lint-and-select-tests passed on head 5b2bccf7, including both pre-commit and mypy.

  • Follow-up head 468fba5a keeps MRV2 speculative decoding main-only at the registration boundary: v0.25 skips only the Eagle, DFlash, and DSpark MRV2 speculative cases, while ordinary MRV2 coverage remains enabled. Focused Ruff, codespell, typos, repository checks, and mypy for Python 3.10/3.11/3.12 passed locally.

  • git diff --check passed.

  • The main2main mapping validate and predict passes were rerun against the exact verified target, followed by manual review of method, field, call, registration, inheritance, and broad candidates touched by this PR.

  • Source contracts were compared directly at vLLM v0.25.0 and fe784ff2. Non-MRV2 version gates above follow those exact refs; worker/v2/spec_decode is bound only to fe784ff2.

  • Added/updated regression coverage for grouped hashes, KV-cache per-group hit tuples, GDN lane calls, FLA imports, and speculative graph registration.

  • Local pytest collection is unavailable in this workspace because torch and vllm are not installed; head 468fba5a has triggered GitHub CI for executable unit/device coverage.

  • vLLM version: v0.25.0

  • vLLM main: vllm-project/vllm@85c09e9

@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 synchronizes the vllm-ascend repository with the latest upstream vLLM main branch (commit fe784ff2). It implements necessary compatibility adaptations to ensure the Ascend-specific extensions function correctly across different vLLM versions. Key changes include refactoring KV cache management, updating speculative decoding graph capture logic, and adding version-specific conditional checks to maintain stability.

Highlights

  • Upstream Synchronization: Advanced the verified vLLM main anchor from commit 915dffaa to fe784ff2.
  • Version Compatibility: Introduced conditional logic using vllm_version_is('0.24.0') to handle API changes between vLLM versions.
  • Core Refactoring: Updated KV cache manager, coordinator, and speculative decoding graph manager signatures to align with upstream API evolutions.
  • CI Updates: Updated .github/vllm-main-verified.commit to track the new upstream anchor.
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.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/pr_test.yaml
    • .github/workflows/scripts/run_selected_tests.sh
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][Misc] Support compatibility with vLLM v0.24.0

Suggested PR Summary:

### What this PR does / why we need it?
This PR introduces compatibility updates across various modules (schedulers, coordinators, speculators, and operators) to support both vLLM v0.24.0 and other verified main refs. It dynamically adjusts block size calculations, cache hit lookups, and attention forward passes based on the detected vLLM version.

Feedback: In `vllm_ascend/patch/worker/patch_qwen3_5.py`, the direct call to `_all_gather_hidden_and_residual` in `qwen3_5_mtp_forward` bypasses the patched `_ascend_all_gather_hidden_and_residual` wrapper, which would prevent sequence-parallel communication optimization when `flash_comm_v1_enabled` is active.

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

### How was this patch tested?
Existing and updated unit tests in `tests/ut/` and `tests/e2e/`.

Comment on lines +231 to +237
if not _IS_VLLM_RELEASE and mtp_layer.use_attn_reduce_scatter_for_moe:
hidden_states, residual = _all_gather_hidden_and_residual(
hidden_states,
residual,
positions.shape[-1],
self.config.hidden_size,
)

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.

high

In qwen3_5_mtp_forward, the code calls _all_gather_hidden_and_residual directly. However, because _all_gather_hidden_and_residual was imported directly from vllm.model_executor.models.qwen3_next at the top of the file, calling it directly bypasses the patched version _ascend_all_gather_hidden_and_residual. This means that when _EXTRA_CTX.flash_comm_v1_enabled is True, the all-gather will still be executed, bypassing the sequence-parallel communication optimization. To fix this, you should call the patched wrapper _ascend_all_gather_hidden_and_residual instead.

Suggested change
if not _IS_VLLM_RELEASE and mtp_layer.use_attn_reduce_scatter_for_moe:
hidden_states, residual = _all_gather_hidden_and_residual(
hidden_states,
residual,
positions.shape[-1],
self.config.hidden_size,
)
if not _IS_VLLM_RELEASE and mtp_layer.use_attn_reduce_scatter_for_moe:
hidden_states, residual = _ascend_all_gather_hidden_and_residual(
hidden_states,
residual,
positions.shape[-1],
self.config.hidden_size,
)

@zhao-stack zhao-stack added ready enable e2e test for PR and removed ready enable e2e test for PR labels Jul 17, 2026
@zhao-stack
zhao-stack force-pushed the codex/m2m-0717-latest-main branch from fc8f839 to 6e301b6 Compare July 17, 2026 06:11
@zhao-stack

Copy link
Copy Markdown
Collaborator Author

from vllm.v1.worker.gpu.spec_decode.autoregressive import speculator as vllm_speculator_module

from vllm_ascend.worker.v2.spec_decode.eagle.aclgraph import DecodeEagleAclGraphManager, PrefillEagleAclGraphManager
from vllm_ascend.worker.v2.spec_decode.eagle.aclgraph import EagleAclGraphManager

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.

Did vllm deletes PrefillEagleAclGraphManager?
Now, there is only DecodeEagleAclGraphManager?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

DecodeEagleAclGraphManager and PrefillEagleAclGraphManager are merged into EagleAclGraphManager.

@wxsIcey wxsIcey Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, vllm delete it, please see vllm-project/vllm#48261 @drslark

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.

Okay, but I think the name SpeculatorCudaGraphManager should be changed to EagleAclGraphManager.

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.

My mistake, it is EagleAclGraphManager to be change to SpeculatorCudaAclManager.
Also, this task should not be done in this pr.
I will add it to my todo list.

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.

LGTM. I think it is good. I will approve it.
Thanks for your adaptation.

num_tokens_across_dp,
)

CudaGraphManager.capture(self, create_forward_fn, progress_bar_desc=progress_bar_desc)

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.

Did vllm change capture to staticmethod?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, CudaGraphManager.capture is still an instance method. The explicit call
CudaGraphManager.capture(self, create_forward_fn, ...)
is used to bypass SpeculatorCudaGraphManager.capture for the Ascend decode path. This path needs its own create_forward_fn to preserve the Ascend-specific PIECEWISE skip_attn handling and num_tokens_across_dp preparation.
self is therefore passed explicitly as with a normal unbound instance-method call. For the prefill path, we use super().capture(...) directly to reuse the new unified upstream implementation.

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.

Okay, i see.
You are right.
I think it is okay.

wangxiyuan pushed a commit that referenced this pull request Jul 20, 2026
### What this PR does / why we need it?

#### Root cause and provenance

The CPU unit-test lane in [run
29653393420](https://github.com/vllm-project/vllm-ascend/actions/runs/29653393420)
fails while collecting `tests/ut/_tools/test_generate_zh_docs.py`:

```text
tests/ut/_tools/test_generate_zh_docs.py:1: in <module>
    from tools.generate_zh_docs import apply_translations
tools/generate_zh_docs.py:16: in <module>
    from polib import pofile
E   ModuleNotFoundError: No module named 'polib'
```

- [PR #11252](#11252),
merged as `fbbf5167ada3f3b59909bcf947e69036fc4af425`, introduced the
Chinese-doc generator, its top-level `polib` import, and `polib` in
`docs/requirements-docs.txt`.
- [PR #12331](#12331),
merged as `ff83573c37c0bc84e33111e0558086f2c4d73aea`, added
`test_generate_zh_docs.py`. That test imports only the pure
`apply_translations` helper.
- The selected-test CPU environment installs `requirements-dev.txt`, not
`docs/requirements-docs.txt`, so it correctly does not contain the
docs-only `polib` package. Both the [main CPU
job](https://github.com/vllm-project/vllm-ascend/actions/runs/29653393420/job/88103795623)
and [v0.24.0 CPU
job](https://github.com/vllm-project/vllm-ascend/actions/runs/29653393420/job/88103795682)
fail at the same collection point.

#### Minimal fix

Move `from polib import pofile` into `parse_po_file()`, the only path
that actually reads PO files.

This keeps `polib` in the existing documentation dependency group,
avoids adding a docs-only package to core/runtime or general test
dependencies, and allows pure Markdown translation helpers to be
imported and tested without the optional docs stack. Calling the real PO
parsing path still imports and requires `polib` as intended.

This is an existing `main` issue and is independent of PR #12218 and its
main2main changes.

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

No. It only narrows when an existing documentation dependency is
imported.

### How was this patch tested?

From current `upstream/main` `e1bd15041af9d9e1a274ae381da0bc0dd8b50e4d`:

- Reproduced the collection failure in an isolated environment with
`regex` and `pytest`, but no `polib`.
- Verified ordinary `tools.generate_zh_docs` import succeeds when
`polib` is absent.
- `pytest -q --confcutdir=tests/ut/_tools
tests/ut/_tools/test_generate_zh_docs.py` without `polib`: `4 passed`.
- `pytest --collect-only -q --confcutdir=tests/ut/_tools
tests/ut/_tools/test_generate_zh_docs.py` without `polib`: `4 tests
collected`.
- Parsed a temporary PO file through `parse_po_file()` with `polib`
installed and verified the expected `{"Hello": "你好"}` mapping.
- `ruff check tools/generate_zh_docs.py
tests/ut/_tools/test_generate_zh_docs.py`.
- `ruff format --check tools/generate_zh_docs.py
tests/ut/_tools/test_generate_zh_docs.py`.
- `git diff --check`.

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

Signed-off-by: zhao-stack <2020265299@qq.com>
@zhao-stack
zhao-stack force-pushed the codex/m2m-0717-latest-main branch from cbf132c to 7bc8fcd Compare July 20, 2026 02:37


class DecodeEagleAclGraphManager(DecodeSpeculatorCudaGraphManager):
class EagleAclGraphManager(SpeculatorCudaGraphManager):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I reviewed the logic, merging the two Managers here is right. However, I think naming the class SpeculatorAclGraphManager would be more appropriate. This class will be refactored and promoted to the autoregressive directory later.

@wxsIcey wxsIcey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the modification to the mrv2 spec decode is correct. For other modules, please confirm with the relevant person in charge.

from vllm.v1.worker.gpu.spec_decode.autoregressive import speculator as vllm_speculator_module

from vllm_ascend.worker.v2.spec_decode.eagle.aclgraph import DecodeEagleAclGraphManager, PrefillEagleAclGraphManager
from vllm_ascend.worker.v2.spec_decode.eagle.aclgraph import EagleAclGraphManager

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.

Okay, but I think the name SpeculatorCudaGraphManager should be changed to EagleAclGraphManager.

@zhao-stack
zhao-stack requested a review from drslark July 20, 2026 04:02
shenzhao and others added 19 commits July 20, 2026 17:46
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Align the main lane with vLLM #47006 and #48429 while preserving the v0.24.0 decoder wrapper.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
vLLM #48549 removed LLM's compatibility shim for the deprecated and ignored swap_space keyword. Stop forwarding it from VllmRunner and DPVllmRunner.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
(cherry picked from commit 68f7c48)
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
Use the per-KV-group causal state retained after vLLM #48167 removed dflash_causal.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: zhao-stack <2020265299@qq.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
@zhao-stack
zhao-stack force-pushed the codex/m2m-0717-latest-main branch from 8a74268 to 1e32921 Compare July 20, 2026 09:47
shenzhao added 2 commits July 20, 2026 19:30
Remove v0.25 tag compatibility from model runner v2 speculative decoding and bind the implementations directly to the verified vLLM main contracts.

Signed-off-by: shenzhao <shenzhao9@huawei.com>
Signed-off-by: shenzhao <shenzhao9@huawei.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

from vllm.v1.worker.gpu.spec_decode.autoregressive import speculator as vllm_speculator_module

from vllm_ascend.worker.v2.spec_decode.eagle.aclgraph import DecodeEagleAclGraphManager, PrefillEagleAclGraphManager
from vllm_ascend.worker.v2.spec_decode.eagle.aclgraph import EagleAclGraphManager

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.

LGTM. I think it is good. I will approve it.
Thanks for your adaptation.

@zhao-stack

Copy link
Copy Markdown
Collaborator Author

This PR will not be merged. We will use the main2main workflow to upgrade.

@zhao-stack zhao-stack closed this Jul 21, 2026
Alex-stack-hub pushed a commit to 0moyi0-2024/vllm-ascend_tp that referenced this pull request Jul 27, 2026
…roject#12352)

### What this PR does / why we need it?

#### Root cause and provenance

The CPU unit-test lane in [run
29653393420](https://github.com/vllm-project/vllm-ascend/actions/runs/29653393420)
fails while collecting `tests/ut/_tools/test_generate_zh_docs.py`:

```text
tests/ut/_tools/test_generate_zh_docs.py:1: in <module>
    from tools.generate_zh_docs import apply_translations
tools/generate_zh_docs.py:16: in <module>
    from polib import pofile
E   ModuleNotFoundError: No module named 'polib'
```

- [PR vllm-project#11252](vllm-project#11252),
merged as `fbbf5167ada3f3b59909bcf947e69036fc4af425`, introduced the
Chinese-doc generator, its top-level `polib` import, and `polib` in
`docs/requirements-docs.txt`.
- [PR vllm-project#12331](vllm-project#12331),
merged as `ff83573c37c0bc84e33111e0558086f2c4d73aea`, added
`test_generate_zh_docs.py`. That test imports only the pure
`apply_translations` helper.
- The selected-test CPU environment installs `requirements-dev.txt`, not
`docs/requirements-docs.txt`, so it correctly does not contain the
docs-only `polib` package. Both the [main CPU
job](https://github.com/vllm-project/vllm-ascend/actions/runs/29653393420/job/88103795623)
and [v0.24.0 CPU
job](https://github.com/vllm-project/vllm-ascend/actions/runs/29653393420/job/88103795682)
fail at the same collection point.

#### Minimal fix

Move `from polib import pofile` into `parse_po_file()`, the only path
that actually reads PO files.

This keeps `polib` in the existing documentation dependency group,
avoids adding a docs-only package to core/runtime or general test
dependencies, and allows pure Markdown translation helpers to be
imported and tested without the optional docs stack. Calling the real PO
parsing path still imports and requires `polib` as intended.

This is an existing `main` issue and is independent of PR vllm-project#12218 and its
main2main changes.

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

No. It only narrows when an existing documentation dependency is
imported.

### How was this patch tested?

From current `upstream/main` `e1bd15041af9d9e1a274ae381da0bc0dd8b50e4d`:

- Reproduced the collection failure in an isolated environment with
`regex` and `pytest`, but no `polib`.
- Verified ordinary `tools.generate_zh_docs` import succeeds when
`polib` is absent.
- `pytest -q --confcutdir=tests/ut/_tools
tests/ut/_tools/test_generate_zh_docs.py` without `polib`: `4 passed`.
- `pytest --collect-only -q --confcutdir=tests/ut/_tools
tests/ut/_tools/test_generate_zh_docs.py` without `polib`: `4 tests
collected`.
- Parsed a temporary PO file through `parse_po_file()` with `polib`
installed and verified the expected `{"Hello": "你好"}` mapping.
- `ruff check tools/generate_zh_docs.py
tests/ut/_tools/test_generate_zh_docs.py`.
- `ruff format --check tools/generate_zh_docs.py
tests/ut/_tools/test_generate_zh_docs.py`.
- `git diff --check`.

- vLLM version: v0.24.0
- vLLM main:
vllm-project/vllm@85c09e9

Signed-off-by: zhao-stack <2020265299@qq.com>
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.

10 participants