Skip to content

[HiCache] Count hit allocations and in-flight backups in the buffer pipeline idle check - #37883

Merged
xiezhq-hermann merged 1 commit into
mainfrom
fix/buffer-pipeline-idle-check
Sep 3, 2026
Merged

xiezhq-hermann merged 1 commit into
mainfrom
fix/buffer-pipeline-idle-check

Conversation

@xiezhq-hermann

@xiezhq-hermann xiezhq-hermann commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

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 in pending_hit_allocs waiting for host staging (they still hold prefetch occupancy and restart I/O once space frees), and nodes in inflight_backup_node_ids whose 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 while pending_hit_allocs or inflight_backup_node_ids are non-empty. The docstring is updated to match.

Original commits

  • 5e155a3447

Checklist

Testing

  • ruff format --check, ruff check --select F401,F821,UP037, py_compile on the changed file.
  • Buffer-mode / staged-prefetch / anchor-lock slice of test_unified_radix_cache_unittest.py and test_hicache_staged_write_back_dispatch.py with SGLANG_ENABLE_ASYNC_ASSERT=true: 127 passed, 279 skipped (non-applicable component configs).
  • Validated end-to-end on an internal L3-backed buffer-mode CI lane with the strict idle memory check enabled; the spurious idle-leak reports no longer occur. Not re-run from this branch; relying on CI for GPU suites.

CI States

Latest PR Test (Base): 🚫 Run #33815929441
Latest PR Test (Extra): ❌ Run #33815929214
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33815929395

…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

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added hicache Hierarchical Caching for SGLang run-ci CI: run the baseline test suite on this PR labels Sep 3, 2026
@xiezhq-hermann
xiezhq-hermann merged commit b444963 into main Sep 3, 2026
123 of 172 checks passed
@xiezhq-hermann
xiezhq-hermann deleted the fix/buffer-pipeline-idle-check branch September 3, 2026 23:08
StevenChenSE pushed a commit to StevenChenSE/sglang that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hicache Hierarchical Caching for SGLang run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant