Repository navigation
[Fix] hicache: Report a deadline-cut storage prefetch separately and keep its storage beliefs - #44338
Closed
metamergebot wants to merge 1 commit into
Closed
metamergebot wants to merge 1 commit into
metamergebot wants to merge 1 commit into
Conversation
…keep its storage beliefs A storage prefetch that the stop policy ends before the read completes is not a storage shortfall: the span is still stored, and the hit the query agreed on may be a MIN over lookups that were skipped rather than a verdict. A partial hybrid transfer is nevertheless resolved as `storage_transfer`, which heals the storage-existence beliefs beyond the completed span and makes the next insert re-write pages the store already holds. - `PrefetchOperation.deadline_expired` marks an operation whose read was ended by the stop policy. `_handle_prefetch_result` then reports the unfulfilled tokens under the new `deadline` reason and leaves the KV and auxiliary-pool beliefs untouched, and `_invalidate_absent_from_hit_query` skips such a cut query. The flag is set by a cache or controller implementation that cancels an in-flight read under its stop policy; the in-tree `timeout` check in `check_prefetch_progress` keeps its current handling. - `storage_prefetch_unfulfilled_tokens` gains the `deadline` reason label. - `PrefillAdder` finishes storage-prefetch admission for a retracted request (with no reason, so nothing is logged) after discarding its accounting, so a cache implementation that keeps per-request admission state sees the same lifecycle end as every other admitted request. - The buffer-mode hit-drain fixture in `test_storage_prefetch_lifecycle.py` gains the new field, since the drain now reads it. Co-authored-by: xiezhq-hermann <[email protected]>
metamergebot
requested review from
Ying1123,
alphabetc1,
fzyzcjy,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
sufeng-buaa,
xiezhq-hermann and
yizhang2077
as code owners
October 14, 2026 21:30
Collaborator
Author
|
Closing in favor of #44340, which carries these same hunks as part of the complete change (it also sets the flag on the in-tree timeout path, which this PR left out). |
Merged
3 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
A storage prefetch that the stop policy ends before the read completes is not a storage shortfall: the span is still in the store, and the hit count the query agreed on may be a MIN over lookups that were skipped rather than a verdict about what is stored. A partial hybrid transfer is nevertheless resolved as
storage_transfer, which heals the storage-existence beliefs beyond the completed span, so the next insert re-writes pages the store already holds and lookups skip them until it does.Modifications
PrefetchOperation.deadline_expiredmarks an operation whose read was ended by the stop policy._handle_prefetch_resultthen reports the unfulfilled tokens under a newdeadlinereason and leaves the KV and auxiliary-pool beliefs untouched;_invalidate_absent_from_hit_queryskips such a cut query. The flag is set by a cache or controller implementation that cancels an in-flight read under its stop policy; the in-treetimeoutcheck incheck_prefetch_progresskeeps its current handling in this PR.storage_prefetch_unfulfilled_tokensgains thedeadlinereason label, pre-registered like the others.PrefillAdderfinishes storage-prefetch admission for a retracted request (withreason=None, so nothing is logged) after discarding its accounting, so a cache implementation that keeps per-request admission state sees the same lifecycle end as every other admitted request. In the base cache this call is a no-op for that request because its accounting was already discarded.test_prefill_adder.pyasserts the call.test_storage_prefetch_lifecycle.pygainsdeadline_expired=False, since the drain now reads it.Accuracy Tests
Not applicable: no change to model outputs.
Speed Tests and Profiling
Not applicable: the change only affects how a cut prefetch is attributed and whether its storage beliefs are healed.
Unit tests run locally on this head:
test/registered/unit/managers/test_prefill_adder.py: 52 passed, 49 subtests passedtest_storage_prefetch_lifecycle.py+test_hicache_pp_sync_drain.py: 14 passed, 10 subtests passedtest_buffer_mode_sidecar.py,test_unified_hicache_transfer_lifecycle.py,test_pp_prefetch_ticket.py,test_unified_radix_cache_unittest.py: 1370 passed, 1555 skipped (no GPU-dependent cases run); the 5 failures seen locally (TestSwaLoadBackReservation,TestLoadBackAdmission,TestWritePolicySwitch,test_ledgers_count_reclaimable_tokens) fail identically on upstream main in this environment (pinned-host-memory / CUDA stream errors) and are unrelated to this changeChecklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #38640749839
Latest PR Test (Extra): ❌ Run #38640750291
Latest PR Test (AMD ROCm 10): 🚫 Run #38640756438