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
17676585
Unverified
Commit
17676585
authored
Nov 05, 2025
by
Dayeol Lee
Committed by
GitHub
Nov 05, 2025
Browse files
[Debugging] Add annotation for easier trace analysis (#22496)
parent
efe73e9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
vllm/v1/worker/gpu_worker.py
vllm/v1/worker/gpu_worker.py
+19
-3
No files found.
vllm/v1/worker/gpu_worker.py
View file @
17676585
...
...
@@ -509,6 +509,19 @@ class Worker(WorkerBase):
def
get_supported_tasks
(
self
)
->
tuple
[
SupportedTask
,
...]:
return
self
.
model_runner
.
get_supported_tasks
()
def
annotate_profile
(
self
,
scheduler_output
):
# add trace annotation so that we can easily distinguish
# new/cached request numbers in each iteration
if
not
self
.
profiler
:
return
nullcontext
()
num_new
=
len
(
scheduler_output
.
scheduled_new_reqs
)
num_cached
=
len
(
scheduler_output
.
scheduled_cached_reqs
.
req_ids
)
return
torch
.
profiler
.
record_function
(
f
"execute_new_
{
num_new
}
_cached_
{
num_cached
}
"
)
@
torch
.
inference_mode
()
def
sample_tokens
(
self
,
grammar_output
:
"GrammarOutput | None"
...
...
@@ -536,7 +549,10 @@ class Worker(WorkerBase):
)
)
output
=
self
.
model_runner
.
execute_model
(
scheduler_output
,
intermediate_tensors
)
with
self
.
annotate_profile
(
scheduler_output
):
output
=
self
.
model_runner
.
execute_model
(
scheduler_output
,
intermediate_tensors
)
if
isinstance
(
output
,
(
ModelRunnerOutput
,
NoneType
)):
return
output
...
...
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