Repository navigation
Conversation
Signed-off-by: lhzds <[email protected]>
lhzds
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
October 16, 2026 11:08
detain
added a commit
to detain/sglang
that referenced
this pull request
Oct 29, 2026
…mily + S-EXT1 + riders + S-RACE + LLGUARD/ENVREG), S-EXT1 and S-RACE items CLOSED, entry-256's raw-env deviation and LL-vs-PCIe-IPC collision warning both marked CLOSED with the BOOT_DELTA (h') needle in landing terms, sgl-project#35617 left as the sole FAM-A7 survivor, sgl-project#44732 re-pointed to the operator's merge-sgl-project#5 answer, and the KV-ROUTE DECISION RECORD added (HOLD NVFP4-KV until armed PCIe-IPC is measured post-merge; preferred-if-ever sequence merge -> sgl-project#43356-delta -> sgl-project#46452 NOT sgl-project#43240 -> optional sgl-project#43471 -> fork BUILD-A QSA FP4 reads (template sgl-project#38724) -> BUILD-B L3 scale sidecar -> one GPU window; sgl-project#46141 template, sgl-project#44462 NEXT, MXFP4 declined, entry-247 re-sync watch-string modelopt_e4m3_k32)
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.
3 of 4 tasks
Merge upstream main and retain logical KV dtype isolation. Adapt host-pool construction and cover layout/dtype pairs plus legacy keys. Signed-off-by: lhzds <[email protected]>
This branch has not been 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
Reusing persisted HiCache pages after changing the host memory layout can silently produce incorrect model outputs. Dense MHA and MLA host pools share L3 storage keys across layouts with different page byte orders, even with the logical dtype tagging from #38362. The file backend accepts these incompatible pages because their byte counts are identical, so the restored KV values are interpreted using the wrong layout.
This occurs when pages written with
layer_firstare reused after restarting withpage_first, while keeping the same model, rank configuration, page size, and storage directory.Reproduced on the original PR revision (
68c917c75d) using an NVIDIA L20 with Qwen3-0.6B: all three requests reported 240-token L3 hits but produced different token sequences from the cold-cache control. With this fix, all three miss the incompatible entries and match the cold-cache outputs token for token. GPU page round-trips also reproduced incorrect KV values for both MHA and MLA.Modifications
Add layout-specific
storage_format_tagvalues to the dense MHA and MLA host pools through the existing storage model-name tagging mechanism, so incompatible cached pages miss.layer_firstandpage_first_directin the same namespace because their flattened page byte order is identical.page_head, using the current host-pool constructors.Compatibility: Existing MHA/MLA L3 entries without a layout tag will miss and require cache warmup under the new keys, even if the host layout is unchanged. Existing entries are not deleted or migrated.
Accuracy Tests
CPU validation after merging
mainatd9ec74eb72:main(8d3185e367)memfd_create//dev/shm) and the native hash extension.These CPU tests ran on macOS with real tensors and file I/O. A local test adapter uses native anonymous
mmapwithout the Linux-onlyMAP_POPULATEflag; the regression control uses the same adapter.GPU validation on the original PR revision (
68c917c75d):Model validation used one NVIDIA L20, Qwen3-0.6B, and the file backend: TP=1, Triton attention, CUDA graphs disabled,
buffer_only,write_through, and page size 16. The three prompts each contained 253 tokens and generated 16 tokens. GPU page tests exercised device-to-host and host-to-device transfers for MHA and MLA withlayer_firstandpage_first.Speed Tests and Profiling
This change is limited to storage-key namespacing.
Checklist
CI States
Latest PR Test (Base): ❌ Run #43706125222
Latest PR Test (Extra): ❌ Run #43706125026
Latest PR Test (AMD ROCm 10): ❌ Run #43706125127
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: