vllm.v1.worker.sentinel.eplb_redistribute
¶
EPLB fault-tolerance helpers: expert redistribution and weight reload after peer death.
All redistribution operations are deterministic with stable iteration order, so all surviving ranks running the same function with the same args produce bit-identical results — no cross-rank communication during recovery.
Functions:
-
compute_dead_ep_ranks–Expand dead DP ranks to the corresponding dead EP ranks.
-
mark_dead_expert_slots_inplace–Mark dead EP ranks' physical expert slots as -1 in place.
-
redistribute_expert_placement–Steals slots from over-replicated experts (donors with >1 replica)
-
reload_experts_from_disk–Reload complete MoE layers affected by expert reassignment from disk.
-
reset_eplb_async_state–Clear stale EPLB async state after fault or scale-down.
compute_dead_ep_ranks(dead_dp_ranks, tp_size, pcp_size=1)
¶
Expand dead DP ranks to the corresponding dead EP ranks.
Each DP rank owns a contiguous block of tp_size * pcp_size EP ranks
Source code in vllm/v1/worker/sentinel/eplb_redistribute.py
mark_dead_expert_slots_inplace(physical_to_logical_map, dead_ep_ranks, num_local_experts)
¶
Mark dead EP ranks' physical expert slots as -1 in place.
physical_to_logical_map is [num_moe_layers, num_physical]; each EP rank owns num_local_experts consecutive physical slots starting at rank * num_local_experts. Shape stays constant (no topology change).
Source code in vllm/v1/worker/sentinel/eplb_redistribute.py
redistribute_expert_placement(physical_to_logical_map, num_logical, num_local_experts)
¶
Steals slots from over-replicated experts (donors with >1 replica) to recover missing logical experts, interleaving across EP ranks for balanced weight loading. Modifies physical_to_logical_map in place.
Returns:
Raises:
-
RuntimeError–If not enough slots to cover missing experts.
Source code in vllm/v1/worker/sentinel/eplb_redistribute.py
reload_experts_from_disk(model, vllm_config, reload_set, physical_to_logical_map)
¶
Reload complete MoE layers affected by expert reassignment from disk.
Parameters:
-
(model¶Module) –The model whose FusedMoE layers receive the reloaded weights.
-
(vllm_config¶VllmConfig) –Engine config, used for the model loader and model config.
-
(reload_set¶set[tuple[int, int]]) –{(moe_layer_idx, logical_expert_id), ...} from redistribute_expert_placement.
-
(physical_to_logical_map¶Tensor) –Recovered placement, including all replicas.
Source code in vllm/v1/worker/sentinel/eplb_redistribute.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
reset_eplb_async_state(model_runner)
¶
Clear stale EPLB async state after fault or scale-down.