Unverified Commit 37587573 authored by Tyler Michael Smith's avatar Tyler Michael Smith Committed by GitHub
Browse files

[Bugfix] Fix MoE Routing Simulation (#28002)


Signed-off-by: default avatarTyler Michael Smith <tlrmchlsmth@gmail.com>
parent ccd3e55e
......@@ -2066,7 +2066,7 @@ class FusedMoE(CustomOp):
)
# DeepSeekv2 uses grouped_top_k
if use_grouped_topk:
elif use_grouped_topk:
assert topk_group is not None
assert num_expert_group is not None
if is_rocm_aiter_moe_enabled():
......
......@@ -14,6 +14,10 @@ from typing import Any
import torch
from vllm.logger import init_logger
logger = init_logger(__name__)
class RoutingStrategy(ABC):
"""Base class for token-to-expert routing strategies."""
......@@ -290,6 +294,12 @@ class RoutingSimulator:
f"Available strategies: "
f"{list(RoutingSimulator._routing_strategies.keys())}"
)
logger.warning_once(
"Simulating MoE routing using a %s strategy. "
"This should only be used for performance testing. "
"Model outputs will not be valid.",
strategy_name,
)
strategy = RoutingSimulator._routing_strategies[strategy_name]
return strategy.route_tokens(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment