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
dfb32264
Unverified
Commit
dfb32264
authored
Apr 26, 2025
by
Wenxuan Tan
Committed by
GitHub
Apr 26, 2025
Browse files
Use device_id in dist init to reduce NCCL communicator warmup & creation overhead (#5728)
parent
63c13a2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
python/sglang/srt/distributed/parallel_state.py
python/sglang/srt/distributed/parallel_state.py
+5
-0
No files found.
python/sglang/srt/distributed/parallel_state.py
View file @
dfb32264
...
@@ -1055,6 +1055,11 @@ def init_distributed_environment(
...
@@ -1055,6 +1055,11 @@ def init_distributed_environment(
world_size
=
world_size
,
world_size
=
world_size
,
rank
=
rank
,
rank
=
rank
,
timeout
=
timeout
,
timeout
=
timeout
,
device_id
=
torch
.
device
(
f
"cuda:
{
torch
.
cuda
.
current_device
()
}
"
if
hasattr
(
torch
,
"cuda"
)
and
torch
.
cuda
.
is_available
()
else
None
),
# Allow NCCL to eagerly init communicator
)
)
# set the local rank
# set the local rank
...
...
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