Repository navigation
feat(mesh): UMBP share groups 2/2 — cache_aware counts prefixes a DP rank copies in from its share group - #3620
wanzhenchn wants to merge 26 commits into
Conversation
With ATOM's umbp_pool connector (#3482), the DP ranks of one node whose pools are in one group of one UMBP server copy the prefix they miss from each other's pools before they compute it, and count the copies as device hits. DP-aware routing picks the rank itself, so the router has to see that sharing in what the ranks publish. - /kv_event_sources may carry each rank's `kv_pool` (backend, address, group, share_ratio, fetch). Ranks on one node with the same address and group form a share group, only while share_ratio is 1 and fetch is on, so a block any rank of the group holds is one every rank can have. - The prefix index walks a group's lanes once: a block counts while any of them holds it (`find_shared`, `match_groups`). - cache_aware's KV branch scores the copies at --kv-share-weight (0.9 by default; 0 ignores share groups), counts them in the estimate, and labels such decisions kv_shared.
…and document the store lookups The end-to-end KV events test ran at --kv-storage-weight 1 against a store that held every key, so the store alone cleared cache_threshold and the device assertions passed with a broken index or encoding. Its store is now tainted and holds nothing. The deadline's docs now say that past it a lookup has no answer at all, and docs/metrics.md and the README describe the lookups' metrics, results and /kv_storage/sources fields.
…wan/mesh-umbp-share-groups # Conflicts: # atom/mesh/docs/metrics.md
…re at weight 0 A store with a pool per NIC holds, evicts and taints each rank's chunks in the pool that rank writes to, so rank 0's keys alone counted chunks ATOM will not load. Such a store is now asked for every rank's keys, rank by rank, and holds the shortest run, as ATOM's lookup takes it; a store of one pool is still asked for rank 0's alone. At --kv-storage-weight 0, cache_aware no longer takes the store path at all. The tests now fail when the store wiring breaks: the e2e test untaints the store at the end and expects it to place a request the tree has on the other worker, and runs again at weight 0, where no chunk key is asked; a monitor test covers a decode worker and one the index does not know; the reader test asks for the reader with the least on its device.
…nks share one - `shared_tokens` returns None where no worker's engine can copy anything in, and `cache_aware` then borrows the device hits instead of a copy. - `KvEventMonitor` counts the subscriptions of ranks in a share group and returns at once below two, without walking the subscriptions. At the default `--kv-share-weight` and with no rank reporting a `kv_pool`, a request does no new work. - The monitor test follows a rank again and detaches one, and checks the count and that no rank copies anything in without another of its group.
Its 64 requests share the test's one thread with the pool's answers, and on a loaded machine they took longer than the 500 ms the other lookup tests allow.
…wan/mesh-umbp-share-groups # Conflicts: # atom/mesh/src/policies/cache_aware.rs
…it does not ask The kv_events e2e runs at weights 1, 0.5 and 0 against a store that answers after 50 ms, past the 3 ms default deadline, and checks that a prompt whose device hit is all the engine would take of it asks no store. The monitor test adds a reader whose own device hit leaves too little to load, a CLI test maps --kv-storage-weight and --kv-storage-deadline-ms, and the Python key test checks rank 1's keys as the Rust one does. The weight reaches the monitor at any value, and the docs say how pools and ranks lower the chunk cap and that a retried request asks again.
Hand the weight over unconditionally: at 0 the monitor already ignores share groups. A test now fails when the weight is hardcoded on its way from the flag to the monitor, or left out of the RouterConfig. Say that shared_tokens is None while share groups are ignored.
…wan/mesh-umbp-share-groups # Conflicts: # atom/mesh/src/policies/cache_aware.rs
ATOM's umbp_pool can put only share_ratio of a rank's blocks in the UMBP pool and keep the rest private; the other ranks of its group can copy in only the shared part. Such a rank now joins its share group with a second lane in its partition: the blocks it reports under the GPU_SHARED medium, named by hash and placed by its own GPU chain, gone once the rank lets go of them or is reset. A rank's copy-in walk takes its own lane and the lanes its group shares: the GPU lane of a rank that shares all its blocks, the GPU_SHARED lane of one that keeps some private. /kv_events/sources shows the second lane's blocks as shared_blocks.
…kup-main # Conflicts: # atom/mesh/src/app_context.rs # atom/mesh/src/cliargs.rs # atom/mesh/src/config/validation.rs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…hare groups `/kv_event_sources` carries `kv_pool` for the ranks of a server that runs the `umbp_pool` connector (#3482): the backend, the UMBP server's address, the share group, the share ratio and whether the rank fetches. The group is the one each rank's pool attaches to: the setting, or what the pools derive from the model and KV format when it is empty, so engines started alike on one server report one group. Found inside `multi` as the Store's report is. The router makes its share groups of these: the ranks of one node that report one address and group, with `fetch` on, are scored by what their group holds, at `--kv-share-weight`. No server reported a pool until now, so no rank was in a share group and the routing was that of the base. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A rank on the `umbp_pool` connector copies the prefix it misses from the pools of its share group and then hits it like a local one, but the copy published nothing: `BlockStored` went out only for blocks a rank computed, loaded from a store or received over P/D. A consumer of the events (the Atomesh router) took the rank to hold none of them, and dropped the blocks the rank computed after them, whose parent it had never seen stored there. With `UMBP_L1_KEEP_COPIES` the source gives its copy up first, so the prefix then left the router's index altogether. A pool now says which of the hashes a finished background copy was asked for it indexed (`poll_fetches`), and the block manager reports each run of them as one `BlockStored`, as `hash_blocks` reports a forward's (`poll_shared_fetches`, which the scheduler polls in place of the pool). An in-line fetch reports its leading run alike. This is the second of the three reports #3620 asks of ATOM. On MI355X, DeepSeek-V4.1-Flash P/D with two prefill workers of two DP ranks and one decode worker on one node, the four prefill ranks one share group (mori 46510220 and 94c7f60f): over a 300 s window the router's estimate of the cached tokens was 38,233,600 against the 38,042,240 the engines reported (+0.50%, 497 requests, c64, no eviction), and 142,802,176 against 143,012,608 (-0.15%, 1,942 requests, c256, the four pools full and 304 GiB evicted over the run). Those runs were of a test branch whose router policy and event token encoding differ from this branch's (`agentic` on #3406 with the share tier, tokens packed by numpy); the pool, the block manager's report and the router's share groups are the ones here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
#3344 went into main as one squashed commit (bb5d270), which this branch carried as its own history. The merge keeps main's tree and this branch's changes over #3344's head (f900792). One hand resolution, in Scheduler.schedule: main wraps _schedule() in a try/finally that clears the decode block reservation, this branch polls the shared pool's fetches through BlockManager.poll_shared_fetches() first. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
jgong5
left a comment
There was a problem hiding this comment.
REQUEST CHANGES @ 1a83eb4: 1 blocking.
This adds the second tier the way #3344 added the first. It puts shared_tokens and share_weight on PrefixMatchProvider, keeps the weight in a OnceLock on the monitor, adds a router-wide flag, and adds one more hand-written term to cache_aware's score. A third tier, such as LMCache's CPU tier, would repeat all four, and agentic (#3406) needs each tier wired in separately.
Fix before this lands: the provider returns facts per worker, e.g. TieredHit { device, shared, stored }. The weights live in the policy's config as one TierWeights, next to cache_threshold. One effective_cached(hit, &weights) scores for both cache_aware and agentic, so a new tier is one field. The monitor then holds neither weights nor the store handle, and the policy calls StorageSources::cached_tokens itself.
Watch next: the other #3344 follow-ups and their diagrams are in this comment on #3344.
…e weight flags #3620's review asks for the weights of the tiers below a worker's device cache to live in the policy's config, as one TierWeights next to cache_threshold, instead of in the KV event monitor. This adds the config: CacheAwareConfig.tier_weights is a TierWeights { shared, stored }. --kv-share-weight and --kv-storage-weight stay as they are, flags and RouterConfig fields, so the command line and saved configs are unchanged. RouterConfig::kv_tier_weights() makes the TierWeights of the two, PolicyRegistry::for_router keeps it, and every cache-aware policy the registry creates takes it in its config: the default policy, one a worker's `policy` label asks for by name, and the prefill and decode policies, which the PD routers now create through the registry (create_policy). PolicyFactory's two functions keep their signatures and use the default weights; the registry calls two new ones that take a router's. Nothing reads the field yet: the monitor still holds its copies of the weights and cache_aware still scores with those. The next commit moves the score over and takes them out of the monitor. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
valarLip
left a comment
There was a problem hiding this comment.
Please split before review
This PR is +1146/-96 and has not been reviewed yet; our rule for never-reviewed PRs is ≤ ~1000 changed lines per PR so a review converges in one or two rounds. It splits naturally by concern:
- Event source and monitoring:
kv_events/monitor.rs,kv_events/source.rsand the index/partition support (kv_index/partition.rs,kv_index/index.rs) that record which prefixes a DP rank copies in from its UMBP share group, with their tests. - Use in routing: the
policies/cache_aware.rsscoring change that consumes those counts, with its tests and docs. - The Python-side test additions (
tests/test_umbp_pool_connector.py,tests/test_umbp_l1_pool.py) go with whichever part they exercise.
Each part should build and pass on its own (part 2 stacked on part 1 is fine; say so in its description).
…red by effective_cached The rest of #3620's review, which is also the first two design follow-ups of #3344: a tier no longer adds methods to the index trait, a weight on the monitor and a hand-written term to cache_aware's score. - PrefixMatchProvider answers with facts: tiered_hits(tokens, workers, weights) returns a TieredHit { device, shared, stored } per worker, each tier the tokens past those of the tiers before it. match_workers, shared_tokens, cached_tokens and the two weight getters leave the trait. - effective_cached(hit, &weights) is the one score: device + weights.shared x shared + weights.stored x stored, the terms cache_aware added up by hand, in the same order. cache_aware holds it, over the prompt's tokens, against cache_threshold; hit.cached() is its estimate and hit.shared > 0 its kv_shared branch. - The weights are the tier_weights of the policy's config, from the previous commit. KvEventMonitor holds neither them nor the store handle: share_pools, read_stores and their two OnceLocks are gone, and it no longer imports StorageSources or WorkerType. - The policy asks the stores itself. policies::KvTiers, which the registry hands every cache-aware policy in place of the index, has the index answer and then calls StorageSources::cached_tokens for the workers that are not decode workers, at what each one's device cache will hold once the copies are in, as the monitor did. A tier whose weight is 0 is not asked, as before: the index is passed the weights with each call and leaves share groups out of its walk at 0, and no request goes to a store at 0. TieredHit, effective_cached and KvTiers are pub(crate), for the agentic policy (#3406) to score with; TierWeights is pub, as CacheAwareConfig is. Another tier is a field of TieredHit and of TierWeights, its term in effective_cached, and the place its tokens come from. Tests: effective_cached against the hand-written score, bit for bit, over hits and weights; cache_aware's decisions at the same selections, match rates and estimates as before, the store tier now through StorageSources and a mock admin service; a weight of 0 sends no request to a store and leaves the share groups out; the store's readers, moved from the monitor's tests; the store asked at what the device will hold after the copies. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
e2e run of cache_aware kv_shared branch, and a --kv-share-weight 0 control on the same traces?
ci Run non-GPU unit tests (Pre Checkin) failed — not sure yet (low): The provided log .valar/ci/job_140337885899.log is empty (0 bytes), so the failure cannot be attributed. The same job passes on main and 8 other recent runs; this PR adds Python tests (tests/test_umbp_l1_pool.py, tests/test_umbp_pool_connector.py, tests/entrypoints/test_api_server_helpers.py) that this job runs.
(log file .valar/ci/job_140337885899.log is empty — 0 bytes)
next: Fetch the job log from the run page and rerun the job; if it reproduces, run the three touched test files locally to tell a PR bug from an infra failure. https://github.com/ROCm/ATOM/actions/runs/45948268735/job/140337885899
|
|
Splitting. The PR was +1146 −96 when this was written; the tier refactor asked for in the review of 1a83eb4 (e2e0b8d) took it to +1973 −352, so it goes three ways, each under 1000 changed lines and each building and passing on its own:
The two new PR numbers follow here once they are up. |
|
On the other two points of the review of 09:54 UTC:
|
…red by effective_cached at the policy's TierWeights The review of #3620, which is also the first two design follow-ups of #3344: a tier below a worker's device cache is no longer methods on the index trait, a weight on the KV event monitor and a hand-written term in cache_aware's score. This commit gives the one tier `main` has, the Mooncake Store, that shape, and changes no routing decision. The share tier comes in the next commit, as a field, a weight and a term. - PrefixMatchProvider answers with facts: tiered_hits(tokens, workers) returns a TieredHit { device, stored } per worker, each tier the tokens past those of the tiers before it. match_workers, cached_tokens and store_weight leave the trait, and async_trait with them. - effective_cached(hit, &weights) is the one score: device + weights.stored x stored, the terms cache_aware added up by hand, in the same order. cache_aware holds it, over the prompt's tokens, against cache_threshold, and hit.cached() is its estimate. - The weights are the policy's: CacheAwareConfig.tier_weights is a TierWeights { stored }, next to cache_threshold. --kv-storage-weight stays as it is, flag and RouterConfig field, so the command line and saved configs are unchanged. RouterConfig::kv_tier_weights() makes the TierWeights of it, PolicyRegistry::for_router keeps it, and every cache-aware policy the registry creates takes it in its config: the default policy, one a worker's `policy` label asks for by name, and the prefill and decode policies, which the PD routers now create through the registry (create_policy). PolicyFactory's two functions keep their signatures and use the default weights; the registry calls two new ones that take a router's. - The policy asks the stores itself. policies::KvTiers, which the registry hands every cache-aware policy in place of the index, has the index answer and then calls StorageSources::cached_tokens for the workers that are not decode workers, as the monitor did. KvEventMonitor holds neither the weight nor the store handle: read_stores and its OnceLock are gone, and it no longer imports StorageSources or WorkerType. A tier whose weight is 0 is not asked, as before: no request goes to a store at --kv-storage-weight 0. TieredHit, effective_cached and KvTiers are pub(crate), for the agentic policy (#3406) to score with; TierWeights is pub, as CacheAwareConfig is. Another tier is a field of TieredHit and of TierWeights, its term in effective_cached, and the place its tokens come from. Tests: effective_cached against the hand-written score, bit for bit, over hits and weights; cache_aware's store decisions at the selections, match rates and estimates they had, the store now a StorageSources against a mock admin service, which gets one request a selection and none at weight 0; the store's readers, moved from the monitor's tests; the weight on the command line and in a router's config in the config of the default, by-name and PD policies. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
cache_aware now counts what a rank's engine will copy in from the device
pools of its UMBP share group, which the router follows since the PR this
one is stacked on. The share tier is a field of TieredHit, a weight in
TierWeights and a term in effective_cached, between the device cache and
the store:
match_rate = (D + s x (G - D) + w x (C - G)) / N
D is the rank's own device hit, G the leading tokens it holds or its group
shares (TieredHit.shared is G - D), C what its engine will report cached,
store loads included, s --kv-share-weight and w --kv-storage-weight.
- --kv-share-weight, from 0 to 1 and 0.9 by default: the flag, the
RouterConfig field (0.9 where a saved config has none), its validation,
and TierWeights.shared, which RouterConfig::kv_tier_weights() fills. Below
1, the rank that holds the prefix stays first on a tie in depth; 0 ignores
share groups.
- The index is passed the policy's weights: tiered_hits(tokens, workers,
&weights) fills `shared` from KvEventMonitor::shared_tokens, which is no
longer dead code, and leaves the share groups out of its walk at a weight
of 0. shared_tokens returns at once while fewer than two followed ranks
are in a share group.
- The stores are asked at TieredHit::on_device(), what the device cache will
hold once the copies are in, and cached() counts all three tiers, as the
engine reports the copies cached.
- A decision that counts copies is labelled kv_shared.
- Docs: the kv_affinity and kv_shared rows and what a kv_shared estimate
counts in docs/metrics.md, and the cache_aware row of the README.
At --kv-share-weight 0, and for ranks that report no kv_pool, routing is
that of the commit before.
Tests: effective_cached against the hand-written three-term score, bit for
bit; of 100 tokens, a worker with 20 on its device and 80 in its group is
selected as kv_shared at 0.9 (match rate 0.74, estimate 0.8) and not at
0.5; both tiers in one match rate, the store asked past the copies; the
monitor's hits at weights 0 and 0.9, and those of a rank that shares part
of its pool; the index asked at the policy's weights; --kv-share-weight
below 0, above 1 or NaN fails validation; the two weights on the command
line in the config of the default, by-name and PD policies, and their
defaults alike however a config is made.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The PR is split as its review asks. #3946 (zwan/mesh-umbp-share-lanes) carries ATOM's two reports and the router's events, index and monitoring. This branch keeps the use in routing as two commits on it: - ea180db: the Mooncake Store tier in the shape the review of 1a83eb4 asks for (TieredHit, TierWeights, effective_cached); no routing decision changes. - aaeb8e6: the share tier as a field, a weight and a term, with --kv-share-weight. The tree is aaeb8e6's. It is this branch's head e2e0b8d merged with main at af573f0, plus cb0d75c (_record_fetched reports through record_remote_store, a review fix now in #3946). atom/mesh is unchanged from e2e0b8d. A merge commit rather than a rewritten history: the branch is not force-pushed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The split is up, in two parts as the review of 08:31 UTC lays out, not the three I announced above:
Two things about this PR as it stands:
The fix for |
#3946, which this PR is stacked on, gained two commits from its review: a test of the shared tier's removal and clear, decoded and through the partition's writer, and the documented and debug-asserted rule that the lanes `match_groups` is given for a group are in one partition. Neither touches a line this PR changes, so the merge has no conflict and this PR's diff against #3946 stays the use in routing alone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
UMBP share groups 2/2 (M8a):
cache_awarecounts what a DP rank will copy in from the device pools of its UMBP share group, whether its pool shares all of its blocks or only part of them (share_ratiobelow 1) · design §3.4.3 ATOM × UMBP, §3.3.7 scoring, M8a (LLM-Booster #711) · stacked on #3946, which carries what this PR had below the routing: ATOM's two reports, and the router'skv_pooldiscovery,GPU_SHAREDtier, shared lanes, index walk and share groups. Split as the review asks, in two rather than the three announced first; review #3946 first, the diff here is against its branch. The branch is not force-pushed: one merge commit (5253a94, whose tree is the second commit's) brings the two commits in, and a second (8c0896e) follows #3946 to 26cc0bd, so the Commits tab also lists the branch's earlier history while Files changed is these two commits · 23 files, +1037 −302, about 640 of the added lines tests · two commits: ea180db gives the one tiermainhas, the Mooncake Store, the shape the review of 1a83eb4 asks for, oneTieredHitper worker, oneTierWeightsin the policy's config and oneeffective_cached, and changes no routing decision (+717 −277); aaeb8e6 adds the share tier as a field, a weight and a term, with--kv-share-weight(+404 −109); each commit is under 1,000 changed lines and reads on its own, and the first can become a PR of its own between #3946 and this one if that is preferred · only with--kv-events, and only for ranks that report akv_pool, as ATOM'sumbp_poolranks do with #3946; at--kv-share-weight 0routing is that of the baseflowchart LR subgraph NODE["One node: ATOM DP ranks on umbp_pool (#3482)"] direction TB E0["rank 0 engine, HBM pool:<br/>private part + UMBP part (share_ratio)"] E1["rank 1 engine, HBM pool:<br/>private part + UMBP part (share_ratio)"] U[("UMBP server, L1 pool service (mori #1045):<br/>the UMBP parts of a group,<br/>on a node-local unix socket")] E0 <-->|"publish, reclaim"| U E1 -.->|"Fetch: copy in the prefix it misses"| U end subgraph MESH["ATOMesh router: share groups and index in #3946, the score in this PR"] direction TB SG["share groups:<br/>node · address · group, fetch on"] IX["KV event index, per rank:<br/>GPU lane, every block it holds;<br/>shared lane, its GPU_SHARED blocks<br/>(the GPU lane at share_ratio 1)"] WK["one walk per partition:<br/>D = its GPU lane<br/>G = its GPU lane ∪ its group's shared lanes"] ST["Mooncake Store lookup (#3344):<br/>C = what it will report cached"] SC{"D + s × (G − D) + w × (C − G)<br/>above cache_threshold?"} SG --> WK IX --> WK WK --> SC ST --> SC end E0 -->|"GET /kv_event_sources: kv_pool"| SG E0 -->|"ZMQ KV events: GPU and GPU_SHARED"| IX SC -->|"kv_shared where G > D,<br/>else kv_affinity or the tree"| E1Purpose
umbp_poolconnector (#3482), the DP ranks of a node keep their KV in pools of one UMBP server. A rank copies the prefix it misses from another rank of its group before it computes it, and then hits it like a local prefix (block_manager.py#L1443-L1473). With DP-aware routing ATOMesh picks the rank itself, so feat(kv): umbp_pool KV connector that provides the KV pool (private / UMBP-managed split, async fetch) #3482's sharing-aware DP routing does not apply, and scoring each rank by its own blocks undercounts.kv_poolin/kv_event_sources: the same node (the host of the rank's event endpoint), UMBPaddressandgroup, withfetchon.share_ratio1, every block it holds: its GPU lane. Below 1, only the blocks in the UMBP part of its pool (pool.py#L779-L797), which it reports under theGPU_SHAREDmedium. The router keeps those on a second lane of the rank, named by hash and placed by the rank's own GPU chain.Gwalks the rank's GPU lane with the shared lanes of its group, so a block in another rank's private part does not count.match_rate = (D + s × (G − D) + w × (C − G)) / N.Dis the rank's own device hit,Gthe leading tokens it holds or its group shares (G ≥ D), andCwhat its engine will report cached, store loads included.sis--kv-share-weight, 0.9 by default. The RFC's single-request numbers: TTFT 0.30 s cold, 0.10–0.11 s with the prefix copied in from another rank, 0.07–0.09 s on a local hit (#3259). Below 1, the rank that holds the prefix stays first on a tie in depth.G, since the engine reports the copies cached. A decision that counts copies is labelledkv_shared.TieredHit { device, shared, stored }per worker (D,G − D,C − G), oneTierWeights { shared, stored }(s,w) in the policy's config next tocache_threshold, andeffective_cached(hit, &weights)as the numerator.kv_poolper rank in/kv_event_sources:backend: "umbp_pool",address,group,share_ratio,fetch. Nothing changed until ATOM reported it, which it does in feat(mesh): UMBP share groups 1/2 — ATOM's reports and the router's events, index and monitoring #3946.BlockStoredfor the blocks a fetch brings in. Without it, a copy is not seen once its source evicts the block, and withUMBP_L1_KEEP_COPIESthe source's copy is the one evicted first. ATOM reports it in feat(mesh): UMBP share groups 1/2 — ATOM's reports and the router's events, index and monitoring #3946.share_ratio1, the UMBP part undermedium: "GPU_SHARED", byblock_hashes(token_idsmay be empty):BlockStoredwhen a block enters it (published there, demoted, written through, fetched in),BlockRemovedwhen it leaves (reclaimed, replaced), andAllBlocksClearedwith that medium when it is cleared. TheGPUevents stay as they are. Without these, a rank with a private part shares nothing.Fetchwithprobe_onlyanswers how many leading keys a group could supply (umbp_l1.proto#L151-L166). But the standalone server serves only on its node-local unix socket (ipc.cpp#L120-L142, standalone_server.cpp#L638-L645), and a probe per candidate per request would put a round trip into routing.Dependencies
As of 11-27, against what this PR was opened for on 11-20 at 05:31 UTC:
mainat af573f0 comes in through itmainmerged in twice on 11-23 and again on 11-25, at 13d1d28, which has #3482; its own changes those of 159d249main. Until the split this branch mergedmainin at 1a83eb4 and 6ed88f6; since the split its content is two commits on #3946, brought in by one merge commit (5253a94) whose tree is theirsumbp_poolmainthree times on 11-23, its own changes the same but a test's stub; asked to land in slices or record a waiver, it stays one PR (31 files, 3979 lines), the split waived on 11-24; changes requested again on 11-24 at 57fcc7c, seven asks, all addressed in ee86b3a (rebased onmain, one new commit), none in what the router reads; the asks above are follow-ups once it landsUMBP_L1_KEEP_COPIES=Nhas eviction take a copy that N newer copies in the group back up before any of the newest N, andUMBP_L1_GATHER_COPYissues a fetch's copies through the HBM copy engine; later on 11-23 rebased onmain, its changes the same, then both made the default,UMBP_L1_KEEP_COPIES=1, either off at=0; on 11-24 its L1 pool test registered for CI, then squash-mergedsassumes. UnderUMBP_L1_KEEP_COPIES, now on by default, a fetch's source gives up its copy first, unless its engine uses it again, so the copy left is the one the fetch brought in, which the router sees only through ask 2feat/umbp-l1-tiers(#995)Changes
Links are at aaeb8e6. Discovery, the shared tier, the shared lane, the index walk, the monitor's share groups and ATOM's two reports are in #3946.
TieredHit,TierWeightsandeffective_cached, the one score;pub(crate), foragentic(#3406) to score with.tiered_hits(tokens, workers, &weights)returns each worker'sTieredHit; it is the trait's one fact method.KvEventMonitorholds no weight and no store handle.sharedis what feat(mesh): UMBP share groups 1/2 — ATOM's reports and the router's events, index and monitoring #3946'sshared_tokensfinds past the device hit: 0 at--kv-share-weight 0, where the walk is left out, and wherever no candidate can copy anything in.shared_tokensloses theallow(dead_code)it has in feat(mesh): UMBP share groups 1/2 — ATOM's reports and the router's events, index and monitoring #3946.policies::KvTiersholds the index andStorageSources. It has the index answer, then asks the stores itself, atG, only at a--kv-storage-weightabove 0 and not for decode workers (C = Gotherwise).cache_awarescores each hit witheffective_cachedat its config'stier_weights, and labels a decision that counts copieskv_shared.--kv-share-weight, from 0 to 1; 0 ignores share groups. With--kv-storage-weightit is the router'sTierWeights, whichPolicyRegistry::for_routerputs in the config of every cache-aware policy it creates: the default one, one named by a worker'spolicylabel, and the P/D prefill and decode policies.kv_affinityandkv_sharedrows in metrics.md and what akv_sharedestimate counts (#L220-L224, #L237-L238), and thecache_awarerow of the README.Tests
At aaeb8e6, on #3946 at 2c9ad4d,
ciprofile, on a shared host at a load of 300 to 500.atom/meshat this head is byte for byte that of e2e0b8d. The head, 8c0896e, merges #3946 at 26cc0bd (two commits of tests and an assertion, none in a file this PR changes): therecargo test --lib --features atom-enginegives 1468 passed, 9 ignored,kv_events_test6 passed,cargo fmt --checkandcargo check --features ext-proc --testsare clean, and with debug assertions on thekv_index,kv_events, policy andkv_tierstests give 164 passed, 6 ignored.cargo test --lib --features atom-enginecargo test --test routing_testsAddrInUse), a different test each time:test_2p2d_chat_completions;test_pd_mode_round_robinandtest_regular_models_endpoint;test_2p2d_streaming. The tests pick a free port and bind it later, and the suite's own parallel tests can collide: #3946 shows the same in 3 runs of 9 at 26cc0bd with no other test run on the host, and none in three runs with--test-threads=1. CI runs this suite inrun_atomesh_test_harness, where it can fail the same way (it did once on #3946 at 26cc0bd). The first commit passed its one runapi_testskv_events_test--kv-storage-weight1.0, 0.5 and 0.0; also at the first commitcargo fmt --checkcargo check --features ext-proc --testscargo clippy --all-targets --features atom-enginemainhas, none added or removed, at both commits; in the changed files onlyitems_after_test_moduleincliargs.rstest_atomesh_harness, token parity,vendor_ext_proc.py --check, anything on a GPUatom/meshNew tests:
Monitor (monitor.rs#L1170-L1304): the two tests of feat(mesh): UMBP share groups 1/2 — ATOM's reports and the router's events, index and monitoring #3946, which assert what a rank will hold, now assert each rank's
TieredHit. With whole pools, at a share weight of 0 no rank's hit has shared tokens, and at 0.9 the rank holding nothing of its group's 8 tokens will copy in 8. With a part shared, the peer of a rank atshare_ratio0.5 will copy in 4 tokens, not 8.Policy (cache_aware.rs#L1086-L1178): of 100 tokens, w1's device cache holds 60, and w2's 20 with 80 in its group.
--kv-share-weightkv_sharedkv_affinityA best match of at most
cache_thresholdis left to the tree. Since e2e0b8d the store cases run throughStorageSourcesagainst a mock admin service, which gets one request a selection and none at weight 0; with both tiers, at 0.9 and 0.5, a worker with 20 tokens on its device, 40 to copy in and 30 to load scores 0.71 askv_sharedwith an estimate of 0.9.Weight (validation.rs#L473-L489): below 0, above 1 or NaN fails validation.
Flags to policies (cliargs.rs#L868-L922, policies/registry.rs#L678-L716): the two weights on the command line are the
TierWeightsof the default, by-name and P/D policies of theAppContextbuilt from it.Score (kv_tiers.rs#L65-L138):
effective_cachedequals the earlier hand-written formula bit for bit, over 9 hits and 7 weight pairs, the defaults among them.Tiers (policies/tiers.rs#L155-L298): a weight of 0 sends no request to the store and counts no lookup, and the index is passed the weights; decode workers and workers the index does not know are not asked.
On MI355X, 11-25, DeepSeek-V4.1-Flash P/D on one node: two prefill workers of two DP ranks each (
-tp 2 --enable-dp-attention --enable-expert-parallel) and one decode worker of four, the prefill onmultiof the Mooncake P/D connector andumbp_poolatshare_ratio1, one UMBP server for both workers, InferenceX agentic traces, 300 s after the recipe's warmup. The four prefill ranks reported onekv_pooland the router put them in one share group.cached_tokensBoth runs ended without a failed request, a failed P/D transfer or a rank leaving the
exactstate; at c256 the four ranks dropped 42 events asunknown_parentwhile they stored 2.2 million blocks. What these runs do not cover:agentic(#3406) with this PR's share groups (shared_tokensat the time) and--kv-share-weightwired into its cost, notcache_aware: the share groups, the index and ATOM's two reports are feat(mesh): UMBP share groups 1/2 — ATOM's reports and the router's events, index and monitoring #3946's, thekv_sharedbranch ofcache_awarehas run in unit tests only.BlockStored's tokens with numpy; here they are listed, ashash_blockslists them.share_ratiobelow 1, which waits for the third report, and--kv-share-weight 0andUMBP_L1_KEEP_COPIES=0as controls.mori_umbp_l1client; the runs added both, built from mori's source, to the 11-22 image.Against the recipe's router (load only) on the same node and build, c64: TTFT mean 2.52 s to 2.26 s and P50 2.36 s to 1.82 s, P90 4.23 s to 4.16 s, P99 6.67 s to 9.48 s, about 490 requests an arm, one run each; the ranks copied 326 prefixes in the window under the recipe's router and 121 under this one.
Not in this PR
l1/<group>/<hex>onfeat/umbp-l1-tiers(mori #995), not yet a PR. With a UMBP master the router can look them up by those names, as it looks up a Mooncake Store; that comes after the branch lands.GPU_SHARED, for pools belowshare_ratio1), feat(kv): umbp_pool KV connector that provides the KV pool (private / UMBP-managed split, async fetch) #3482's follow-up.🤖 Generated with Claude Code