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
c0dbbdd1
Unverified
Commit
c0dbbdd1
authored
Oct 02, 2025
by
sogalin
Committed by
GitHub
Oct 01, 2025
Browse files
[ROCm] To reduce the compiling time when using torch compile. (#10559)
parent
25e7dbe8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
python/sglang/srt/model_executor/cuda_graph_runner.py
python/sglang/srt/model_executor/cuda_graph_runner.py
+5
-1
No files found.
python/sglang/srt/model_executor/cuda_graph_runner.py
View file @
c0dbbdd1
...
@@ -53,7 +53,9 @@ from sglang.srt.two_batch_overlap import TboCudaGraphRunnerPlugin
...
@@ -53,7 +53,9 @@ from sglang.srt.two_batch_overlap import TboCudaGraphRunnerPlugin
from
sglang.srt.utils
import
(
from
sglang.srt.utils
import
(
empty_context
,
empty_context
,
get_available_gpu_memory
,
get_available_gpu_memory
,
get_bool_env_var
,
get_device_memory_capacity
,
get_device_memory_capacity
,
is_hip
,
log_info_on_rank0
,
log_info_on_rank0
,
require_attn_tp_gather
,
require_attn_tp_gather
,
require_gathered_buffer
,
require_gathered_buffer
,
...
@@ -61,6 +63,8 @@ from sglang.srt.utils import (
...
@@ -61,6 +63,8 @@ from sglang.srt.utils import (
require_mlp_tp_gather
,
require_mlp_tp_gather
,
)
)
_is_hip
=
is_hip
()
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
...
@@ -137,7 +141,7 @@ def patch_model(
...
@@ -137,7 +141,7 @@ def patch_model(
mode
=
os
.
environ
.
get
(
mode
=
os
.
environ
.
get
(
"SGLANG_TORCH_COMPILE_MODE"
,
"max-autotune-no-cudagraphs"
"SGLANG_TORCH_COMPILE_MODE"
,
"max-autotune-no-cudagraphs"
),
),
dynamic
=
False
,
dynamic
=
_is_hip
and
get_bool_env_var
(
"SGLANG_TORCH_DYNAMIC_SHAPE"
)
,
)
)
else
:
else
:
yield
model
.
forward
yield
model
.
forward
...
...
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