Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
3f2702ae
"vscode:/vscode.git/clone" did not exist on "354a1808ff57cb75461c697b282eac98c9082ea9"
Unverified
Commit
3f2702ae
authored
May 12, 2025
by
fzyzcjy
Committed by
GitHub
May 11, 2025
Browse files
Fix start_profile does not support with_stack and record_shapes (#6043)
parent
6ea05950
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
python/sglang/srt/entrypoints/http_server.py
python/sglang/srt/entrypoints/http_server.py
+5
-1
python/sglang/srt/managers/io_struct.py
python/sglang/srt/managers/io_struct.py
+2
-0
python/sglang/srt/managers/tokenizer_manager.py
python/sglang/srt/managers/tokenizer_manager.py
+4
-0
No files found.
python/sglang/srt/entrypoints/http_server.py
View file @
3f2702ae
...
...
@@ -338,7 +338,11 @@ async def start_profile_async(obj: Optional[ProfileReqInput] = None):
obj
=
ProfileReqInput
()
await
_global_state
.
tokenizer_manager
.
start_profile
(
obj
.
output_dir
,
obj
.
num_steps
,
obj
.
activities
output_dir
=
obj
.
output_dir
,
num_steps
=
obj
.
num_steps
,
activities
=
obj
.
activities
,
with_stack
=
obj
.
with_stack
,
record_shapes
=
obj
.
record_shapes
,
)
return
Response
(
content
=
"Start profiling.
\n
"
,
...
...
python/sglang/srt/managers/io_struct.py
View file @
3f2702ae
...
...
@@ -836,6 +836,8 @@ class ProfileReqInput:
# the caller doesn't need to run stop_profile.
num_steps
:
Optional
[
int
]
=
None
activities
:
Optional
[
List
[
Literal
[
"CPU"
,
"GPU"
,
"MEM"
,
"CUDA_PROFILER"
]]]
=
None
with_stack
:
Optional
[
bool
]
=
None
record_shapes
:
Optional
[
bool
]
=
None
class
ProfileReqType
(
Enum
):
...
...
python/sglang/srt/managers/tokenizer_manager.py
View file @
3f2702ae
...
...
@@ -747,12 +747,16 @@ class TokenizerManager:
output_dir
:
Optional
[
str
]
=
None
,
num_steps
:
Optional
[
int
]
=
None
,
activities
:
Optional
[
List
[
str
]]
=
None
,
with_stack
:
Optional
[
bool
]
=
None
,
record_shapes
:
Optional
[
bool
]
=
None
,
):
req
=
ProfileReq
(
type
=
ProfileReqType
.
START_PROFILE
,
output_dir
=
output_dir
,
num_steps
=
num_steps
,
activities
=
activities
,
with_stack
=
with_stack
,
record_shapes
=
record_shapes
,
profile_id
=
str
(
time
.
time
()),
)
result
=
(
await
self
.
start_profile_communicator
(
req
))[
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