[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:
2f4e6548ef

Signed-off-by: WithHades <244036962@qq.com>
This commit is contained in:
无脸男
2026-03-12 16:14:45 +08:00
committed by GitHub
parent 77b43492ae
commit 09d26754cd

View File

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