Skip to content

[v0.13.0][Bugfix] Fix XliteModelRunner init failed when aclgraph is enabled#5887

Merged
yiz-liu merged 1 commit intovllm-project:releases/v0.13.0from
changdawei1:v0.13.0
Jan 21, 2026
Merged

[v0.13.0][Bugfix] Fix XliteModelRunner init failed when aclgraph is enabled#5887
yiz-liu merged 1 commit intovllm-project:releases/v0.13.0from
changdawei1:v0.13.0

Conversation

@changdawei1
Copy link
Copy Markdown
Contributor

@changdawei1 changdawei1 commented Jan 14, 2026

What this PR does / why we need it?

Fix XliteModelRunner init failed when aclgraph is enabled. Ensure function graph_capture of vllm.v1.worker.gpu_model_runner is replaced.

Does this PR introduce any user-facing change?

How was this patch tested?

@changdawei1 changdawei1 changed the title [Bugfix] Fix XliteModelRunner init failed when aclgraph is enabled [v0.13.0][Bugfix] Fix XliteModelRunner init failed when aclgraph is enabled Jan 14, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a bug in XliteModelRunner that led to an initialization failure when aclgraph is enabled. The problem was that the inherited capture_model method was incorrectly identifying a module for patching, which is essential for Ascend NPU graph capturing. The fix correctly overrides capture_model in XliteModelRunner to locate the appropriate module. The change is correct and necessary. I have included one suggestion to enhance the implementation's robustness and maintainability by avoiding string-based class lookups.

Comment thread vllm_ascend/xlite/xlite_model_runner.py Outdated
Comment on lines +44 to +49
gpu_runner_cls = next((cls for cls in self.__class__.__mro__
if cls.__name__ == "GPUModelRunner"), None)
if gpu_runner_cls is None:
raise TypeError("Could not find GPUModelRunner in the MRO. "
"The class hierarchy may have changed.")
parent_module_name = gpu_runner_cls.__module__
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

Since GPUModelRunner is imported, you can simplify this logic by using the class object directly instead of searching for it in the MRO by its string name. This approach is more robust and less likely to break if the class is ever renamed.

You can replace this block with a simple isinstance check and direct access to GPUModelRunner.__module__.

        if not isinstance(self, GPUModelRunner):
            raise TypeError("Could not find GPUModelRunner in the MRO. "
                            "The class hierarchy may have changed.")
        parent_module_name = GPUModelRunner.__module__

@changdawei1 changdawei1 force-pushed the v0.13.0 branch 3 times, most recently from c848e46 to 891fc7c Compare January 14, 2026 09:31
Signed-off-by: changdawei1 <changdawei3@huawei.com>
@yiz-liu yiz-liu merged commit cb6cd09 into vllm-project:releases/v0.13.0 Jan 21, 2026
12 checks passed
845473182 pushed a commit to 845473182/vllm-ascend that referenced this pull request Jan 21, 2026
…lm-ascend into FIA_v0.13.0

* 'releases/v0.13.0' of https://github.com/vllm-project/vllm-ascend:
  [0.13.0][Bugfix] Fix setting of `speculative_config.enforce_eager` for dsv32 (vllm-project#5958)
  [v0.13.0][Bugfix] Fix XliteModelRunner init failed when aclgraph is enabled (vllm-project#5887)
  [0.13.0][Bugfix] Fixed an problem related to embeddings sharing (vllm-project#5972)
  [Bugfix]Fixed precision issues caused by pooled request pooling (vllm-project#6057)
  [0.13.0][Bugfix] fix pcp aclgraph qwen FIA bug (vllm-project#6038)
  [0.13.0][cherry-pick][bugfix] fix bug of triton mrope (vllm-project#6009)
  【0.13.0】【bugfix】Resolved memory deallocation failure in the pooling layer under re-computation workloads. (vllm-project#6056)
tangtiangu pushed a commit to tangtiangu/jiusi-vllm-ascend that referenced this pull request Feb 24, 2026
…nabled (vllm-project#5887)

### What this PR does / why we need it?
Fix XliteModelRunner init failed when aclgraph is enabled. Ensure
function graph_capture of vllm.v1.worker.gpu_model_runner is replaced.

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

### How was this patch tested?

Signed-off-by: changdawei1 <changdawei3@huawei.com>
tangtiangu pushed a commit to tangtiangu/jiusi-vllm-ascend that referenced this pull request Feb 24, 2026
…nabled (vllm-project#5887)

### What this PR does / why we need it?
Fix XliteModelRunner init failed when aclgraph is enabled. Ensure
function graph_capture of vllm.v1.worker.gpu_model_runner is replaced.

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

### How was this patch tested?

Signed-off-by: changdawei1 <changdawei3@huawei.com>
@changdawei1 changdawei1 deleted the v0.13.0 branch April 2, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants