vllm.v1.kv_offload.tiering.backpressure
¶
Classes:
-
BackpressureDetector–Observes store completion signals and determines pressure state.
-
BackpressurePolicy–Decides what action to take when a detector signals pressure.
-
DropAccountingPolicy–Base policy that tracks dropped store/block counters.
-
DropStorePolicy–Silently drop stores to pressured tiers.
-
EMABackpressureDetector–EMA of store latency normalized by transfer size.
-
ThrottledDropPolicy–Drop stores proportionally to pressure severity.
BackpressureDetector
¶
Bases: ABC
Observes store completion signals and determines pressure state.
Methods:
-
default_config–Return default constructor kwargs for
tier_type, or None. -
should_store–Check policy and record skip if rejected.
-
update–Update pressure state from a completed store job.
Source code in vllm/v1/kv_offload/tiering/backpressure.py
default_config(tier_type, *, locality=None)
classmethod
¶
Return default constructor kwargs for tier_type, or None.
Parameters:
-
(tier_type¶str) –The tier type string (e.g.
"fs","obj"). -
(locality¶str | None, default:None) –Optional locality hint from the tier config (
"LOCAL"or"REMOTE"). When"REMOTE", tiers that would normally get local-storage watermarks (e.g."fs") receive network watermarks instead.
Source code in vllm/v1/kv_offload/tiering/backpressure.py
should_store(num_blocks)
¶
Check policy and record skip if rejected.
update(submit_time, num_bytes)
¶
Update pressure state from a completed store job.
Parameters:
-
(submit_time¶float) –time.monotonic()when the job was submitted. -
(num_bytes¶int) –Total bytes written (num_blocks * block_size_bytes).
Source code in vllm/v1/kv_offload/tiering/backpressure.py
BackpressurePolicy
¶
Bases: ABC
Decides what action to take when a detector signals pressure.
Methods:
-
pop_stores_dropped–Return and reset (stores_dropped, blocks_dropped).
Source code in vllm/v1/kv_offload/tiering/backpressure.py
DropAccountingPolicy
¶
Bases: BackpressurePolicy
Base policy that tracks dropped store/block counters.
Subclasses implement should_store; the shared drop accounting
(on_store_skipped/pop_stores_dropped/reset) lives here so
every policy reports these counters identically. Subclasses that add
their own state override reset and call super().reset().
Source code in vllm/v1/kv_offload/tiering/backpressure.py
DropStorePolicy
¶
Bases: DropAccountingPolicy
Silently drop stores to pressured tiers.
Source code in vllm/v1/kv_offload/tiering/backpressure.py
EMABackpressureDetector
¶
Bases: BackpressureDetector
EMA of store latency normalized by transfer size.
The EMA tracks seconds per megabyte (s/MiB) so that the metric is comparable regardless of how many blocks are in a job or how large each block is. Water marks are in the same unit.
Default water marks are derived from fio benchmarks on the WDC H100 cluster. Two presets are provided:
LOCAL (NVMe/SSD): NVMe sustains ~5 GB/s writes. high=0.005 s/MiB (~200 MB/s) catches severe congestion; low=0.001 s/MiB (~1 GB/s) requires meaningful recovery.
NETWORK (CephFS, object store, objtiers, or any tier
with "locality": "REMOTE"): CephFS sustains ~1.5 GB/s.
high=0.020 s/MiB (~50 MB/s); low=0.005 s/MiB (~200 MB/s).
obj tiers get NETWORK defaults automatically. An
fs tier defaults to LOCAL (appropriate for NVMe/SSD); set
"locality": "REMOTE" in the tier config for network-backed
filesystems like CephFS.
Methods:
-
is_healthy–True when the tier has been consistently fast.
Source code in vllm/v1/kv_offload/tiering/backpressure.py
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 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
_apply_idle_decay()
¶
Decay the EMA toward zero based on elapsed idle time.
Uses the formula ema * 0.5^(dt / half_life) so the EMA
halves every decay_half_life_s seconds of silence. This
lets the detector recover from pressure when no stores are
attempted (and therefore no completions arrive to update the
EMA organically).
Source code in vllm/v1/kv_offload/tiering/backpressure.py
is_healthy()
¶
True when the tier has been consistently fast.
After _HEALTHY_THRESHOLD consecutive store completions with
EMA below the low watermark (and no active pressure), the
detector enters a healthy fast-path: should_store() returns
True immediately, skipping the policy check entirely.
Source code in vllm/v1/kv_offload/tiering/backpressure.py
ThrottledDropPolicy
¶
Bases: DropAccountingPolicy
Drop stores proportionally to pressure severity.
Instead of dropping all stores when pressure is detected, the drop rate scales with how far the EMA exceeds the high watermark::
overshoot = (ema - high_water) / high_water
drop_rate = min(1.0, overshoot / ramp_factor)
With the default ramp_factor=2.0, stores ramp from 0% drop at
the high watermark to 100% drop at 3x the high watermark. This
keeps secondary tiers populated under moderate pressure, reducing
cache misses (and therefore recomputation / ITL regression) while
still protecting TTFT under severe congestion.