vllm.entrypoints.serve.flash_epscale.api_router ¶
_PostResizeError ¶
Bases: RuntimeError
A failure after the resize is live: the new EP topology is serving, only the post-resume memory release failed. Callers must not roll back routing to the old size.
_paused(client, timing) async ¶
Stop-the-world only around the steps that require global quiescence (NCCL split, EPLB remap/refill, NIXL reconnect). Always attempts resume on exit; resume failures propagate so the endpoint cannot report false success.
Source code in vllm/entrypoints/serve/flash_epscale/api_router.py
_scale_down(client, *, target_ep_size, active_ep_size, target_sleeping, current_sleeping, tags, drain_timeout, timing, level=1) async ¶
Shrink the active EP set.
Routing shrinks first so active ranks keep serving while the soon-to-sleep ranks drain; only the collective steps run inside the pause window (see _transition).
Source code in vllm/entrypoints/serve/flash_epscale/api_router.py
_scale_up(client, *, target_ep_size, target_sleeping, current_sleeping, tags, timing, level=1) async ¶
Grow the active EP set.
Routing opens to the new ranks only after the transition completes, so requests never reach a rank that is not ready.
Source code in vllm/entrypoints/serve/flash_epscale/api_router.py
_transition(client, *, current_sleeping, target_sleeping, tags, level, timing) async ¶
Move the EP sleep state from current_sleeping to target_sleeping (either direction).
Phases
- Pre-pause: rank-local CuMem wake of the currently sleeping ranks. No collectives, so active ranks keep serving; the woken ranks stay logically slept (and skip forwards) until the resize below.
- Pause window: everything that must not interleave with forward collectives — NIXL reconnect, L2 dense/EPLB-map refill, EPLB expert remap + DP NCCL split, NIXL disconnect from new sleepers.
- Post-resume: rank-local CuMem sleep + NIXL buffer destroy on the new sleeping ranks. They are masked and skipped by then, so active ranks serve while the memory is released.
Failures in phase 1/2 roll back to current_sleeping best-effort. Phase 3 failures raise _PostResizeError: the resize is live and must not be rolled back; only the memory release failed.
Source code in vllm/entrypoints/serve/flash_epscale/api_router.py
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 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |