Skip to content

vllm.model_executor.layers.fused_moe.router.zero_expert_router

Classes:

  • ZeroExpertRouter –

    Router that handles zero expert computation as part of routing.

ZeroExpertRouter

Bases: BaseRouter

Router that handles zero expert computation as part of routing.

Routes over all experts (real + zero) using full e_score_correction_bias. Computes zero expert identity contributions as a side effect during routing. Remaps zero expert IDs to real expert ID 0 (with weight 0) so downstream MoE computation can ignore them.

Attributes:

zero_expert_output property

Retrieve and clear the zero expert output.

_compute_routing(hidden_states, router_logits, indices_type, *, input_ids=None)

Compute routing with full bias, compute zero expert output, mask zero expert IDs.