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
d3be9710
Unverified
Commit
d3be9710
authored
Aug 07, 2025
by
Stefan He
Committed by
GitHub
Aug 07, 2025
Browse files
correct the tp_plan logic (#8850)
parent
3e7ff1ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
python/sglang/srt/models/transformers.py
python/sglang/srt/models/transformers.py
+2
-5
No files found.
python/sglang/srt/models/transformers.py
View file @
d3be9710
...
...
@@ -211,16 +211,13 @@ class TransformersForCausalLM(nn.Module):
Apply the model's tensor parallelization plan.
Currently only supports linear layers.
"""
if
not
self
.
model
.
supports_tp_plan
:
if
tp_size
<=
1
:
return
tp_plan
=
getattr
(
self
.
model
.
config
,
"base_model_tp_plan"
,
None
)
or
{}
if
not
tp_plan
and
self
.
tp_size
>
1
:
raise
ValueError
(
f
"
{
type
(
self
.
model
)
}
does not support tensor parallel yet!"
)
tp_plan
=
getattr
(
self
.
model
.
config
,
"base_model_tp_plan"
,
None
)
or
{}
def
_tensor_parallel
(
module
:
nn
.
Module
,
prefix
:
str
=
""
):
for
child_name
,
child_module
in
module
.
named_children
():
qual_name
=
maybe_prefix
(
prefix
,
child_name
)
...
...
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