Repository navigation
[Refactor] hicache: Move shared host backing and build unified host pools from layout views - #48003
Merged
Merged
Conversation
ch-wan
force-pushed
the
cheng/hot-fix/unified-kv-cp-sharded-padded-refusal
branch
from
November 4, 2026 07:42
8d8acbf to
43fc645
Compare
ch-wan
force-pushed
the
cheng/refactor/unified-kv-host-pools
branch
2 times, most recently
from
November 4, 2026 09:31
937d7e6 to
08378a2
Compare
This was referenced Nov 4, 2026
Merged
ch-wan
marked this pull request as ready for review
November 4, 2026 09:34
ch-wan
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
November 4, 2026 09:34
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
This was referenced Nov 4, 2026
Merged
Merged
This was referenced Nov 4, 2026
Closed
Closed
[Refactor] mem_cache: Choose reclaim in one place, keep one static storage, joint LRU reclaim
#48025
Closed
ch-wan
force-pushed
the
cheng/hot-fix/unified-kv-cp-sharded-padded-refusal
branch
from
November 4, 2026 11:33
43fc645 to
5458116
Compare
ch-wan
force-pushed
the
cheng/refactor/unified-kv-host-pools
branch
from
November 4, 2026 11:33
08378a2 to
4ce96ca
Compare
ch-wan
force-pushed
the
cheng/hot-fix/unified-kv-cp-sharded-padded-refusal
branch
from
November 4, 2026 20:29
5458116 to
0c76b4a
Compare
Base automatically changed from
cheng/hot-fix/unified-kv-cp-sharded-padded-refusal
to
main
November 4, 2026 20:29
…ost pools from layout views
ch-wan
force-pushed
the
cheng/refactor/unified-kv-host-pools
branch
from
November 4, 2026 20:29
4ce96ca to
c9178e9
Compare
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.
This PR is part of a stack (oldest at bottom):
Motivation
The unified pool's host (HiCache) side built its host pools from pool-specific knowledge inside
mem_cache/pool_host/unified.py. Later PRs in this stack let the unified pool carry any number of window sub-pools and fused draft parts, which the host side must mirror without a case per pool shape. This PR moves the shared host backing next to the device memory code and builds host pools from each device layout view's own description.Modifications
mem_cache/kv/memory/host_backing.py(new):_SharedPageEnvelopeHostBackingmoved frommem_cache/pool_host/unified.pyunchanged in behavior (a mechanical move in the first commit).mem_cache/kv/layout/{base,mha,mla,state}.py: each layout view describes its host rows (host_layout()returning e.g.MHAHostLayout, MLA and state equivalents) and builds its host pool fromHostPoolOptions; MHA host transfers require unsharded token ids.mem_cache/hybrid_cache/hybrid_pool_assembler.py,mem_cache/pool_host/unified.py,mem_cache/kv/storage.py: unified host pools are assembled from the layout views' descriptions instead of per-pool-type code.test/registered/unit/mem_cache/kv/test_host_layout.py(host rows and storage pages match the existing host layouts; a state layout accepts a KV split without splitting state), updates totest_hybrid_pool_assembler.pyandtest_unified_kv_storage.py.No intended behavior change: host pool sizes, layouts and transfers are the same as before.
Accuracy Tests
Serving validation was run at the top of this 26-PR stack (the cumulative change), not at this PR's head. Software: torch 2.14.1+cu130, flashinfer 0.7.2, sglang-kernel 0.4.10. GSM8K is few-shot, 500 or 1319 questions as noted;
mainis the same commit the stack is based on, same flags.--enable-unified-memory(rebased stack)--enable-unified-memory --max-total-tokens 120000(rebased stack)trtllm_mha(1319 q)On B200 and B300, 40 greedy GSM8K generations were compared with
main: 35–40 of 40 are identical, and the rest first differ after at least 27 characters (near ties). The H200 runs above other than the two marked "rebased stack" were run at the stack top before it was rebased onto the current base; the code they cover is unchanged by the rebase except for conflict resolutions.The HiCache row exercises the host pools built here.
Speed Tests and Profiling
Not expected to change speed (host pool construction only). Measured at the stack top, same flags as
main(bench_serving, random 4096-in / 512-out unless noted):--max-total-tokens 120000Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #41907128175
Latest PR Test (Extra): 🚫 Run #41907128162
Latest PR Test (AMD ROCm 10): ❌ Run #41907128243
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: