Repository navigation
feat(umbp): BatchTouch, so callers can report KV hits served by an upper tier - #779
Merged
Merged
Conversation
isytwu
force-pushed
the
feat/umbp-touch-eviction-class
branch
2 times, most recently
from
October 22, 2026 06:47
7b1a94a to
ccd55b6
Compare
isytwu
force-pushed
the
feat/umbp-touch-eviction-class
branch
from
October 23, 2026 03:50
ccd55b6 to
e3fe7fe
Compare
isytwu
force-pushed
the
feat/umbp-touch-eviction-class
branch
from
October 30, 2026 10:08
e3fe7fe to
37e4c12
Compare
isytwu
marked this pull request as ready for review
October 30, 2026 10:17
isytwu
marked this pull request as draft
October 31, 2026 13:01
isytwu
force-pushed
the
feat/umbp-touch-eviction-class
branch
from
October 31, 2026 15:12
0c4f294 to
7e23557
Compare
This was referenced Oct 31, 2026
isytwu
marked this pull request as ready for review
November 6, 2026 09:54
isytwu
force-pushed
the
feat/umbp-touch-eviction-class
branch
from
November 9, 2026 07:35
0e790f1 to
b0fea45
Compare
… its own cache A cache in front of UMBP -- sglang's device radix tree with the direct linker, or vLLM's GPU prefix cache with the UMBP connector -- serves its hottest prefixes itself and never reads them back or looks them up again, so a local eviction ordered by commit, read and lookup recency ranks exactly those objects coldest and frees them first. BatchTouch lets such a caller report the use: IUMBPClient passes it through PoolClient and PeerPool to every medium holding the keys (a BatchTouch RPC in standalone mode), which renews them with the MediumBackend::Touch a lookup uses. It reads nothing and grants no lease. Touch now returns how many of the keys a medium holds, so BatchTouch can report the copies it touched in DRAM and HBM; the SSD tier renews its copies as a lookup does and counts none. A server without the RPC answers UNIMPLEMENTED, which the client reports as 0 keys touched.
…modes In master and master_ranked eviction the victims follow the master's recency, which hears of a node's uses only through the local reads it reports on its heartbeats, so a BatchTouch that moved only the node's own LRU did not change them. PoolClient::BatchTouch now adds the keys to those reports, and the master bumps them wherever the pool placed them. Under local eviction, the default, nothing is reported and only the caller's node's media see the touch.
A tier whose offload trigger is a watermark demotes keys in the pool's own access order, which commits and reads move but BatchTouch did not, so a touched key was still the first to leave its tier. PeerPool::BatchTouch now moves that order too, for the keys the pool has placed, as a read does. Pool tests cover the offload case, local eviction keeping touched keys with a batch's last key going last, and the copies counted per ordered medium. PageBackend::Touch skips the LRU lock when it holds none of the keys, as BatchResolve does, and PoolClient leaves the report check to NoteLocalReads.
The IUMBPClient comment did not say that a node's paged media move the keys in the order given, which a caller touching a prefix tail first relies on, that the master hears of them unordered, a heartbeat at a time, or that the count is 0 for DRAM in the master mode, which keeps no order there, and counts a duplicate key each time. MediumBackend::Touch now says the same of one medium, and the proto and the Python binding defer to the IUMBPClient comment.
MovesRecencyWithoutALease ran with a 1 ms read lease, which lapses before the order is read, so a touch that took a lease would still have passed; it now runs with the default lease, and only the test that reads keeps 1 ms. A new case checks the order within a batch. The master-ranked touch test repeated the read test's setup line for line; both now use two fixture helpers, and it also runs in the master mode, where the node moves nothing and returns 0 while the master still ranks the keys hottest.
…atchTouch Such a server answers UNIMPLEMENTED, which the client reports as 0 keys touched, so a mixed-version deployment touched nothing without a trace. The first such answer now logs a warning.
isytwu
force-pushed
the
feat/umbp-touch-eviction-class
branch
from
November 9, 2026 09:44
b0fea45 to
62046b7
Compare
TianDi101
self-requested a review
November 9, 2026 13:32
yangyuhuiling
pushed a commit
that referenced
this pull request
Nov 11, 2026
One conflict, in src/umbp/doc/runtime-env-vars.md, three rows of the pool-client table: - UMBP_EVICTION_MODE: main's row (#779 adds the keys passed to BatchTouch to what a node reports on its heartbeats). - UMBP_DRAM_READ_LEASE_MS, UMBP_SSD_READ_LEASE_MS: this branch's rows. main did not change them, and its code still matches them: both are read once per process through a function-local static in pool_platform.cpp, and UMBP_SSD_PREPARE_TIMEOUT_MS and lease_ttl_ms, which the old rows mention, appear nowhere in the code. tools/check_docs_links.py and docs.yml merged on their own: #968's --markdown README check sits next to this branch's image check. Co-Authored-By: Claude <[email protected]>
This was referenced Nov 12, 2026
isytwu
added a commit
to isytwu/sglang
that referenced
this pull request
Nov 19, 2026
The DRAM tier evicts by last write or read, and device hits read nothing from it, so a long session's earliest prefix pages, hottest on the device, look oldest in the store and go first. With touch_interval_s in the UMBP linker config (and a mori with batch_touch), each device-hit node's prefix and each running request's prefix are touched there at most once per node and interval, from a background thread. This is the touch of AMD-yanfeiwang's UMBP linker v4, after the sglang side of mori's batch_touch (ROCm/mori#779). Experimental: on top of keep_states_per_path and the probe memo it changed cache hits by about 1% at Kimi-K3.1 c96; its effect at c48 with output states is being measured. Co-authored-by: AMD-yanfeiwang <[email protected]>
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements items 1–3 of #879: a cache in front of UMBP (sglang's device radix tree, vLLM's GPU prefix cache) reports the hits it serves itself, so UMBP's eviction sees that reuse.
IUMBPClient::BatchTouch(keys)(Pythonbatch_touch) is batched and data-free: the caller's node renews each key in every medium that holds it, as a read would. DRAM and HBM move it to the recent end of their eviction order, in the order given, so the last key ends up the most recent; the SSD tier renews it as a lookup does. It reads nothing, takes no lease or pin and skips keys that are not stored. It goes IUMBPClient -> PoolClient -> PeerPool in the distributed client, and through aBatchTouchRPC in standalone mode.MediumBackend::Touch, so that a lookup (BatchContains) renews the keys it finds until the load. BatchTouch uses the sameTouchfor the keys a caller never looks up, because its own cache serves them.Touchnow returns how many of the keys a medium holds, so BatchTouch reports the copies it touched in DRAM and HBM; the SSD tier's copies are renewed but not counted here.master,master_ranked): the touched keys also join the local reads a node reports on its heartbeats, so the master's ranking sees them wherever the pool placed them.mastermode, where it keeps no order of its own.Commits:
MediumBackend::Touch, which now returns a count (the SSD tier renews but counts none), and the standalone RPC.mastermode.#882, stacked on this PR, counts the SSD tier's copies and hands the tier only the keys it holds, skipping keys mid-eviction, with the SSD tests. Not in this PR: hit counts or source tier for a frequency-aware policy (item 4 of #879). The eviction classes of an earlier revision are dropped: #879 does not need them, and on their own they had no measurable effect.
Compatibility
BatchTouchsees no change.batch_touchand skip it on an older mori (upstream sglang does not call it). A newer client against an older standalone server gets UNIMPLEMENTED, reported as 0, with a warning logged once.IUMBPClientgains one virtual with a default implementation: subclasses outside mori build unchanged, but the vtable changes, so C++ code built against an older mori must be rebuilt.MediumBackend::Touchreturnssize_tinstead ofvoid.Why
Without the touch, a prefix the caller keeps serving from its own cache is never read from UMBP, so its copy there ages from its first store and is evicted first; once the caller's cache drops it too, it is gone from both. Kimi-K3 (KDA + MLA), AgentX trace, one hour of profiling per run, MI355X (smci355):
Testing
7c27c146); commit 1 alone builds and passes the six binaries it touches. New tests:PageBackendand standalone-RPC touch tests (commit 1);PeerDrivenEvictionTest.TouchedKeysReachTheMastersRanking(commit 2, run in themaster_rankedandmastermodes since commit 5);PeerPool.WatermarkOffloadMovesATouchedKeyLast,PeerPoolLocalEviction.TouchedKeysOutliveColderOnesInTheOrderGivenandPeerPool.ATouchReachesEveryCopyInAMediumThatKeepsAnOrder(commit 3);PageBackendTouch.MovesKeysInTheOrderGiven(commit 5). With commit 2's report and commit 3's order update taken out, exactly two cases fail:TouchedKeysReachTheMastersRankingandWatermarkOffloadMovesATouchedKeyLast. Repeated with no failure:PageBackendTouch.*50 times, the pool's touch and watermark tests 20 times,PeerDrivenEvictionTest.*and the standalone touch test 10 times. One case skips on its own condition (DisablingKeyHandlesAlsoStopsTheServerRememberingruns only withUMBP_KEY_HANDLE_SLOTS=0). Not run: the SPDK tests (built without SPDK), and the Redis metadata store and sharded-read tests, which this configuration does not build.mori_umbp_pybindsbuilds; clang-format 20.1.8 is clean.pytest tests/python/umbp108 passed;umbp_prim_ci.pyPASS with and without a master.test/umbp-e2e-v15(maine6ddd2a7plus feat(umbp): a local ranged GET off SSD reads only its extent #781, fix(umbp): an SSD Clear keeps the staging spans local readers still hold #788, fix(umbp): commit to the backend outside the pool lock #804, fix(umbp): count SSD keys without snapshotting them #808, feat(umbp): an SSD backend can keep small objects off it (min_object_size) #824): the no-SSD pair compared it with and without commit 1 and the eviction classes; the SSD-tier pairs ran it with commit 1, the eviction classes and two SSD-tier changes outside this PR in both arms, with BatchTouch turned off in one by a connector overlay; the SSD-touch pair ran that build with an SSD-tierTouch(the first revision of feat(umbp): BatchTouch counts SSD copies and hands the tier only keys it holds #882) in one arm. All of these used local eviction and demoted DRAM copies to the SSD on eviction, not at a watermark, so commits 2 and 3 did not take part; their unit tests cover them. The sglang pair ran commit 1 on324d1058.