From 09d26754cd688434aab484fa06fd4996668ccbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E8=84=B8=E7=94=B7?= <244036962@qq.com> Date: Thu, 12 Mar 2026 16:14:45 +0800 Subject: [PATCH] [Bugfix] Fix the issue where no exception is thrown when graph capture fails. (#5644) ### What this PR does / why we need it? Fix the issue where no exception is thrown when graph capture fails. - vLLM version: v0.13.0 - vLLM main: https://github.com/vllm-project/vllm/commit/2f4e6548efec402b913ffddc8726230d9311948d Signed-off-by: WithHades <244036962@qq.com> --- vllm_ascend/worker/model_runner_v1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm_ascend/worker/model_runner_v1.py b/vllm_ascend/worker/model_runner_v1.py index 47ba7c8b..8000dbca 100644 --- a/vllm_ascend/worker/model_runner_v1.py +++ b/vllm_ascend/worker/model_runner_v1.py @@ -3225,6 +3225,8 @@ def _replace_gpu_model_runner_function_wrapper(target_module_name): target_module = sys.modules[target_module_name] setattr(target_module, "graph_capture", graph_capture) # noqa: B010 yield + except Exception as e: + raise RuntimeError(f"NPUModelRunner failed, error is {e}") finally: setattr(target_module, "graph_capture", graph_capture) # noqa: B010