Skip to content

feat(umbp): peer-driven eviction with master-ranked victims (opt-in) - #760

Merged
TianDi101 merged 2 commits into
feat/umbp-evict-convergefrom
feat/umbp-pull-eviction
Oct 13, 2026
Merged

TianDi101 merged 2 commits into
feat/umbp-evict-convergefrom
feat/umbp-pull-eviction

Conversation

@TianDi101

Copy link
Copy Markdown
Collaborator

Stacked on #741 (feat/umbp-evict-converge). Only 34e67ed26 is new. Retarget to main once #741 merges.

Summary

Peer-driven ("pull") eviction. With a master, a node evicts at its own watermarks, per backend, instead of waiting for the master's EvictKey rounds. It still takes its victims from the master's cluster-wide recency.

Before, the master decided both when and what. It used one global 0.9/0.7 pair on each node's summed per-medium usage, read from a heartbeat up to 5 s old. So it could not see a full member backend inside a bigger medium, or two logical tiers sharing a medium. Now the node decides when and how much, and the master decides which keys.

Off by default. Turn it on with UMBP_PEER_DRIVEN_EVICTION=1 (or PoolClientConfig::peer_driven_eviction), against a master that supports it. Otherwise nothing changes.

How it works

  1. Detect: a node's local eviction worker sees a backend reach its high watermark (puts wake it).
  2. Ask: it calls the new master RPC GetEvictionCandidates{node, tier, logical_tier, bytes}. The master answers from its index: that node's keys on that medium (and logical tier, if given), least recently accessed first, until their sizes cover bytes. Master-leased keys are skipped.
  3. Evict: the node rounds those value sizes up to the backend's pages and evicts through PeerPool::Evict (demote or drop, re-checking local leases and pins). It counts the bytes as before, including queued demotions.
  4. Fall back: whatever the master's list doesn't cover is taken from the medium's own LRU. That covers stale entries, keys the master hasn't heard of yet, and an unreachable master. Each backend queries the master at most once per 200 ms.
  5. Master stops pushing: it leaves that node out of its own rounds, so each node has a single eviction owner.

Compatibility

Master Node Result
new peer_driven_eviction=1 peer-driven: every medium evicts locally with master-ranked victims, and the master skips this node
new default (0) as before: master pushes EvictKey; SSD evicts locally
old 1 as before: the register response lacks supports_peer_driven_eviction, so the node doesn't switch
new, advertise_peer_driven_eviction=false 1 as before; the RPC returns UNIMPLEMENTED

Where the flag lives: the master keeps it in memory only. The node re-sends peer_driven_eviction on register and on every heartbeat, so a restarted master, or another master sharing the store, picks it up within one heartbeat. No store schema change.

Changes

  • Proto:
    • GetEvictionCandidates RPC.
    • peer_driven_eviction on RegisterClientRequest and HeartbeatRequest.
    • supports_peer_driven_eviction on RegisterClientResponse.
  • Master:
    • SelectPeerEvictionCandidates (in eviction_manager.cpp).
    • EvictionManager::SetPeerDriven / PeerDriven; rounds skip peer-driven nodes.
    • The handler, gated by ClientRegistryConfig::advertise_peer_driven_eviction.
  • Peer:
    • MasterClient::RequestPeerDrivenEviction / PeerDrivenEviction / GetEvictionCandidates.
    • PeerPool::SetEvictionCandidateSource; ReclaimBackend tries ranked candidates first, then the medium's own order.
    • PoolClient:
      • with peer-driven on, runs local eviction for every medium, not just SSD;
      • uses a tiered policy's per-tier watermarks when one is configured;
      • otherwise uses SSD's own pair, or the node pair for DRAM/HBM.
  • Metrics: mori_umbp_client_local_evict_total{event="master_key"} counts the evicted keys that came from the master's ranking. PoolClient::LocalEvictionStats() exposes the counters.
  • Docs: UMBP_PEER_DRIVEN_EVICTION in runtime-env-vars.md.

