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
1277ff09
Commit
1277ff09
authored
Oct 13, 2025
by
zhuwenwen
Browse files
update moe_sum and moe_align
parent
7e68a7fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
vllm/model_executor/layers/fused_moe/fused_moe.py
vllm/model_executor/layers/fused_moe/fused_moe.py
+4
-3
vllm/model_executor/layers/fused_moe/moe_align_block_size.py
vllm/model_executor/layers/fused_moe/moe_align_block_size.py
+10
-2
No files found.
vllm/model_executor/layers/fused_moe/fused_moe.py
View file @
1277ff09
...
@@ -1918,12 +1918,13 @@ def fused_experts_impl(
...
@@ -1918,12 +1918,13 @@ def fused_experts_impl(
# ops.moe_sum(intermediate_cache3.view(*intermediate_cache3.size()),
# ops.moe_sum(intermediate_cache3.view(*intermediate_cache3.size()),
# out_hidden_states[begin_chunk_idx:end_chunk_idx]) * routed_scaling_factor
# out_hidden_states[begin_chunk_idx:end_chunk_idx]) * routed_scaling_factor
else
:
else
:
if
envs
.
VLLM_USE_OPT_MOE_SUM
:
if
envs
.
VLLM_USE_LIGHTOP
:
moe_reduce_dispatch
(
intermediate_cache3
.
view
(
*
intermediate_cache3
.
size
()),
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
begin_chunk_idx
,
end_chunk_idx
)
from
lightop
import
op
as
op
elif
envs
.
VLLM_USE_LIGHTOP
:
op
.
moe_sum
(
input
=
intermediate_cache3
.
view
(
*
intermediate_cache3
.
size
()),
op
.
moe_sum
(
input
=
intermediate_cache3
.
view
(
*
intermediate_cache3
.
size
()),
output
=
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
bias
=
None
,
output
=
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
bias
=
None
,
expert_mask
=
None
,
num_local_tokens
=
None
,
factor
=
None
)
expert_mask
=
None
,
num_local_tokens
=
None
,
factor
=
None
)
elif
envs
.
VLLM_USE_OPT_MOE_SUM
:
moe_reduce_dispatch
(
intermediate_cache3
.
view
(
*
intermediate_cache3
.
size
()),
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
],
begin_chunk_idx
,
end_chunk_idx
)
else
:
else
:
ops
.
moe_sum
(
intermediate_cache3
.
view
(
*
intermediate_cache3
.
size
()),
ops
.
moe_sum
(
intermediate_cache3
.
view
(
*
intermediate_cache3
.
size
()),
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
])
out_hidden_states
[
begin_chunk_idx
:
end_chunk_idx
])
...
...
vllm/model_executor/layers/fused_moe/moe_align_block_size.py
View file @
1277ff09
...
@@ -240,8 +240,16 @@ def moe_align_block_size(
...
@@ -240,8 +240,16 @@ def moe_align_block_size(
expert_mask
=
expert_mask
,
expert_mask
=
expert_mask
,
num_local_tokens
=
None
)
num_local_tokens
=
None
)
else
:
else
:
ops
.
moe_align_block_size
(
topk_ids
,
num_experts
,
block_size
,
sorted_ids
,
if
envs
.
VLLM_USE_LIGHTOP
:
expert_ids
,
num_tokens_post_pad
)
from
lightop
import
op
as
op
ops
.
moe_align_block_size
(
topk_ids
,
num_experts
,
block_size
,
sorted_ids
,
expert_ids
,
num_tokens_post_pad
)
else
:
op
.
moe_align_block_size
(
topk_ids
,
num_experts
,
block_size
,
sorted_ids
,
expert_ids
,
num_tokens_post_pad
,
expert_map
=
None
,
expert_mask
=
None
,
num_local_tokens
=
None
)
if
expert_map
is
not
None
:
if
expert_map
is
not
None
:
expert_ids
=
expert_map
[
expert_ids
]
expert_ids
=
expert_map
[
expert_ids
]
...
...
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