mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-25 20:15:19 +08:00
[Log] Only Print Profiler Results on Rank 0 (#23370)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
parent
598bd74cf8
commit
98aee612aa
@ -400,8 +400,10 @@ class Worker(WorkerBase):
|
||||
self.profiler.start()
|
||||
else:
|
||||
self.profiler.stop()
|
||||
print(self.profiler.key_averages().table(
|
||||
sort_by="self_cuda_time_total"))
|
||||
# only print profiler results on rank 0
|
||||
if self.local_rank == 0:
|
||||
print(self.profiler.key_averages().table(
|
||||
sort_by="self_cuda_time_total"))
|
||||
|
||||
def execute_dummy_batch(self) -> None:
|
||||
self.model_runner._dummy_run(1)
|
||||
|
||||
@ -128,8 +128,10 @@ class Worker(LocalOrDistributedWorkerBase):
|
||||
if self.profiler is None:
|
||||
raise RuntimeError("Profiler is not enabled.")
|
||||
self.profiler.stop()
|
||||
print(
|
||||
self.profiler.key_averages().table(sort_by="self_cuda_time_total"))
|
||||
# only print profiler results on rank 0
|
||||
if self.local_rank == 0:
|
||||
print(self.profiler.key_averages().table(
|
||||
sort_by="self_cuda_time_total"))
|
||||
|
||||
def sleep(self, level: int = 1) -> None:
|
||||
free_bytes_before_sleep = torch.cuda.mem_get_info()[0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user