Repository navigation
[HiCache] Count hit allocations and in-flight backups in the buffer pipeline idle check - #37883
Merged
Merged
Conversation
…ipeline idle check `BufferModePipeline.is_idle()` decides when the cache is quiescent for the idle-time memory invariant check. It missed two kinds of in-flight work: - `pending_hit_allocs`: storage hits parked waiting for host staging, which still hold prefetch occupancy and will restart I/O once space frees. - `inflight_backup_node_ids`: nodes whose backup intent has been admitted but whose D2H staging has not launched yet. Either can make the idle checker run against a pipeline that is about to move memory and report a spurious leak. Include both in the idle predicate. Co-authored-by: Zhiqiang Xie <zqx@meta.com>
xiezhq-hermann
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy and
yizhang2077
as code owners
September 3, 2026 23:04
Collaborator
Author
|
/tag-and-rerun-ci |
StevenChenSE
pushed a commit
to StevenChenSE/sglang
that referenced
this pull request
Sep 6, 2026
…ipeline idle check (sgl-project#37883)
5 tasks done
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
BufferModePipeline.is_idle()tells the cache when buffer-mode transfer work is quiescent, which gates the idle-time memory invariant check. It missed two kinds of in-flight work: storage hits parked inpending_hit_allocswaiting for host staging (they still hold prefetch occupancy and restart I/O once space frees), and nodes ininflight_backup_node_idswhose backup intent was admitted but whose D2H staging has not launched. Either can make the idle checker run against a pipeline that is about to move memory and report a spurious leak.Modifications
is_idle()now also returns False whilepending_hit_allocsorinflight_backup_node_idsare non-empty. The docstring is updated to match.Original commits
5e155a3447Checklist
Testing
ruff format --check,ruff check --select F401,F821,UP037,py_compileon the changed file.test_unified_radix_cache_unittest.pyandtest_hicache_staged_write_back_dispatch.pywithSGLANG_ENABLE_ASYNC_ASSERT=true: 127 passed, 279 skipped (non-applicable component configs).CI States
Latest PR Test (Base): 🚫 Run #33815929441
Latest PR Test (Extra): ❌ Run #33815929214
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33815929395