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 14, 05:30 UTC
[Log] Only Print Profiler Results on Rank 0 (#23370)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Sep 2, 2025 at 14:53 UTC
98aee612aa13155badc2747bd51b378d6e515958
2 files changed
+8
-4
vllm/v1/worker/gpu_worker.py
+4
-2
@@ -400,8 +400,10 @@ class Worker(WorkerBase):
400
self.profiler.start()
401
else:
402
self.profiler.stop()
403
- print(self.profiler.key_averages().table(
404
- sort_by="self_cuda_time_total"))
403
+ # only print profiler results on rank 0
404
+ if self.local_rank == 0:
405
+ print(self.profiler.key_averages().table(
406
+ sort_by="self_cuda_time_total"))
407
408
def execute_dummy_batch(self) -> None:
409
self.model_runner._dummy_run(1)
vllm/worker/worker.py
+4
-2
@@ -128,8 +128,10 @@ class Worker(LocalOrDistributedWorkerBase):
128
if self.profiler is None:
129
raise RuntimeError("Profiler is not enabled.")
130
self.profiler.stop()
131
- print(
132
- self.profiler.key_averages().table(sort_by="self_cuda_time_total"))
131
+ # only print profiler results on rank 0
132
+ if self.local_rank == 0:
133
+ print(self.profiler.key_averages().table(
134
+ sort_by="self_cuda_time_total"))
135
136
def sleep(self, level: int = 1) -> None:
137
free_bytes_before_sleep = torch.cuda.mem_get_info()[0]