@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ee35e96ac3
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 06:00 UTC

[BugFix] Don't catch BaseException when dumping execute_model errors (#19626)

Signed-off-by: Nick Hill <nhill@redhat.com>

Nick Hill committed Jun 16, 2025 at 04:01 UTC ee35e96ac39f8ef5d3a06e21bc9078b84d2e1833
2 files changed +12 -13
vllm/logging_utils/dump_input.py
+7 -11
@@ -59,27 +59,23 @@ def dump_engine_exception(config: VllmConfig,
59 scheduler_stats: Optional[SchedulerStats]):
60 # NOTE: ensure we can log extra info without risking raises
61 # unexpected errors during logging
62 - with contextlib.suppress(BaseException):
62 + with contextlib.suppress(Exception):
63 _dump_engine_exception(config, scheduler_output, scheduler_stats)
64
65
66 def _dump_engine_exception(config: VllmConfig,
67 scheduler_output: SchedulerOutput,
68 scheduler_stats: Optional[SchedulerStats]):
69 - logger.error("Dumping input data")
70 -
69 logger.error(
72 - "V1 LLM engine (v%s) with config: %s, ",
70 + "Dumping input data for V1 LLM engine (v%s) with config: %s, ",
71 VLLM_VERSION,
72 config,
73 )
76 -
74 try:
75 dump_obj = prepare_object_to_dump(scheduler_output)
79 - logger.error("Dumping scheduler output for model execution:")
80 - logger.error(dump_obj)
76 + logger.error("Dumping scheduler output for model execution: %s",
77 + dump_obj)
78 if scheduler_stats:
82 - logger.error(scheduler_stats)
83 - except BaseException as exception:
84 - logger.error("Error preparing object to dump")
85 - logger.error(repr(exception))
79 + logger.error("Dumping scheduler stats: %s", scheduler_stats)
80 + except Exception:
81 + logger.exception("Error preparing object to dump")
vllm/v1/engine/core.py
+5 -2
@@ -209,11 +209,14 @@ class EngineCore:
209 def execute_model(self, scheduler_output: SchedulerOutput):
210 try:
211 return self.model_executor.execute_model(scheduler_output)
212 - except BaseException as err:
212 + except Exception as err:
213 + # We do not want to catch BaseException here since we're only
214 + # interested in dumping info when the exception is due to an
215 + # error from execute_model itself.
216 +
217 # NOTE: This method is exception-free
218 dump_engine_exception(self.vllm_config, scheduler_output,
219 self.scheduler.make_stats())
216 - # Re-raise exception
220 raise err
221
222 def step(self) -> tuple[dict[int, EngineCoreOutputs], bool]: