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
86fe943b
Unverified
Commit
86fe943b
authored
Jun 09, 2025
by
fzyzcjy
Committed by
GitHub
Jun 08, 2025
Browse files
Fix expert distribution dumping causes OOM (#6967)
parent
9ecb1856
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
python/sglang/srt/managers/expert_distribution.py
python/sglang/srt/managers/expert_distribution.py
+7
-0
No files found.
python/sglang/srt/managers/expert_distribution.py
View file @
86fe943b
...
...
@@ -703,6 +703,7 @@ class _StatAccumulator(_UtilizationRateAccumulatorMixin):
dtype
=
torch
.
int32
,
device
=
self
.
_server_args
.
device
,
)
self
.
_first_dump
=
True
def
append
(
self
,
...
...
@@ -727,9 +728,15 @@ class _StatAccumulator(_UtilizationRateAccumulatorMixin):
num_logical_experts
=
self
.
_expert_location_metadata
.
num_logical_experts
,
physical_to_logical_map
=
self
.
_expert_location_metadata
.
physical_to_logical_map
,
)
if
self
.
_first_dump
:
self
.
_first_dump
=
False
torch
.
cuda
.
empty_cache
()
torch
.
distributed
.
all_reduce
(
logical_count_of_buffered_step
,
op
=
torch
.
distributed
.
ReduceOp
.
SUM
)
output
=
dict
(
rank
=
self
.
_rank
,
logical_count
=
logical_count_of_buffered_step
,
...
...
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