From e8bbf72867fbbe1e0d5b3cead867571e4178e20d Mon Sep 17 00:00:00 2001 From: Magnus Date: Thu, 15 Jan 2026 15:40:28 +0800 Subject: [PATCH] [Bugfix] Fix XliteModelRunner init failed when aclgraph is enabled (#5899) ### 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. - vLLM version: v0.13.0 - vLLM main: https://github.com/vllm-project/vllm/commit/bde38c11df0ea066a740efe9b77fff5418be45df Signed-off-by: changdawei1 --- vllm_ascend/worker/model_runner_v1.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vllm_ascend/worker/model_runner_v1.py b/vllm_ascend/worker/model_runner_v1.py index b7497a8e..35385cb2 100644 --- a/vllm_ascend/worker/model_runner_v1.py +++ b/vllm_ascend/worker/model_runner_v1.py @@ -2992,10 +2992,16 @@ class NPUModelRunner(GPUModelRunner): set_draft_graph_params(self.cudagraph_batch_sizes) def capture_model(self) -> None: - parent_module_name = self.__class__.__base__.__module__ + gpu_model_runner_cls = next((cls for cls in self.__class__.__mro__ + if cls.__name__ == "GPUModelRunner"), + None) + if gpu_model_runner_cls is None: + raise TypeError("Could not find GPUModelRunner in the MRO. " + "The class hierarchy may have changed.") + parent_module_name = gpu_model_runner_cls.__module__ with _torch_cuda_wrapper(), _replace_gpu_model_runner_function_wrapper( parent_module_name): - super().capture_model() + GPUModelRunner.capture_model(self) def _prepare_multimodal_fields(self): """