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 7, 11:30 UTC
[MyPy][BugFix] Check profiler is assigned before calling start() on it (#35505)
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Martin Hickey committed
Mar 2, 2026 at 13:23 UTC
87c98b023693dc95a49352e9e66da82ff2967571
1 file changed
+8
-7
vllm/v1/worker/gpu_worker.py
+8
-7
@@ -788,13 +788,14 @@ class Worker(WorkerBase):
788
self.profiler = CudaProfilerWrapper(self.profiler_config)
789
logger.debug("Starting CUDA profiler")
790
else:
791
- logger.warning("Unrecognized profiler: %s", profiler_type)
792
- return
793
- self.profiler.start()
794
- else:
795
- # Profiler already initialized. Restart profiling but keep
796
- # the original trace name from the first initialization.
797
- self.profiler.start()
791
+ # Config validation should prevent this code being reached
792
+ raise ValueError(
793
+ f"Invalid profiler value of {self.profiler_config.profiler}"
794
+ )
795
+
796
+ # If profiler already initialized, restart profiling but keep
797
+ # the original trace name from the first initialization.
798
+ self.profiler.start()
799
else:
800
if self.profiler is None:
801
logger.warning("Profiler was not started, nothing to stop.")