Repository navigation
Conversation
4 of 5 tasks
YAMY1234
force-pushed
the
pr/c-standalone
branch
2 times, most recently
from
September 17, 2026 04:29
50e3eee to
87ab343
Compare
YAMY1234
marked this pull request as ready for review
September 18, 2026 04:34
YAMY1234
requested review from
Jialin,
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
September 18, 2026 04:34
nvpohanh
reviewed
Oct 1, 2026
nvpohanh
left a comment
Collaborator
There was a problem hiding this comment.
[by Claude Code] Review comments are inline.
YAMY1234
force-pushed
the
pr/c-standalone
branch
from
October 4, 2026 23:11
8d853d4 to
206bb0c
Compare
YAMY1234
force-pushed
the
pr/c-standalone
branch
from
October 6, 2026 06:12
206bb0c to
8e1b959
Compare
Collaborator
Author
|
/tag-and-rerun-ci |
Collaborator
|
@hzh0425 Could you help to review this? Thanks! |
…TE_ON_HOST_EVICT) Cache mode wrote L3 at L2 admission (_finish_write_through_ack), so L3 was a superset of L2 and added no capacity: every L2 miss was also an L3 miss unless L3 retention exceeded L2's. With SGLANG_HICACHE_L3_WRITE_ON_HOST_EVICT=1, L3 is instead written from the coldest L2 pages ahead of their eviction: a reserve fraction of the host pool (SGLANG_HICACHE_L3_EVICT_WRITE_RESERVE_FRACTION, default 0.05) at the LRU tail is kept either free or already in storage. peek_host_eviction_candidates walks evictable host leaves in the order drive_host_eviction takes them (leaf cascade to parent, honouring the same host/segment lock tests) and _write_behind_host_tail issues write_backup_storage for the uncovered ones, refilling the reserve in quarter quanta (once every 4th check_hicache_events call) so a slow ack does not re-issue deeper into the tail. In-flight write-behind ops count as covered until acked. L2-admission writes are skipped while the flag is on, so L2 and L3 hold different pages and their capacities add. All inputs (pool state, tree, in-flight set, step counter) are rank-replicated, so issue order stays identical across ranks. Off by default; Python tree core only (the Rust adapter raises). Write-behind tier counters join the prefetch outcome stats snapshot. Measured on Qwen3.5-397B AgentX 3P:2D at C1000: no store 142.2K vs store 152.2K total-TPS/GPU (+7%); at C850 the write traffic costs ~1.5%. (cherry picked from commit f2790e9)
…and record beliefs TP-deterministically In cache mode a recompute after L2 eviction re-creates the node with backuped=False, so the node flag alone re-writes content L3 already holds. write_backup_storage now skips spans the StorageExistenceCache covers, and the prefetch-cut belief invalidation runs in both host memory modes (it was buffer_only-only) so stale positives at the usable cut heal the same way. Beliefs are added unconditionally on the storage ack (full hash chain, not completed_tokens-truncated): completed_tokens can diverge across ranks under backend failure, and a divergent belief desyncs the write/skip decision, which then hangs the rank collectives. A stale positive is advisory and heals via the prefetch hit-query shortfall. (cherry picked from commit 300f201)
…nit-bypassing stubs
YAMY1234
force-pushed
the
pr/c-standalone
branch
from
October 26, 2026 03:48
23e9d12 to
4cfe4d0
Compare
This comment has been minimized.
This comment has been minimized.
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
NorthmanPKU
approved these changes
Nov 6, 2026
Contributor
|
Sorry I approved this PR by mistake. I accidentally switched tabs while trying to approve a PR in my personal project. Could a maintainer please dismiss my approval? Thanks! |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
YAMY1234
added a commit
to YAMY1234/sglang
that referenced
this pull request
Nov 12, 2026
…behind engagement logs Port the read-only FULL host-tail peek (sgl-project#39845's peek_host_eviction_candidates) to the Rust TreeCore so SGLANG_HICACHE_L3_WRITE_ON_HOST_EVICT runs on it: - FullComponent::peek_host_eviction_candidates walks the same coldest-first heap as drive_host_eviction (HostEvictionWalk), simulating the child-count cascade with is_evictable_host_leaf_ignoring_children_; nothing in the tree changes and hashes are copied. - Binding + HOST_EVICTION_PEEK_SCHEMA_VERSION = 1; the adapter reports supports_host_eviction_peek and init_hicache refuses a Rust build without it. - Startup log names the write-back mode, the TreeCore backend and class, and the loaded native extension's path and sha256; a once-a-minute log line carries the cumulative write-behind counters, now including settled ops, settled and failed tokens. - Tests: six Rust peek tests (read-only, budgets, parity with the real cascade under every eviction policy, parent predicates); the DSV4 sidecar case and a new peek-is-the-eviction-order case run on both cores. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 tasks done
Collaborator
Author
|
Closing in favor of #52682, which implements the same idea (L3 written from host-eviction victims, opt-in) on current main with hybrid-model chain close and rank-agreed engagement. This branch is 1,200+ commits behind main. Tracking issue with the data from this PR and the planned follow-ups: #52694. |
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
With
--hicache-storage-backendin cache mode, storage (L3) is written at L2 admission: every page that enters the host pool is also written to storage. L3 therefore always holds a superset of L2 and adds no reusable capacity. A prefix that is evicted from host is only in L3 if its write happened to complete, and a prefix that is still in host is fetched from host anyway. On a Mooncake store shared by several prefill workers this showed up as a store that turns over constantly (every L2 admission is a put) while the hit rate does not move.This PR adds an opt-in mode where L3 is written from the coldest host pages ahead of their eviction instead. The two tiers then hold different pages and L3 becomes an overflow layer for L2. Measured on Qwen3.5-397B-A17B-NVFP4, GB300, 3P:2D PD-disaggregated, AgentX closed-loop trace at concurrency 1000: 142.2K total TPS/GPU without a store, 152.2K with the store in this mode (+7%); host hit rate held at 93.1%. At concurrency 850, where the host pool alone already covers the working set, the extra write traffic costs about 1.5%, which is why the mode is opt-in.
The second commit fixes write-side dedup in cache mode. A recompute after L2 eviction re-creates a node with
backuped=False, so the node flag alone re-writes content that L3 already holds.write_backup_storagenow skips spans theStorageExistenceCachecovers, and beliefs are recorded on the storage ack from the full hash chain (not thecompleted_tokens-truncated one) so ranks cannot diverge in the write/skip decision. The cost of that choice is that a failed write still records the pages as stored until a prefetch miss invalidates the belief;test_hicache_l3_failed_write_still_records_beliefpins this behavior down.Modifications
Commit 1,
SGLANG_HICACHE_L3_WRITE_ON_HOST_EVICT(default off):unified_cache/components/full.py: the host-eviction heap walk is one generator (_host_eviction_walk) shared bydrive_host_evictionand the new read-onlypeek_host_eviction_candidates(num_tokens), which returns host leaves in eviction order untilnum_tokensare covered._is_host_leafgainsignore_childrenso the simulation reuses the same predicate. The Rust adapter raisesNotImplementedError; the mode requires the Python tree core.unified_radix_cache.py: when the mode is on, the L2-admission storage write is skipped and_write_behind_host_tailruns on thecheck_hicache_eventspath (every 4th call, rank-replicated inputs only). It keepsSGLANG_HICACHE_L3_EVICT_WRITE_RESERVE_FRACTION(default 0.05) of the host pool either free, in flight, or already in storage. Candidates the existence cache already covers count as covered until host eviction consumes them, so a steady state with a fully tiered tail does not re-walk the heap;reset()clears both the in-flight map and that clean-tail count. Counters:wb_walks,wb_issued_tokens,wb_clean_tokens,wb_unbacked_tokensviaprefetch_outcome_stats_snapshot.--hicache-host-memory-mode buffer_onlyor the Rust tree core raisesValueErrorat init.write_backup_storagereturns the operation id.Commit 2, existence-cache dedup in cache mode:
write_backup_storageskips spans covered bystorage_existence_cache.operation.hash_valueunconditionally.test_hicache_l3_failed_write_still_records_belief.Accuracy Tests
Not applicable (cache placement only; no change to model forward).
Speed Tests and Profiling
Qwen3.5-397B-A17B-NVFP4, GB300 (4 GPU/node), 3 prefill nodes (PP4) + 2 decode nodes (TP4/DP4/EP4), Mooncake store on the decode nodes, AgentX 3600 s closed-loop trace, total TPS / total GPU:
Unit tests:
test/registered/unit/mem_cache/{test_unified_radix_cache_unittest,test_storage_prefetch_lifecycle,test_hicache_staged_write_back_dispatch}.pyon the Python tree-core backend, 1293 passed / 0 failed in the 2026-09-13 nightly container.Checklist
CI States
Latest PR Test (Base): ✅ Run #42430426545
Latest PR Test (Extra): ❌ Run #42430426558
Latest PR Test (AMD ROCm 10): ✅ Run #42430426601
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: