Repository navigation
[Refactor] memory-pool: Build KV host pools from buffer info - #40917
Conversation
1b7904d to
6cb964c
Compare
14c9956 to
14df244
Compare
6cb964c to
648a810
Compare
14df244 to
fdb6480
Compare
# Conflicts: # test/registered/kernels/ops/kvcache/test_hicache_strided_device_rows.py # test/registered/unit/mem_cache/test_mem_pool_host.py
|
/rerun-failed-ci |
|
/rerun-test test/registered/hicache/test_dsa_host_release.py test/registered/hicache/test_k_only_host_release.py test/registered/kernels/ops/attention/qsa/test_qsa_hicache.py test/registered/kernels/ops/kvcache/test_hicache.py test/registered/kernels/ops/kvcache/test_hicache_page_first_write_back.py test/registered/kernels/ops/kvcache/test_hicache_strided_device_rows.py test/registered/kernels/ops/kvcache/test_mxfp8_host_allocation.py test/registered/unit/mem_cache/pool_host/test_kvcacheio_asymmetric.py test/registered/unit/mem_cache/test_asymmetric_mha_pool_host_unit.py test/registered/unit/mem_cache/test_dsa_pool_host_unit.py test/registered/unit/mem_cache/test_hicache_auto_size.py test/registered/unit/mem_cache/test_hicache_dcp_host_pool.py test/registered/unit/mem_cache/test_hicache_seaweedfs_storage.py test/registered/unit/mem_cache/test_hicache_staged_write_back_dispatch.py test/registered/unit/mem_cache/test_hybrid_pool_assembler.py test/registered/unit/mem_cache/test_mem_pool_host.py test/registered/unit/mem_cache/test_minimax_sparse_pool_host_unit.py test/registered/unit/mem_cache/test_minimax_sparse_pool_pd_unit.py test/registered/unit/mem_cache/test_mla_host_dedup_primitives.py test/registered/unit/mem_cache/test_mxfp8_mha_pool_host_unit.py |
|
🚀 🚀 🚀 🚀 |
Re-apply MLA host dedup onto the buffer-info MLA host pool (sgl-project#40917): the pool keeps the owned target layers by filtering its MLABufferInfo, so the existing per-layer slot maps, owned-layer load skip and all-layer backup carry the rotation. Append the flag's positional slot after main's fields (sgl-project#44991), and keep the dedup storage-attach guard next to the DCP L3 checks (sgl-project#41187). Co-Authored-By: Claude Opus 5.5 <[email protected]>
v0.5.23 (sgl-project#40917) removed MLATokenToKVPoolHost's is_dummy argument and selects the allocator-only pool by its input type. The per-node MLA host copy, written against v0.5.22, still passed is_dummy=True through build_kv_host_pool's kwargs, so every follower rank of --enable-mla-hicache-per-node failed with a TypeError at startup. Followers now pass an MLAHostAllocation sized like this rank's real MLA host pool (row width x target + draft layers, plus the indexer rows under page_first_kv_split), so their share matches the leader's per-rank share. Co-Authored-By: Claude <[email protected]>
Motivation
The MHA and MLA HiCache host pools took the device pool object and read its private fields (
k_buffer,v_buffer,kv_buffer,data_ptrs, layer bounds, draft pools) to rebuild the buffer list, layer mapping and packed draft offsets that the device side already knows. Every new pool layout had to be taught to each host consumer separately.Each KV device pool now exports a typed
MHABufferInfoorMLABufferInfothroughget_device_pool_infos(), and the host pools are built from that info plus explicit capacity and layer bounds. GPU host pools no longer hold a device pool reference. Packed MTP drafts are passed as their own buffer infos and checked against the target row geometry at construction. Physical layout, host capacity, transfer kernels and the L3 page format are unchanged.This replaces the earlier declaration based approach of this PR.
Three behavior changes come with it:
--enable-dsa-cache-layer-splitand EAGLE fails withindex 78 is out of bounds for dimension 0 with size 40.Modifications
device_pool_info.py:MHABufferInfo,MLABufferInfo,MLAHostAllocation, and providers on the MHA, MLA, SWA, unified and hybrid pools.pool_host/mha.py,mha_mxfp8.py,mla.py: construct from buffer info, drop device pool reads, validate packed drafts.hybrid_pool_assembler.py,hisparse_coordinator.py: pass buffer info and capacity instead of the pool.test_hicache_staged_write_back_dispatch.py: set the host fields the new constructors own on the__new__built MLA host.Accuracy
Each row compares this PR with main on the same launch config. Cache hits are forced to come back from host (small device pool plus eviction) and checked through
cached_tokens_details. KL is decode logprob vs prefill replay on the same server.The assembled host pools and the host to device transfer sequence are identical to main on every row above.
test_unified_radix_cache_kl_hybrid_bitexact.py(Inkling, deterministic), HiCache and L3 buffer_only classes:GSM8K, Inkling tp4, sgl-eval, all 1319 questions:
CI States
Latest PR Test (Base): ✅ Run #39113648668
Latest PR Test (Extra): ✅ Run #39113648559
Latest PR Test (AMD ROCm 10): ❌ Run #39113648632