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
f8eaaab8
Unverified
Commit
f8eaaab8
authored
Jun 07, 2025
by
miter
Committed by
GitHub
Jun 06, 2025
Browse files
[fix] logical_to_all_physical_map index 256 is out of bounds in EP parallel. (#6767)
Signed-off-by:
miter
<
miterv@outlook.com
>
parent
697b0f71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
python/sglang/srt/models/deepseek_v2.py
python/sglang/srt/models/deepseek_v2.py
+15
-3
No files found.
python/sglang/srt/models/deepseek_v2.py
View file @
f8eaaab8
...
@@ -1714,21 +1714,33 @@ class DeepseekV2ForCausalLM(nn.Module):
...
@@ -1714,21 +1714,33 @@ class DeepseekV2ForCausalLM(nn.Module):
or
self
.
config
.
n_routed_experts
!=
256
or
self
.
config
.
n_routed_experts
!=
256
):
):
self
.
num_fused_shared_experts
=
0
self
.
num_fused_shared_experts
=
0
global_server_args_dict
[
"disable_shared_experts_fusion"
]
=
1
global_server_args_dict
[
"disable_shared_experts_fusion"
]
=
True
log_info_on_rank0
(
log_info_on_rank0
(
logger
,
logger
,
"Only Deepseek V3/R1 on NV-platform can use shared experts fusion optimization. Shared experts fusion optimization is disabled."
,
"Only Deepseek V3/R1 on NV-platform can use shared experts fusion optimization. Shared experts fusion optimization is disabled."
,
)
)
elif
(
global_server_args_dict
[
"enable_deepep_moe"
]
or
global_server_args_dict
[
"enable_ep_moe"
]):
self
.
num_fused_shared_experts
=
0
global_server_args_dict
[
"disable_shared_experts_fusion"
]
=
True
log_info_on_rank0
(
logger
,
"Deepseek V3/R1 can not use shared experts fusion optimization when in deepep_moe or ep_moe mode. Shared experts fusion optimization is disabled."
,
)
elif
self
.
num_fused_shared_experts
==
0
:
elif
self
.
num_fused_shared_experts
==
0
:
if
(
if
(
_is_cuda
_is_cuda
and
torch
.
cuda
.
get_device_capability
(
"cuda"
)
>=
(
9
,
0
)
and
torch
.
cuda
.
get_device_capability
(
"cuda"
)
>=
(
9
,
0
)
and
self
.
config
.
architectures
[
0
]
==
architecture
and
self
.
config
.
architectures
[
0
]
==
architecture
and
self
.
config
.
n_routed_experts
==
256
and
self
.
config
.
n_routed_experts
==
256
and
(
not
global_server_args_dict
[
"enable_deepep_moe"
])
and
(
not
(
global_server_args_dict
[
"enable_deepep_moe"
]
or
global_server_args_dict
[
"enable_ep_moe"
]
)
)
):
):
self
.
num_fused_shared_experts
=
self
.
config
.
n_shared_experts
self
.
num_fused_shared_experts
=
self
.
config
.
n_shared_experts
global_server_args_dict
[
"disable_shared_experts_fusion"
]
=
0
global_server_args_dict
[
"disable_shared_experts_fusion"
]
=
False
log_info_on_rank0
(
log_info_on_rank0
(
logger
,
logger
,
"Deepseek V3/R1 with fp8 can use shared experts fusion optimization when SM version >=90. Shared experts fusion optimization is enabled."
,
"Deepseek V3/R1 with fp8 can use shared experts fusion optimization when SM version >=90. Shared experts fusion optimization is enabled."
,
...
...
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