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
323bc2f5
Unverified
Commit
323bc2f5
authored
Aug 09, 2025
by
Chaitanya Sri Krishna Lolla
Committed by
GitHub
Aug 09, 2025
Browse files
Enable TBO on ROCm (#8329)
parent
137e75da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
python/sglang/srt/two_batch_overlap.py
python/sglang/srt/two_batch_overlap.py
+12
-4
No files found.
python/sglang/srt/two_batch_overlap.py
View file @
323bc2f5
...
@@ -26,11 +26,13 @@ from sglang.srt.model_executor.forward_batch_info import (
...
@@ -26,11 +26,13 @@ from sglang.srt.model_executor.forward_batch_info import (
from
sglang.srt.operations
import
execute_operations
,
execute_overlapped_operations
from
sglang.srt.operations
import
execute_operations
,
execute_overlapped_operations
from
sglang.srt.operations_strategy
import
OperationsStrategy
from
sglang.srt.operations_strategy
import
OperationsStrategy
from
sglang.srt.speculative.eagle_utils
import
EagleDraftInput
,
EagleVerifyInput
from
sglang.srt.speculative.eagle_utils
import
EagleDraftInput
,
EagleVerifyInput
from
sglang.srt.utils
import
BumpAllocator
,
get_bool_env_var
from
sglang.srt.utils
import
BumpAllocator
,
get_bool_env_var
,
is_hip
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
sglang.srt.layers.moe.token_dispatcher
import
DispatchOutput
from
sglang.srt.layers.moe.token_dispatcher
import
DispatchOutput
_is_hip
=
is_hip
()
_tbo_debug
=
get_bool_env_var
(
"SGLANG_TBO_DEBUG"
)
_tbo_debug
=
get_bool_env_var
(
"SGLANG_TBO_DEBUG"
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -822,9 +824,15 @@ def _model_forward_tbo(
...
@@ -822,9 +824,15 @@ def _model_forward_tbo(
)
)
del
inputs
del
inputs
with
deep_gemm_wrapper
.
configure_deep_gemm_num_sms
(
context
=
(
operations_strategy
.
deep_gemm_num_sms
empty_context
()
):
if
_is_hip
else
deep_gemm_wrapper
.
configure_deep_gemm_num_sms
(
operations_strategy
.
deep_gemm_num_sms
)
)
with
context
:
outputs_arr
=
execute_overlapped_operations
(
outputs_arr
=
execute_overlapped_operations
(
inputs_arr
=
inputs_arr
,
inputs_arr
=
inputs_arr
,
operations_arr
=
[
operations_strategy
.
operations
]
*
2
,
operations_arr
=
[
operations_strategy
.
operations
]
*
2
,
...
...
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