Test plan

  • MasterPeerDrivenEviction.RanksANodesKeysAndSkipsItInRounds: ranking by recency, the byte budget, the logical-tier filter and the key cap. A peer-driven node gets no EvictKey; turning the flag off restores rounds.
  • PeerPoolLocalEviction.RankedCandidatesGoFirstAndTheMediumCoversTheRest: the source's ranking wins over the LRU, and a stale key is skipped. Value sizes are rounded to pages, so the pass stops exactly at the overage, and the medium covers the rest. One query per pass.
  • test_umbp_peer_driven_eviction (new): a real master and DRAM node over gRPC.
    • When both sides opt in, the node evicts to its low watermark within 3 s, well before the master's first 5 s round, and all 7 victims come from the master's ranking.
    • If either side doesn't opt in, DRAM is left alone over that window.
  • Full tests/cpp/umbp (53 tests) in rocm/mori-dev with RDMA: 52/53. The one failure was umbp_pool_client_ranges (known GPU-readback flake). Run on their own, both known flakes passed 3/3. The new tests passed 30/30 (unit) and 5/5 (end to end) repeats.
  • Not run end to end in InferenceY, and the Redis metadata store is untested here (EnumerateEvictionCandidates already exists there).

Known limits / follow-ups

  • Master cost: each request scans the node's bucket, the same work as one EvictionManager round. With a logical-tier filter the store can't cap the rows. Fine at a few nodes; at scale it needs the per-(node, tier) LRU index.
  • Fallback ignores master leases: the local LRU doesn't see master read leases (the ~2 s RouteGet window), so a routed-but-not-yet-resolved read can miss. Masterless and SSD local eviction already behave this way.
  • Default stays off until an end-to-end run, including a hit-rate comparison against pure local LRU to check that the master's ranking is worth the RPC. Turning it on by default also needs a few tests updated: umbp_cross_node_smoke fills tiny DRAM tiers past 90% and expects nothing to be evicted right away.

🤖 Generated with Claude Code

TianDi101 and others added 2 commits October 13, 2026 08:24
With a master, a node can evict at its own watermarks instead of waiting
for the master's EvictKey rounds, while still taking its victims from the
master's cluster-wide recency.

- Master: new GetEvictionCandidates RPC returns a node's keys on one medium
  (optionally one logical tier), least recently accessed first, until their
  sizes cover the requested bytes; master-leased keys are skipped.
  RegisterClient and every Heartbeat carry peer_driven_eviction, and
  EvictionManager leaves such nodes out of its rounds (in memory only).
  ClientRegistryConfig::advertise_peer_driven_eviction gates both.
- Peer: local eviction asks a candidate source first (at most once per
  200 ms per backend), rounds its value sizes up to the backend's pages,
  evicts through PeerPool::Evict, and covers the rest from the medium's own
  LRU.  In peer-driven mode PoolClient runs local eviction for every medium,
  at a tiered policy's per-tier watermarks when there is one.
- Opt-in: PoolClientConfig::peer_driven_eviction or
  UMBP_PEER_DRIVEN_EVICTION=1, and only once the master confirms support;
  otherwise behaviour is unchanged.  New metric event master_key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replaces the peer_driven_eviction switch with PoolClientConfig::eviction_mode
(env UMBP_EVICTION_MODE), which says how a node with a master evicts:

- local (default): every medium at the node's own watermarks, by its own
  LRU, without asking the master.
- master_ranked: the same, with victims ranked by the master
  (GetEvictionCandidates), falling back to local LRU.
- master: DRAM/HBM wait for the master's EvictKey rounds; SSD still evicts
  locally (the previous behaviour).

A self-evicting node (local or master_ranked) asks the master to leave it
out of its rounds; every mode still serves EvictKey, so the master can evict
on demand.  A node without a master evicts locally as before.  Self-evicting
nodes use a tiered policy's per-tier watermarks when there is one.

Tests that fill tiny tiers on purpose (cross-node smoke, tier benchmark)
now run in master mode, the behaviour they were written against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@TianDi101
TianDi101 merged commit 0af37b4 into feat/umbp-evict-converge Oct 13, 2026
@TianDi101

Copy link
Copy Markdown
Collaborator Author

Folded into #741 by fast-forward (GitHub marked this PR merged because its commits are now on #741's branch). The commit is 34e67ed26 there, followed by 0af37b45f, which turns the opt-in switch into eviction modes: local (default; nodes evict at their own watermarks without asking the master), master_ranked (this PR's GetEvictionCandidates path) and master (the master's rounds). Please review in #741.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant