Skip to content

vllm.v1.kv_offload.tiering.backpressure

Classes:

BackpressureDetector

Bases: ABC

Observes store completion signals and determines pressure state.

Methods:

  • default_config –

    Return default constructor kwargs for tier_type, or None.

  • on_store_failed –

    Observe a store job that completed with success=False.

  • should_store –

    Check policy and record skip if rejected.

  • update –

    Update pressure state from a completed store job.

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.

on_store_failed()

Observe a store job that completed with success=False.

Ignored by default; detectors may treat failures as pressure.

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).

BackpressurePolicy

Bases: ABC

Decides what action to take when a detector signals pressure.

Methods:

pop_stores_dropped() abstractmethod

Return and reset (stores_dropped, blocks_dropped).

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().

DropStorePolicy

Bases: DropAccountingPolicy

Silently drop stores to pressured tiers.

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.

  • on_store_failed –

    Enter pressure after failure_threshold consecutive failures.

_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).

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.

on_store_failed()

Enter pressure after failure_threshold consecutive failures.

Idle decay then lets probe stores through: a failed probe re-enters pressure at once, and a successful one resets the failure streak.

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.

Accumulate drop_rate across store decisions. When the accumulator reaches one, drop the store and subtract one from the accumulator, carrying the remaining fraction into the next decision.

Methods:

  • __init__ –

    Initialize the drop accumulator and severity ramp.

  • reset –

    Clear the drop accumulator and dropped store and block counts.

  • should_store –

    Return whether to allow the store.

__init__(ramp_factor=2.0)

Initialize the drop accumulator and severity ramp.

reset()

Clear the drop accumulator and dropped store and block counts.

should_store(detector)

Return whether to allow the store.