Store: add reusable ranged-read snapshots - #4095
Open
zxpdemonio wants to merge 1 commit into
Open
Conversation
zxpdemonio
requested review from
XucSh,
YiXR,
stmatengss and
ykwd
as code owners
September 14, 2026 03:43
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.
Description
Add a reusable ranged-read metadata snapshot for Store reads and use it in the Engram and reconstructed-shard read paths.
The motivation is to reduce TTFT-sized Engram read latency by avoiding repeated Store query/lease metadata work when the same key set is read repeatedly. The actual TransferEngine/RDMA data path is unchanged in this PR.
API and behavior
PyClient::RangedReadSnapshot, a caller-owned snapshot of freshbatch_query()results.prepare_get_into_ranges_snapshot(keys)andrefresh_get_into_ranges_snapshot(...).get_into_ranges_from_snapshot(...)for reads that must use the supplied snapshot and must not re-query or renew leases.EngramStorelayer and invalidate it onpopulate()and successfulremove_from_store().Snapshot refresh time is derived from the earliest lease timeout and is set to halfway through the remaining lease window. If any key fails query or has an expired lease, the snapshot is not treated as reusable. Ordinary
get_into_rangeskeeps the existing query-refresh behavior.Module
mooncake-store)mooncake-integration)Type of Change
How Has This Been Tested?
store,mooncake_master, andmooncake_client.Build:
EngramStore regression:
Result: 18 tests passed.
Checklist
AI Assistance Disclosure
Performance
Cross-Machine RDMA Engram Lookup
Two A10 + ERDMA machines; one host runs the writer/master and the other runs the reader. The benchmark uses the real Python
store.EngramStore.lookup_intoAPI.Config:
Command shape:
Results, median:
PR4083-Style Synthetic Engram Read/Write
Full DeepSeek-V4.1 serving was not repeated on this A10 setup. Instead, this benchmark repeats PR4083's synthetic Engram table layout and byte pattern with real cross-machine RDMA Store reads.
Shape:
layer_ids=(1, 14)max_ngram_size=4,n_heads=8,head_dim=256,row_bytes=264,vocab_size=17Read results, median:
Read results, p95:
After the final cleanup, a short repeat run of the same PR4083-style benchmark still matched the PR numbers: