vllm.model_executor.layers.fused_moe.router.fused_moe_router ¶
Classes:
-
FusedMoERouter–FusedMoERouter is an abstract class that provides a 'select_experts'
FusedMoERouter ¶
Bases: ABC
FusedMoERouter is an abstract class that provides a 'select_experts' method that is used for routing hidden states based on router logits.
Methods:
-
select_experts–Route the input hidden states to the top-k experts based on the
Source code in vllm/model_executor/layers/fused_moe/router/fused_moe_router.py
select_experts(hidden_states, router_logits, topk_indices_dtype=None, *, input_ids=None) ¶
Route the input hidden states to the top-k experts based on the router logits.
Returns:
-
Tensor–(topk_weights, topk_ids)
-
tuple[Tensor, Tensor]– -
tuple[Tensor, Tensor]–The weights and expert ids computation result.
-
tuple[Tensor, Tensor]–Compatibility: When EPLB is not enabled, the returned ids are
-
tuple[Tensor, Tensor]–equivalent to global logical ids, so should be compatible with
-
tuple[Tensor, Tensor]–plain MoE implementations without redundant experts.