Skip to content

[CI]test: restore ACL graph path for Qwen3-235B accuracy validation A - #16863

Open
U1stRsouland wants to merge 1 commit into
vllm-project:mainfrom
U1stRsouland:codex/verify-qwen235b-restore-aclgraph
Open

U1stRsouland wants to merge 1 commit into
vllm-project:mainfrom
U1stRsouland:codex/verify-qwen235b-restore-aclgraph

Conversation

@U1stRsouland

@U1stRsouland U1stRsouland commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Reapply the ACL graph replay implementation reverted by #16726 to validate the Qwen3-235B A3 three-node PD accuracy regression.

What this PR does / why we need it?

Does this PR introduce any user-facing change?

How was this patch tested?

Reapply the ACL graph replay implementation reverted by vllm-project#16726 to validate the Qwen3-235B A3 three-node PD accuracy regression.

Signed-off-by: U1stRsouland <19800362117@163.com>
@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.

@U1stRsouland U1stRsouland changed the title [CI]test: restore ACL graph path for Qwen3-235B accuracy validation [CI]test: restore ACL graph path for Qwen3-235B accuracy validation A Sep 18, 2026
@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 introduces the UpdatableGraph framework to standardize how attention graphs are updated and replayed on Ascend NPUs. By replacing manual parameter tracking with a task-based registration system, the changes improve the robustness of graph-based inference and resolve previous regression issues encountered during Qwen3-235B accuracy validation.

Highlights

  • UpdatableGraph Implementation: Introduced the UpdatableGraph framework to centralize and simplify the graph update logic for attention backends, replacing manual parameter management with a task-based registration system.
  • Refactored Attention Backends: Migrated attention backends to utilize the new UpdatableGraph, improving maintainability and resolving previous regression issues.
  • Test Restoration: Restored and updated ACL graph tests to support the new UpdatableGraph architecture, ensuring accuracy validation for Qwen3-235B.
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. ↩

@czydyy

czydyy commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

/nightly QWEN3_235B_PD
nightly command triggered.

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

[Attention][Feature] Introduce UpdatableGraph for dynamic host-side attention metadata updates

Suggested PR Summary:

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

This PR refactors the attention graph replay mechanism by introducing `UpdatableGraph` (inheriting from `NPUGraph`). It replaces the legacy static graph parameter updates for Fused Infer Attention (FIA) and Paged Attention (PA) with a dynamic, host-side update mechanism. This is achieved by registering tasks with parameter providers (`FIAParamProvider`, `FIAV2ParamProvider`, `PAParamProvider`) that resolve metadata at runtime.

Additionally, the PR:
- Updates `weak_ref_tensors` to recursively process containers and only weak-reference NPU tensors.
- Integrates `UpdatableGraph` across model runners, speculators, and speculative decoding proposers (Eagle, DFlash, DSpark).
- Cleans up legacy update paths and refactors unit tests to mock and verify the new `UpdatableGraph` behavior.

Feedback:
An issue was identified in `vllm_ascend/compilation/updatable_graph.py` where `factory()` is called redundantly when initializing a new resource with `use_max_workspace=True`, leading to unnecessary memory allocations. This can be optimized using an `elif` block.

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

No user-facing API changes are introduced. This is an internal refactoring of the graph capture and replay mechanism for Ascend NPU.

### How was this patch tested?

The changes were tested using updated unit tests in `tests/ut/attention/test_attention_v1.py`, `tests/ut/compilation/test_acl_graph.py`, and speculative decoding tests.

Comment on lines +102 to +112
if key not in self.capture_resources:
self.capture_resources[key] = factory()
if use_max_workspace:
# Some models mix attention layer shapes under the same graph size.
# During capture, keep the largest required workspace for that size.
candidate_workspace = factory()
if (
candidate_workspace.numel() * candidate_workspace.element_size()
> self.capture_resources[key].numel() * self.capture_resources[key].element_size()
):
self.capture_resources[key] = candidate_workspace

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

When 'key' is not present in 'self.capture_resources', 'factory()' is called to initialize it. However, if 'use_max_workspace' is True, 'factory()' is immediately called a second time to obtain 'candidate_workspace', which is then compared against the newly created resource. Since both calls use the same inputs, they will return identical workspaces, making the second call redundant and leading to unnecessary memory allocation of a potentially large workspace tensor during graph capture.\n\nUsing an 'elif' block for the 'use_max_workspace' check avoids this redundant call when the key is first initialized.

        if key not in self.capture_resources:\n            self.capture_resources[key] = factory()\n        elif use_max_workspace:\n            # Some models mix attention layer shapes under the same graph size.\n            # During capture, keep the largest required workspace for that size.\n            candidate_workspace = factory()\n            if (\n                candidate_workspace.numel() * candidate_workspace.element_size()\n                > self.capture_resources[key].numel() * self.capture_resources[key].element_size()\n            ):\n                self.capture_resources[key] = candidate_workspace

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

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