Skip to content

vllm.model_executor.layers.fused_moe.router.fused_moe_router

Classes:

  • FusedMoERouter –

    FusedMoERouter is an abstract class that provides a 'select_experts'

FusedMoERouter

Bases: PluggableLayer, 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

Attributes:

kernel_routing_method_type property

Routing method executed by kernels, before any router override.

masks_padding property

Whether select_experts already gives padding rows expert id -1.

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: