Skip to content

Commit d7ce5fe

Browse files
tlrmchlsmthZhengHongming888
authored andcommitted
[Bugfix] Fix MoE Routing Simulation (vllm-project#28002)
Signed-off-by: Tyler Michael Smith <[email protected]>
1 parent ad6d57a commit d7ce5fe

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

vllm/model_executor/layers/fused_moe/layer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,7 @@ def select_experts(
20662066
)
20672067

20682068
# DeepSeekv2 uses grouped_top_k
2069-
if use_grouped_topk:
2069+
elif use_grouped_topk:
20702070
assert topk_group is not None
20712071
assert num_expert_group is not None
20722072
if is_rocm_aiter_moe_enabled():

vllm/model_executor/layers/fused_moe/routing_simulator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
import torch
1616

17+
from vllm.logger import init_logger
18+
19+
logger = init_logger(__name__)
20+
1721

1822
class RoutingStrategy(ABC):
1923
"""Base class for token-to-expert routing strategies."""
@@ -290,6 +294,12 @@ def simulate_routing(
290294
f"Available strategies: "
291295
f"{list(RoutingSimulator._routing_strategies.keys())}"
292296
)
297+
logger.warning_once(
298+
"Simulating MoE routing using a %s strategy. "
299+
"This should only be used for performance testing. "
300+
"Model outputs will not be valid.",
301+
strategy_name,
302+
)
293303

294304
strategy = RoutingSimulator._routing_strategies[strategy_name]
295305
return strategy.route_tokens(

0 commit comments

Comments
 (0)