Repository navigation
fix(hicache): avoid per-rank-conditional TP collective in is_load_back_event_done (decode-side hierarchical cache) - #29483
Closed
AMD-yanfeiwang wants to merge 1 commit into
Conversation
…P collective) is_load_back_event_done() conditionally called loading_check() (a TP all_reduce) only on ranks whose local load-back finish_event had already fired. It is invoked per-request from the decode load-back path, so the number of calls and the local finish_event.query() result diverge across TP ranks; the conditional collective therefore desynchronized the TP all_reduce sequence and could deadlock under TP > 1 (manifesting as a small number of requests stuck forever with errors=0 and idle GPUs). The load ack-reaping collective is already issued once per scheduler iteration at a rank-invariant point (check_hicache_events -> loading_check), so this per-request helper only needs to report local GPU-event readiness. Drop the collective and make it a pure finish_event.query(). This mirrors the existing rank-invariant handling in writing_check().
AMD-yanfeiwang
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
June 27, 2026 03:53
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
saatwiknagpal
added a commit
to modal-projects/sglang
that referenced
this pull request
Aug 27, 2026
…k_event_done (backport of sgl-project#29483) Rank-divergent all_reduce in the decode load-back path deadlocks TP>1 under high-concurrency HiCache load-back. Confirmed present on this branch; matches the DFLASH+HiCache saturation-hang signature observed 2026-08-26/27 (4/4 containers, watchdog kill ~10 min into fleet load).
CrimsonDump
added a commit
to CrimsonDump/sglang
that referenced
this pull request
Aug 31, 2026
…on check
is_load_back_event_done() guarded loading_check() -- which issues a TP
all_reduce -- behind a *local* CUDA event query. Each rank's event completes
at a different moment, so ranks took different branches and the collective
was entered by only some of them, aborting with:
gloo::EnforceNotMet: op.preamble.length <= op.nbytes. 4 vs 2
Fatal Python error: Aborted
Reproduced on GLM-5.2 (DSA/MLA) with PD disaggregation, decode-side radix
cache + hierarchical cache, TP=8; it fires as soon as L2 load-back gets
dense. TP=1 avoids it by construction, which is why it had no live repro.
Make the check a pure local poll. The acknowledgement is already collected
by check_hicache_events() -> loading_check(finish_count=...), a path that
runs every scheduling round and is rank-invariant, so nothing is lost.
Upstream PR sgl-project#29483 fixes the same bug, but it patches HiRadixCache, which
PR sgl-project#35081 removed from the default selection chain -- DSA models construct
UnifiedRadixCache instead, so that fix never takes effect for them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gm37APvz9k3D8x9Yr2PQew
Contributor
|
Thanks @AMD-yanfeiwang. Closing this because it has had no updates in 91 days. Reopen it if the work is still relevant. Some directories moved recently, so an older branch may need retargeting: |
1 task 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.
Scope
Defensive correctness fix for a latent TP-collective desynchronization in the
decode-side hierarchical cache path. It only affects deployments that run
decode with
--enable-hierarchical-cacheunder TP > 1 (wheredecode_hicache_mixincallsis_load_back_event_done). Configs that do notenable decode-side hierarchical cache never reach this code path, so this is a
no-op for them.
Problem
HiRadixCache.is_load_back_event_done()conditionally callsloading_check()— which issues a TP
all_reduce— only on ranks whose local load-backfinish_eventhas already fired:This helper is invoked per request from the decode load-back path
(
disaggregation/decode_hicache_mixin.py), so both the number of calls and thelocal
finish_event.query()result differ across TP ranks. The conditionalcollective therefore desynchronizes the TP
all_reducesequence and candeadlock under TP > 1 (manifesting as a few requests stuck forever with
errors=0and idle GPUs during high-concurrency decode-side HiCache load-back).Fix
Make
is_load_back_event_done()a pure per-rank GPU-event poll(
return finish_event.query()) and drop the collective. The load ack-reapingcollective is already issued exactly once per scheduler iteration at a
rank-invariant point (
check_hicache_events->loading_check), so acks arestill reaped in lockstep; this helper only needs to report local readiness for
per-request scheduling. This mirrors the existing rank-invariant handling in
writing_check().Notes / test status
python -m py_compilepasses.collective, which is unsafe by construction. It has not been independently
bisected against a live decode-hierarchical-cache TP>1 deadlock repro (our
observed high-concurrency warmup hang was a separate router/PD-dispatch issue),
so review of the lockstep-reaping argument above is appreciated.