Repository navigation
[HiCache] Back up MXFP8 KV scales in the host pool - #39089
Merged
alphabetc1 merged 5 commits intoSep 17, 2026
Merged
Conversation
alphabetc1
requested review from
Ying1123,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
September 11, 2026 12:11
Collaborator
Author
|
/rerun-test -c |
Contributor
|
Collaborator
Author
|
/rerun-test -c |
Contributor
|
Results for 🚀 |
Collaborator
Author
|
/rerun-test -c |
Contributor
|
Results for 🚀 |
ispobock
approved these changes
Sep 16, 2026
4 of 5 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.
Motivation
--kv-cache-dtype mxfp8stores the KV payload as fp8 e4m3 plus a UE8M0 scale per 32 elements, kept in a separatek_scale_buffer/v_scale_buffer. The HiCache host pool does not know about them:MHATokenToKVPoolHostonly holds pointers tok_buffer/v_buffer, neitherbackup_from_device_all_layernorload_to_device_per_layertouches the scale buffers, andget_size_per_tokencounts one byte per element. A page restored from the host therefore comes back with whatever scales happen to be in the device rows it landed on, and the host pool is sized as if the scales did not exist.Modifications
MHATokenToKVPoolMXFP8Host, selected byget_mha_host_pool_clswhen the device pool isMHATokenToKVPoolMXFP8.page_size=1and an element size of "one page of scales": the staged all-layer write-back for D2H, and the single-layer gather for H2D. No new kernel.get_size_per_tokenincludes the scale bytes, so--hicache-ratiosizing accounts for them.page_firstlayout,io_backend=kernel, interleaved scale layout) and raisesNotImplementedErrorotherwise; the L3 flat-page interface also raises, since a flat page of an MXFP8 pool is not defined yet.Accuracy Tests
Round trip with the real JIT kernels is bit exact: payload and scales read back from the host pool equal the device rows they were copied from. End to end on 4 ranks with both host pools, payload and scales were byte-compared against the device copy after backup and again after load. A shape-matched probe (same request served once as a device hit and once as a host restore) returns identical text and a maximum per-token logprob difference of 0.
Speed Tests and Profiling
No throughput claim: this adds the missing scale traffic, so the host pool moves slightly more bytes per token. It is independent of the write-back batching change in #39050.
Checklist
New unit test file
test/registered/unit/mem_cache/test_mxfp8_mha_pool_host_unit.py: factory dispatch,size_per_tokenaccounting, a CPU round trip of payload and scales, and rejection of the storage interface.Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ✅ Run #35082102036
Latest PR Test (Extra): ❌ Run #35082101775
Latest PR Test (AMD ROCm 10): ❌ Run #35082101983