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
a06912ad
Unverified
Commit
a06912ad
authored
Jun 20, 2025
by
Li Hui
Committed by
GitHub
Jun 19, 2025
Browse files
Fix judgment condition for enabling Deepseek V3/R1 shared expert fusion optimization (#7371)
parent
97011abc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
python/sglang/srt/models/deepseek_v2.py
python/sglang/srt/models/deepseek_v2.py
+3
-3
No files found.
python/sglang/srt/models/deepseek_v2.py
View file @
a06912ad
...
@@ -1731,12 +1731,12 @@ class DeepseekV2ForCausalLM(nn.Module):
...
@@ -1731,12 +1731,12 @@ class DeepseekV2ForCausalLM(nn.Module):
disable_reason
=
None
disable_reason
=
None
if
(
if
(
not
_is_cuda
not
_is_cuda
or
torch
.
cuda
.
get_device_capability
(
"cuda"
)
<
(
9
,
0
)
or
torch
.
cuda
.
get_device_capability
(
"cuda"
)
<
(
8
,
0
)
or
self
.
config
.
architectures
[
0
]
!=
architecture
or
self
.
config
.
architectures
[
0
]
!=
architecture
or
self
.
config
.
n_routed_experts
!=
256
or
self
.
config
.
n_routed_experts
!=
256
or
self
.
config
.
n_shared_experts
!=
1
or
self
.
config
.
n_shared_experts
!=
1
):
):
disable_reason
=
"Only Deepseek V3/R1 on NV-platform with capability >=
9
0 can use shared experts fusion optimization."
disable_reason
=
"Only Deepseek V3/R1 on NV-platform with capability >=
8
0 can use shared experts fusion optimization."
elif
(
elif
(
global_server_args_dict
[
"enable_deepep_moe"
]
global_server_args_dict
[
"enable_deepep_moe"
]
or
global_server_args_dict
[
"enable_ep_moe"
]
or
global_server_args_dict
[
"enable_ep_moe"
]
...
@@ -2040,7 +2040,7 @@ class DeepseekV2ForCausalLM(nn.Module):
...
@@ -2040,7 +2040,7 @@ class DeepseekV2ForCausalLM(nn.Module):
if
self
.
num_fused_shared_experts
>
0
:
if
self
.
num_fused_shared_experts
>
0
:
assert
self
.
num_fused_shared_experts
==
1
assert
self
.
num_fused_shared_experts
==
1
log
ger
.
info
(
"Shared experts fusion optimization enabled."
)
log
_info_on_rank0
(
logger
,
"Shared experts fusion optimization enabled."
)
params_dict
=
dict
(
self
.
named_parameters
())
params_dict
=
dict
(
self
.
named_parameters
())
weight_names
=
[]
weight_names
=
[]
...
...
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