diff --git a/vllm/worker/worker.py b/vllm/worker/worker.py index 48e0836d431cc..7aaa399b1513d 100644 --- a/vllm/worker/worker.py +++ b/vllm/worker/worker.py @@ -135,12 +135,12 @@ def __init__( self.profiler = None def start_profile(self): - if self.profiler is None: + if self.is_driver_worker and self.profiler is None: raise RuntimeError("Profiler is not enabled.") self.profiler.start() def stop_profile(self): - if self.profiler is None: + if self.is_driver_worker and self.profiler is None: raise RuntimeError("Profiler is not enabled.") self.profiler.stop()