Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
98aee612
Unverified
Commit
98aee612
authored
Sep 02, 2025
by
Wentao Ye
Committed by
GitHub
Sep 02, 2025
Browse files
[Log] Only Print Profiler Results on Rank 0 (#23370)
Signed-off-by:
yewentao256
<
zhyanwentao@126.com
>
parent
598bd74c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
vllm/v1/worker/gpu_worker.py
vllm/v1/worker/gpu_worker.py
+4
-2
vllm/worker/worker.py
vllm/worker/worker.py
+4
-2
No files found.
vllm/v1/worker/gpu_worker.py
View file @
98aee612
...
@@ -400,6 +400,8 @@ class Worker(WorkerBase):
...
@@ -400,6 +400,8 @@ class Worker(WorkerBase):
self
.
profiler
.
start
()
self
.
profiler
.
start
()
else
:
else
:
self
.
profiler
.
stop
()
self
.
profiler
.
stop
()
# only print profiler results on rank 0
if
self
.
local_rank
==
0
:
print
(
self
.
profiler
.
key_averages
().
table
(
print
(
self
.
profiler
.
key_averages
().
table
(
sort_by
=
"self_cuda_time_total"
))
sort_by
=
"self_cuda_time_total"
))
...
...
vllm/worker/worker.py
View file @
98aee612
...
@@ -128,8 +128,10 @@ class Worker(LocalOrDistributedWorkerBase):
...
@@ -128,8 +128,10 @@ class Worker(LocalOrDistributedWorkerBase):
if
self
.
profiler
is
None
:
if
self
.
profiler
is
None
:
raise
RuntimeError
(
"Profiler is not enabled."
)
raise
RuntimeError
(
"Profiler is not enabled."
)
self
.
profiler
.
stop
()
self
.
profiler
.
stop
()
print
(
# only print profiler results on rank 0
self
.
profiler
.
key_averages
().
table
(
sort_by
=
"self_cuda_time_total"
))
if
self
.
local_rank
==
0
:
print
(
self
.
profiler
.
key_averages
().
table
(
sort_by
=
"self_cuda_time_total"
))
def
sleep
(
self
,
level
:
int
=
1
)
->
None
:
def
sleep
(
self
,
level
:
int
=
1
)
->
None
:
free_bytes_before_sleep
=
torch
.
cuda
.
mem_get_info
()[
0
]
free_bytes_before_sleep
=
torch
.
cuda
.
mem_get_info
()[
0
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment