Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
342c58bc
Unverified
Commit
342c58bc
authored
Apr 23, 2026
by
Kunshang Ji
Committed by
GitHub
Apr 23, 2026
Browse files
[BugFix]fix Qwen3 MoE call gate twice (#40664)
Signed-off-by:
Kunshang Ji
<
kunshang.ji@intel.com
>
parent
fe9c3d6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
vllm/model_executor/models/qwen3_moe.py
vllm/model_executor/models/qwen3_moe.py
+13
-5
No files found.
vllm/model_executor/models/qwen3_moe.py
View file @
342c58bc
...
@@ -231,7 +231,15 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
...
@@ -231,7 +231,15 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
if
self
.
is_sequence_parallel
:
if
self
.
is_sequence_parallel
:
hidden_states
=
sequence_parallel_chunk
(
hidden_states
)
hidden_states
=
sequence_parallel_chunk
(
hidden_states
)
# router_logits: (num_tokens, n_experts)
if
self
.
experts
.
is_internal_router
:
# In this case, the gate/router runs inside the FusedMoE class
final_hidden_states
=
self
.
experts
(
hidden_states
=
hidden_states
,
router_logits
=
hidden_states
)
else
:
# Actually this will be dead code, since we always pass gate into
# FusedMoE in the current implementation. But we keep this code
# here for clarity and future flexibility.
router_logits
,
_
=
self
.
gate
(
hidden_states
)
router_logits
,
_
=
self
.
gate
(
hidden_states
)
final_hidden_states
=
self
.
experts
(
final_hidden_states
=
self
.
experts
(
hidden_states
=
hidden_states
,
router_logits
=
router_logits
hidden_states
=
hidden_states
,
router_logits
=
router_logits
...
...
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