Repository navigation
[Fix] hicache: Recover storage worker collectives and expose storage liveness - #44342
Open
xiezhq-hermann wants to merge 6 commits into
Open
xiezhq-hermann wants to merge 6 commits into
xiezhq-hermann wants to merge 6 commits into
Conversation
…liveness A gloo timeout inside the HiCache storage worker collectives (the query thread's hit MIN, the sync thread's ack MIN) killed the worker on every rank, so one rank stuck in its backend left every rank unable to publish L3 queries or acks: under wait_complete every later L3-hit request waited forever, under timeout every one paid the full deadline. #43550 guards the backend call only, not the collective, and nothing checked worker liveness. Wrap every worker-thread collective: on failure log once, flag the controller (storage_sync_failed), publish the operation as FAILED (0 hits, 0 completed tokens) and keep the thread alive; after the first failure the broken groups are skipped so the per-rank publication sequence stays intact for the queue-count drain. Fold a rank-local health bit (no sync failure and all storage workers alive) into the MIN-reduce the scheduler drain already issues; when the agreed bit drops, apply storage_failure_policy: "disable" (default) degrades to no-L3 until the backend is re-attached (no new prefetch/backup, in-flight prefetches cut like a deadline, drained hits read as misses, progress frozen, gauge sglang:hicache_storage_healthy -> 0), "raise" fails the scheduler. A new storage_sync_timeout extra-config key bounds the sync groups' gloo timeout so a hung peer is detected before torch's 30-minute default.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Review follow-up. Skipping every later collective after the first sync failure was unsound: gloo closes only the pair of the group that timed out, and the hit and completion sync groups are distinct even on TP2, so a peer that had not failed blocked for the untouched group's full timeout (30 min by default), during which reset/detach could not join and flush raised out of the scheduler. A retry on the broken group raises at once on every rank, so the collective is now always entered. Also: take_ready_pp_prefetch waits in 1 s slices and fails loud when the local ticket thread is dead; the buffer-only PP>1 health relay is limited to the ticket-less shape (with tickets PP0 decides per request); the sync knobs are validated before any attach side effect; the gauge drops on detach; a WARNING once a minute while degraded; thread attributes are initialised in __init__; reset logs that L3 stays disabled. The two-rank test now runs its three cases in one spawn through check_hicache_events, adds the cross-group case (an ack on the healthy group must reduce promptly on both ranks after the hit group failed) and takes ~26 s.
This was referenced Oct 14, 2026
Draft
Resolves the rebase against #43344 (the PP ticket thread now runs the hit query itself, so the scheduler-thread reduce this branch guarded is gone and the ticket-thread failure hook moves to its unconditional exit), #44614 (the degrade cut reuses the deadline_expired machinery) and the shared-memory count exchange in _sync_hicache_ready_counts (the health bit is split out on that path too). Test fixtures gain the attributes main added.
… bounded ticket group - storage_workers_healthy() watches the worker threads the controller started; a controller whose storage I/O runs outside Python workers has none and reads healthy on their account instead of dead. - storage_sync_timeout defaults to 300 s instead of torch's 30-minute gloo default (null / absent -> default, non-finite rejected); a hung peer is noticed in minutes while staying far above any healthy batch call. - The PP ticket broadcast group is created when the storage workers start, after attach applied the timeout, so it is bounded like the other storage collectives (it used to be built before the config was parsed). - A prefetch cut by the rank-agreed degrade reports storage_unavailable in storage_prefetch_unfulfilled_tokens_total instead of borrowing deadline.
xiezhq-hermann
marked this pull request as ready for review
October 28, 2026 23:03
xiezhq-hermann
requested review from
JustinTong0323,
Ying1123,
alphabetc1,
ch-wan,
fzyzcjy,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
sufeng-buaa,
wisclmy0611,
yizhang2077 and
zijiexia
as code owners
October 28, 2026 23:03
…h bit The storage health bit is one more word in the HiCache ready-count row, so the no-extra-pool storage layout no longer fit the 8-word shm table and every storage-enabled tick fell back to the gloo reduce. get_shm_exchange takes the row width; the hicache exchange asks for 9. The shm exchange test builds its controller with the liveness hook and expects the health verdict.
detain
added a commit
to detain/sglang
that referenced
this pull request
Oct 29, 2026
…(entries 255-256) Batch 1 of the 2026-10-28 second wave. Two open-PR ports landed clean (zero conflicts) onto 56f97a7 -- code tip 0df18e9: a13e98b sgl-project#44448 (VMM graph-input staging in CustomAllreduce v1, defense-in-depth behind the entry-75 init refusal) and 0df18e9 sgl-project#39605 (host-staged + LL TP2 all-reduce transports, both opt-in, LL/PCIe-IPC COLLISION documented at the dispatch site). FAM-A6a marked LANDED in wanted_stack.txt; sgl-project#44342's parallel_state.py hold explicitly RELEASED for its later FAM-A3b wave. Verified at the landed tip (prod venv, CVD=9): comm named set 114P/1S/30sub (exact worker match), whole unit/distributed dir 120P/1S/35sub 0F, the three new test files collect 18 (9 registered multi-GPU + 9 test/manual). NOTHING PUSHED.
detain
added a commit
to detain/sglang
that referenced
this pull request
Oct 30, 2026
… C closure -- the post-merge port queue is now decided ARRIVAL SCAN (git log 12dc623..2a6c204 --grep) + LIVE gh STATE + head-sha comparison for EVERY deferred item. Verdicts: RELEASED-BY-MERGE: sgl-project#42689 (@ 7a632cf in-range -- the SECTION-B cherry is now redundant; behavior note rides the restart). CLOSED (C-items whose PRs arrived and whose integration this stack performed): C1 (the dedicated merge week WAS merge sgl-project#5; all eight precursor PRs in-range), C2 (sgl-project#44993/sgl-project#44994 -- B5), C3 (sgl-project#45232/ sgl-project#45236/sgl-project#45334 -- B2), C4 (sgl-project#45238/sgl-project#45241/sgl-project#45242 -- B3), C5 (sgl-project#44912/ sgl-project#44913 -- arrived; entry-230 canary re-planted as its guard), C9 (sgl-project#39727 -- verified OPT-IN, no purge; BOOT_DELTA anti-needle), C0a (arrival shas already recorded at entry 310 -- Section C now carries NO open code-integration items: C6/C10 retain only their explicitly-named docs/boot-measurement remainders, re-stated). STILL-OPEN: sgl-project#44342 (head unchanged; auto-merge comfort LOST to #46970x), sgl-project#46153/sgl-project#37106/sgl-project#32479/sgl-project#45391 (gh CONFLICTING -- stale bases, rebase before any port), sgl-project#41624/sgl-project#42525/sgl-project#42660/sgl-project#44462/sgl-project#35617 (open, heads unchanged), sgl-project#46191/sgl-project#39845-class (watch-list, none in range). HOLD STANDS (operator decision, binding): sgl-project#43356/sgl-project#46452/sgl-project#43240/ sgl-project#43471 KV route -- step-1 'MERGE sgl-project#5 lands first' is NOW MET; the sequence may be re-visited ONLY with the post-merge PCIe-IPC measurement at an operator sitting. sgl-project#44732: the 'one purge if done WITH the merge' premise LAPSED when merge sgl-project#5 completed without it -- later execution costs the SAME single purge once; no penalty, no haste. Recorded for the operator, not decided by B6.
detain
added a commit
to detain/sglang
that referenced
this pull request
Oct 30, 2026
…gl-project#44462(317)/sgl-project#44342-trunk(318) in both the FAM-A3b block and the B6 re-triage verdicts; 10 dated corrections (mergeable flips: sgl-project#46191 REAL -> WATCH-HIGH with the re-derive-vs-QSA_RING_GROUPS=2 instruction, sgl-project#39845 DISPUTED as UNKNOWN-not-true plus the general 'UNKNOWN is no signal' rule; sgl-project#44344 -> SECTION R DOA with the entry-268 unconditional-clear subsumption citation and the mergeable-is-a-trap note; sgl-project#42525 target path moved fla->linear; sgl-project#45520 STILL OPEN -> re-apply rule ARMED FOR MERGE sgl-project#6; b12x-package archived claim DISPUTED with the frozen cutlass-dsl==4.8.0 pin risk standing; sgl-project#46153+sgl-project#41624 gated as ONE QAD bundle; sgl-project#37106 PARKED on eroded motivation with named revive conditions; sgl-project#32479 gated behind the PCIe-IPC measurement and DE-COUPLED from sgl-project#45391; sgl-project#44462's NEXT note spent); NEW S-item S-B12XDENSE filed
xiezhq-hermann
marked this pull request as draft
October 31, 2026 04:57
4 of 6 tasks
huangtingwei9988
marked this pull request as ready for review
November 4, 2026 07:59
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
detain
added a commit
to detain/sglang
that referenced
this pull request
Nov 11, 2026
…ack on sgl-project#48421's structure, 3/3 markers consumed Fork region@1772/@1878 (merge-sgl-project#5 B3-2's trailing_endpoint machinery) was dropped by merge6's take-upstream of sgl-project#48421, leaving the tree calling three methods it no longer defined (`_trailing_endpoint_tokens` 1069, `_report_no_restorable_endpoint` 1072, `_report_sidecar` 2066/2207) and reading the collective tail with upstream's mask-first slice against the fork's mask-last payload (a live payload-order clash -- reduced[:len(hits)] was aliasing count+verdict slots). Decision (C3 oracle run first): sgl-project#48421 PARTIALLY SUBSUMES. Its inline mask builder is byte-equivalent to local_restorable_mask minus the terminated-query all-zero vote, and the schema-ordered per-pool verdicts + zero-on-failure ack subsume the fork's PoolName ack loop (PoolName is a str-Enum: pool.value == schema string key). Its collapse-to-deepest RETURN is NOT equivalent: the entry-209 prod fix needs the folded count as the hit PLUS the agreed endpoint SET on the operation, so the host-capacity clamp in allocate_storage_hit can stop a shortened span on a verified endpoint or decline (the 2-rank gloo case asserts agreed == 3*PAGE, i.e. the folded MIN, "unchanged by the extra mask entries"). Adopting the collapse would re-create the forfeited-prefix symptom the clamp exists to prevent. - _sync_prefetch_hit_query: fork payload [count]+verdicts(list(PoolName)) +mask restored, agreed-set write-back restored, folded-count return kept, upstream's _finish_op_trace-on-zero tracing arm ADOPTED (orthogonal). Dead sgl-project#48421 inline `hits` builder removed. - _trailing_endpoint_tokens / _report_sidecar / _report_no_restorable_endpoint re-planted verbatim from the ours-dropped snapshot (budget counters sidecar_endpoint_clamps/_sidecar_reports survived at 339/342). - region@2559 ack marker closed as ADOPTED upstream (note in-tree). Battery actuals (CPU, CVD=9, prod venv, PYTHONPATH=wt/python): - test_hicache_trailing_endpoint.py 10F/7P -> ** 17P ** (the boot gate). - buffer_mode_sidecar 2F -> 1F (survivor = new upstream sgl-project#48013 test whose SimpleNamespace harness lacks the sgl-project#44342 _storage_sync_all_reduce binding; b2-owned harness class, reported). - hybrid_storage_sparse_allocation 6F -> 0, hicache_file_lru_unit 1F -> 0, pp_prefetch_ticket class green. 4 files: 82P/1F/47sub. Gates: ruff (F401,F821,F823,UP037) + format clean; registration trio rc=0.
detain
added a commit
to detain/sglang
that referenced
this pull request
Nov 11, 2026
…r/URC markers -- 3/18 census consumed, 3 gates in one CASCADE (start_writing(wait_for_forward) TypeError class, 68 distinct nodes): upstream sgl-project#48012's NEW fixture hicache_write_back_fixtures.InstantWriteBackController mirrored the pre-sgl-project#44800 no-kwarg surface while the fork's writing_check drain (entries 199/218: the batched-backup flush=False + ONE fenced start_writing) calls the real API. Def-site fixes, no fence weakened: - fixture start_writing gains the keyword (instant copies -> accepted-ignored, documented); - test_write_back_eviction_batching: record_submission wrapper FORWARDS the flag (it measures the very wait, so swallowing it would understate the fence); _FencedController gains load_fence_stream = forward (the fork's unconditional entry-168 fence reads it first; prod: both streams are the same forward stream) -- also silences the 16-test Rust TreeCore panic class whose "victims not demoted" assert was the aborted submission downstream. MARKERS (3): managers/cache_controller.py:1202 ADOPTED -- the dropped set_hicache_transfer_done_event write line is superseded by upstream c24285b(sgl-project#48008 per-band page ledger)+2cbb66f563(sgl-project#48012): record_host_transfer publishes the same signal per-page BOTH directions (load twin writes=True). unified_radix_cache.py:627 ADOPTED -- the buffer-mode threshold floor (resolve_prefetch_threshold) was DELIBERATELY deleted upstream by dfaca56(sgl-project#46934, restores sub-window SWA L3 hits); window sizing now lives per-allocation in BufferModePipeline; the per-call-site file_storage_path fold is consistent with the entry-253 funnel (cache_controller.py:948, intact). unified_radix_cache.py:3917 RE-PLANTED -- entry-293's cadence gate (park, do not re-enter allocate_storage_hit/evict_host inside the retry window) + the expired no-retry arm were dropped; wait_full folded into upstream's comp_xfers allow_partial rule (min_tokens form already equivalent). URC context guard: _deferred_ready_sync_group read get_memory() unguarded -- upstream's NEW _arm_tick CPU/spawn fixtures (their restructured timeout tests, sgl-project#44614) reach it without a published server config. Now published-check (schedule_policy.py:615 idiom): default-off CPU path, production unchanged. Deadline-anchor retargets (fork B3-9 family vs upstream's sgl-project#44614 vote-before- poll restructure; every assertion preserved): _vote_prefetch_deadlines drives the verdict before the expiry polls; failed-arm polled inside-budget so the storage failure stays the SOLE cut reason; fixture cc gains the sgl-project#44342 liveness attrs + pp_prefetch_command_thread; _arm_tick stub returns the fork's 5-tuple (health bit True); release_aborted_request -> finish(ABORT) per 8898429(sgl-project#48491). Battery actuals (CPU, CVD=9, prod venv, PYTHONPATH=wt/python): - the 5 cascade files 68F/39P -> 3F/70P (survivors = the sgl-project#48491/pp-thread/ budget-anchor fixes committed here; after them): test_storage_prefetch_ lifecycle ** 31P/31sub ** (entry-311 pin 28P/31sub, 295's >=23P/28sub EXCEEDED); decode_retraction_backup 6F + chunked_publish 2F = No-CUDA device class (env, reported). - combined gate run: trailing_endpoint + batching + parity + async_ready_sync + staged_write_back = 89P/1S/28sub 0F. Gates: ruff repo ruleset+format clean on touched files; registration trio rc=0.
This was referenced Nov 24, 2026
This branch was successfully deployed
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
The Python HiCache storage pipeline runs one query, one transfer, one sync and one backup daemon thread per rank, and the query thread and the sync thread each rank-reduce their result with a gloo
all_reduceon dedicated storage sync groups (cache_controller.py_sync_prefetch_hit_query,_reduce_prefetch_ack;hybrid_cache_controller.pyoverrides; since #43344 the PP ticket thread issues the same hit reduction). Those collectives are outside everytry/except, and nothing on the scheduler thread checks whether the workers are alive. So when one rank's backend call hangs (slowexists()/get(), a stuck RPC) the peers block in the collective, and once the group timeout fires the collective raises and kills the worker thread on every rank (the healthy rank withTimed out waiting ... for recv operation, the hung rank withConnection closed by peerwhen it finally enters the collective). From then on no query or ack is ever published on any rank: underwait_completeevery later L3-hit request waits forever, undertimeoutevery one of them pays the full deadline and recomputes, and the only operator remedy (/flush_cache, detach) raises out of the scheduler. #43550 only guards the backend call, not the collective. The same strand happens when a worker thread dies for any other reason on one rank: its peers' collectives never complete.Two-rank CPU reproduction (gloo, rank 1 hung in
batch_exists, 3 s group timeout): rank 0's query thread dies at 3.0 s, rank 1's at 5.0 s the instant its call returns, nothing is published, every later query stays queued — on upstream main as well as with #43550.This PR makes the worker collectives recoverable and gives the scheduler a rank-agreed liveness signal, so a collective failure or a dead worker degrades to "L3 unavailable" instead of silently stranding every rank.
Modifications
Worker threads (
cache_controller.py,hybrid_cache_controller.py)HiCacheController._storage_sync_all_reduce: on aRuntimeError(gloo timeout, connection closed) it logs one ERROR with the traceback, sets the controller-levelstorage_sync_failedflag and returnsFalse; the caller publishes the operation as FAILED on this rank (hit query -> 0 hits with no pool verdict, transfer ack -> 0 completed tokens, sidecar ack -> all-zero pool hits) and the thread stays alive. Every later collective is still entered: gloo keeps a timed-out pair closed, so a broken group raises at once on every rank (measured 0.00-0.01 s), whereas skipping it would strand a peer on a group that did not fail (the hits and completion groups are distinct gloo groups even on TP2). The publication sequence stays exactly one per query and one ack per transfer batch, which is what the scheduler's MIN-of-queue-sizes drain relies on.pp_prefetch_command_thread_func) runs the hit query and its MIN itself since [Perf] hicache: Unify PP prefetch hit queries and buffer allocation #43344, so the guarded_sync_prefetch_hit_querycovers the ticket path; an unexpected ticket failure records the same sync failure before the thread exits (the broadcast is the PP agreement itself).is_pp_prefetch_readyno longer raises for a dead ticket thread under the default policy (the health bit retires the ticket instead;raisekeeps the old fail-loud behaviour), andtake_ready_pp_prefetchwaits in 1 s slices and raises when the local ticket thread is dead instead of blocking the scheduler forever on a ticket PP0 declared ready.storage_workers_healthy()/storage_health_reason(): rank-local liveness = no sync failure and every started storage worker thread (plus the PP ticket thread when present) alive. A controller whose storage I/O runs outside these Python workers has none to watch and reports healthy on their account.--hicache-storage-backend-extra-config, popped and validated at the top ofattach_storage_backendbefore any side effect (that entry point also covers the decode offload manager, which bypassesparse_storage_backend_extra_config):storage_failure_policy("disable"default,"raise") andstorage_sync_timeout(seconds, default 300; torch's gloo default is 30 minutes). The timeout is plumbed through a new optionaltimeoutargument ofcreate_custom_parallel_groupintotorch.distributed.new_groupfor the groups the controller builds in_create_sync_groupsand for the PP ticket broadcast group, which is now created when the storage workers start — after attach has applied the timeout — instead of before the config is parsed (reset()restarts the threads and keeps the group).mla_host_dedup._prebuild_prefetch_sync_groupsbuilds a second, currently unused set with torch's default.Scheduler thread (
unified_radix_cache.py)_sync_hicache_ready_countsanddrain_storage_control_queuesappendint(cc.storage_workers_healthy())to the MIN-reduced count tensor, read after the queue sizes (see below), on both the gloo reduce and the shared-memory count exchange (_shm_count_exchange; itshicacherow grows from 8 to 9 words so the no-extra-pool layout keeps taking the shm path,get_shm_exchangegains awidthargument for that). In buffer-only PP>1 without PP tickets every stage issues its own prefetch andcheck_prefetch_progressmust cut on one value, so PP0's verdict is relayed with the existing_pp_sync(one recv per tick on PP>0, the coupling cache-mode PP already has); with PP tickets PP0 decides per request through the existing MAX, so stages keep their own bit and nothing new touches the PP group._apply_storage_health: when the agreed bit drops (once): ERROR log with the reason (this rank's, or "reported by a peer rank"),sglang:hicache_storage_healthygauge -> 0 (also set to 0 on detach, 1 on attach), then the policy.disablesetsstorage_unavailableand logs a WARNING once a minute while degraded;raiseraisesRuntimeErrorout of the scheduler.storage_unavailable:prefetch_from_storageandquery_storage_hit_lengthreturn immediately,write_backup_storage/enqueue_backup_intentenqueue nothing new,check_prefetch_progresscuts every in-flight prefetch through thedeadline_expiredmachinery of [Fix] hicache: Bound the storage prefetch timeout from the first blocked admission poll #44614 (no retry re-arm, no belief learning, no miss accounting) and reports it under a newstorage_unavailablereason ofsglang:storage_prefetch_unfulfilled_tokens_total, a PP ticket is retired on every rank through the PP0-decided MAX (verdict 0 pending / 1 ready / 2 retire), the drain reads every popped hit as a miss and applies no further transfer progress (completion still releases each operation's tail at the last agreed progress), and_invalidate_absent_from_hit_querylearns nothing. Re-attaching the backend (fresh threads and groups) clears the flag;/flush_cacherestarts the workers but keeps the groups, so it logs that L3 stays disabled.Why the degrade is rank-consistent. After the first failure every collective on the broken group fails on every rank, but the failing collective itself can end differently per rank: a peer whose data arrived just before the timeout may complete while the other rank raised. The design therefore never trusts a value published around the failure: a worker sets
storage_sync_failedbefore it publishes the failed item, and the scheduler reads the queue sizes before the health bit, so any round that counts (and thus pops) a possibly-asymmetric publication is a round in which the agreed bit is already 0 on every rank (MIN), and in such a round every rank discards the hit, freezes transfer progress and skips belief healing identically. Items drained in earlier rounds were reduced successfully on all ranks. The frozen progress is conservative (a batch that every rank did complete may be dropped) but identical everywhere; the prefix that was already agreed is still used.Why
disableis the default. The OSS default stack has no supervisor that restarts a crashed server, and a degraded L3 (one ERROR, a gauge at 0, a WARNING per minute, cold TTFT) is strictly better than today's strand or a crash of the whole engine; fleets that alert on crashes rather than logs can opt intoraise. Happy to flip the default if maintainers prefer fail-loud.Why 300 s. The group timeout only bounds how long a healthy rank waits for a peer that is stuck in its backend; tripping it degrades L3 until re-attach, so it must stay far above any healthy batch call (128 pages per call) and above the 60 s idle ticket broadcast, while noticing a hung peer in minutes rather than after 30. A per-call bound that turns a hung call into a single miss without touching the group is a separate PR (#44343).
Known limits (pre-existing behaviour, called out for reviewers): the health bit is agreed over the ranks that share a scheduler drain, so in every PP>1 shape a PP>0 stage's own worker failure reaches PP0 only once a cross-stage sync collective fails or times out (folding PP>0 bits needs a reverse message per tick; follow-up). A worker stuck inside a backend call (not a collective) is still only released by that call returning or by a per-call bound (#44343); the health bit covers thread death and collective failure.
/flush_cache/detach while a worker is still inside a hung backend call still fail their 10 s join (flush raises out of the scheduler, pre-existing; #44348); once the call returns both succeed. A worker that dies loses the acks it had not published, so its in-flight operation's host tail stays allocated until re-attach; under a dead backup thread, cache-modeongoing_backuphost locks and already-queued buffer-mode write staging stay pinned until re-attach (only new work is gated).Rebase note. The branch was brought up to date with a merge of
main; the conflicts were #43344 (the scheduler-thread PP reduce this branch guarded no longer exists), #44614 (the degrade cut now ridesdeadline_expired) and the shared-memory count exchange (health bit split out there too). The GPU runs below were done on the first revision of this PR; the rebased code was validated on CPU (below).Accuracy Tests
No model forward changes. On the GPU runs below (first revision), L3-hit outputs match the cold greedy outputs (3/3 verify prompts, 0 mismatches).
Speed Tests and Profiling
Healthy path (Qwen2.5-1.5B-Instruct, TP2,
filebackend,buffer_only,write_through, page 64, 16 prompts x 6-8k tokens, seed / flush / replay; first revision):timeoutwait_complete(0 ERROR lines.) The health bit adds one int to an existing all-reduce (or one column of the shared-memory row) per scheduler tick; no new collectives on the healthy TP path.
Wedge path (
wait_complete,storage_sync_timeout: 20, rank 1'sbatch_existshangs 90 s on the first query; first revision): the faulted request completes after 20.09 s and the eight L3-hit requests queued behind it after 10.1-10.2 s (they were released by the same rank-agreed cut), short prompts 0.03 s throughout; both ranks logHiCache storage sync failed ... Timed out waiting 20000ms/HiCache storage pipeline unhealthy ...once,sglang:hicache_storage_healthydrops to 0 on both ranks,/healthstays 200; a second wave 60 s later is served cold at 0.04-0.16 s TTFT; once the hung call had returned,/flush_cachesucceeded and both query threads were idle atqueue.get. Before this change the identical fault stalls every L3-hit request forever and/flush_cachecrashes both ranks.Unit tests (CPU, rebased head):
test/registered/unit/mem_cache/test_hicache_storage_sync_recovery.py(one two-rank gloo spawn running the hit-query timeout, ack-alignment and dead-worker cases through the productioncheck_hicache_eventsround; knob parsing/validation and timeout plumbing; the PP ticket group receives the timeout; a controller without started Python workers reads healthy while an exited worker reads dead). The two-rank case fails on the pre-fix source (the query thread dies) and on the first revision of this PR (the cross-group ack is skipped on one rank and blocks the other for the healthy group's timeout). Existing suites rerun on the rebased head together with the new one:test_buffer_mode_sidecar,test_hicache_pp_sync_drain,test_pp_prefetch_ticket,test_storage_prefetch_lifecycle,test_unified_hicache_regressions,managers/test_scheduler_hicache_events— 53 passed, 3 skipped (47 subtests).test_pp_prefetch_ticket::test_file_attachment_enables_pp_ticketsnow drives the group creation through_start_storage_threads, where the group is built. Not run: AMD/NPU lanes, PP>1 (no PP2 buffer-only step-time check; the relay is limited to the ticket-less shape) and mooncake/hf3fs/nixl e2e.Checklist
CI States
Latest PR Test (Base): ✅ Run #40790087428
Latest PR Test (Extra): ❌ Run #40790087329
Latest PR Test (AMD ROCm 10): ❌ Run #40790087482