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(Tensor | None) –Retrieve and clear the zero expert output.
Source code in vllm/model_executor/layers/fused_moe/router/zero_expert_router.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
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.