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
c001deba
"src/rpc/tensorpipe/tp_communicator.cc" did not exist on "987db374fdd134dd6acf62ab05acbf08adc1c37d"
Unverified
Commit
c001deba
authored
Oct 26, 2025
by
fzyzcjy
Committed by
GitHub
Oct 26, 2025
Browse files
Make bmm batch invariant injection optional (#12118)
parent
b4d2da10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
python/sglang/srt/batch_invariant_ops/batch_invariant_ops.py
python/sglang/srt/batch_invariant_ops/batch_invariant_ops.py
+9
-5
No files found.
python/sglang/srt/batch_invariant_ops/batch_invariant_ops.py
View file @
c001deba
...
...
@@ -524,7 +524,9 @@ def is_batch_invariant_mode_enabled():
return
_batch_invariant_MODE
def
enable_batch_invariant_mode
():
def
enable_batch_invariant_mode
(
enable_bmm
:
bool
=
True
,
):
global
_batch_invariant_MODE
,
_batch_invariant_LIB
,
_original_torch_bmm
if
_batch_invariant_MODE
:
return
...
...
@@ -537,6 +539,8 @@ def enable_batch_invariant_mode():
"aten::_log_softmax"
,
_log_softmax_batch_invariant
,
"CUDA"
)
_batch_invariant_LIB
.
impl
(
"aten::mean.dim"
,
mean_batch_invariant
,
"CUDA"
)
if
enable_bmm
:
_batch_invariant_LIB
.
impl
(
"aten::bmm"
,
bmm_batch_invariant
,
"CUDA"
)
# Also monkeypatch torch.bmm directly as a fallback
...
...
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