Skip to content

[Refactor] memory-pool: Build QSA indexer host pools from buffer info - #40916

Merged
ispobock merged 12 commits into
mainfrom
hicache-decl-d
Nov 1, 2026
Merged

ispobock merged 12 commits into
mainfrom
hicache-decl-d

Conversation

@ispobock

@ispobock ispobock commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Part 4 of 5 of #40608. QSAIndexerPoolHost read the compressed key buffers, page shape and host layout directly from QSATokenToKVPool and its anchor host pool. This PR has QSATokenToKVPool export them through get_device_pool_infos() as a dense IndexKeyBufferInfo for the INDEXER pool, indexed by KV pages. The assembler captures the target and MTP draft infos, checks that they share page coverage and compress ratio, and builds QSAIndexerPoolHost from the packed info plus the host page count and layout. The host pool no longer references the device pool.

Host budget, host layout and the transfer path are unchanged. Under a fixed hicache size the KV host budget still excludes the packed index bytes, now summed from the captured buffers.

Accuracy

Qwen3.8-Flash-Next, tp 4, NEXTN, HiCache multi-turn KL with forced host hits against main, 3 runs per side. In every run the assembled host pools and the H2D transfer sequence are identical to main, host-served sample counts are equal (prefill 5/8, decode 8/8), and decode-hit KL is identical. Prefill-hit KL varies run to run on main as well and stays within main's range.

main:

prefill_kl: 0.01408 / 0.00876 / 0.00591
decode_kl:  0.00358 / 0.00358 / 0.00358

this PR:

prefill_kl: 0.00835 / 0.00375 / 0.00784
decode_kl:  0.00358 / 0.00358 / 0.00358

CI States

Latest PR Test (Base): 🚫 Run #41270447131
Latest PR Test (Extra): 🚫 Run #41270447119
Latest PR Test (AMD ROCm 10): 🚫 Run #41270447157

@ispobock ispobock added run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) labels Oct 5, 2026
Base automatically changed from hicache-decl-c to main October 6, 2026 02:18
@ispobock ispobock changed the title Add QSA compressed key host pool for HiCache Declare QSA indexer host pool Oct 6, 2026
# Conflicts:
#	python/sglang/srt/mem_cache/hybrid_cache/hybrid_pool_assembler.py
#	python/sglang/srt/mem_cache/pool_host/dsa.py
#	python/sglang/srt/mem_cache/pool_host/host_pool_decl.py
#	test/registered/unit/mem_cache/test_hybrid_pool_assembler.py
#	test/registered/unit/mem_cache/test_qsa_kv_pool.py
@ispobock ispobock changed the title Declare QSA indexer host pool [Refactor] memory-pool: Build QSA indexer host pools from buffer info Oct 31, 2026
@ispobock ispobock added run-ci-nv-extra CI: NVIDIA/shared Extra suite (requires run-ci) run-ci-amd-extra labels Oct 31, 2026
@ispobock

Copy link
Copy Markdown
Collaborator Author

/run-extra-ci nv

@ispobock

Copy link
Copy Markdown
Collaborator Author

/run-extra-ci amd

@ispobock

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/kernels/ops/attention/qsa/test_qsa_hicache.py

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🚀 4-gpu-b200 (1 test): ✅ View workflow run

cd test/ && python3 registered/kernels/ops/attention/qsa/test_qsa_hicache.py

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Re-running PR Test Extra (AMD).

@github-actions

Copy link
Copy Markdown
Contributor

⏳ PR Test Extra is already queued for this commit; left it alone.

@ispobock

ispobock commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/kernels/ops/attention/qsa/test_qsa_hicache.py

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🚀 4-gpu-b200 (1 test): ✅ View workflow run

cd test/ && python3 registered/kernels/ops/attention/qsa/test_qsa_hicache.py

@ispobock
ispobock merged commit ee83f5a into main Nov 1, 2026
134 of 208 checks passed
@ispobock
ispobock deleted the hicache-decl-d branch November 1, 2026 04:20
detain added a commit to detain/sglang that referenced this pull request Nov 11, 2026
…+ re-plant era CLOSED at b86b7c9 (125/125 markers; grep census ZERO verified at this tree): header STACK epoch 321-2026-10-30 -> 329-2026-11-10 (supersession note kept) + +merge6-era-closeout-2026-11-10 trailer line + entries-count 1-329; tip/HEAD re-pinned (era CODE TIP b86b7c9 NAMED with the full wave chain, superseded values dea2641/e9f0ae1838/065fdcdf33/b7c656f69f/5cde7a5ede kept, docs tip recorded as this wave) + a prominent ** LIVE/BOOT STATE ** line (main checkout detached @ 2d87757 = the ONLY boot-validated state, 9b 16:58:52 warm all-needles-hit per prod-health-2026-11-10.txt; era branch CPU-green but NOT BOOTED -- switching prod = operator-chosen checkout + the entry-326 boot-watch). ENTRY 324: imports+bootfix trunk wave -- sgl-project#48781 require_attn_tp_gather->dp_attention relocation invisible to markers, base_runner deletion-only fix unmasking the 145E/32E/31E collection cascade (1dcc2d6); THEN the operator-live crash: maybe_init_router_registration read tokenizer_ipc_name before init_ipc_channels at OUR fork's entry-201 init order, call moved back to upstream's position, RED(2F)/GREEN(2P) test_tokenizer_manager_init_order.py, family scan clean + report-only carry (10a1c08). ENTRY 325: RE-PLANT ERA TABLE b1 12 / b3 18 / b4 39 / b5 17 / b2 23 / b6 16 = 125/125 per-wave dispositions (compressed from the commit bodies, all shas cited) + the NINE ERA CATCHES with FULL CREDIT: _rope_cache_key 10/11-arg universal get_rope crash (15 spec F were its fingerprints), PLE file-backend env registration gap (AttributeError every boot), COW-catcher doubled-staging-arm cascade bug, stat_loggers DI test restored from its corrupted merge hybrid, w13 refined-grid mis-key, the budget-contract decision (fork accounting RESTORED, evidence 106.9GB/100GB = the entry-317 leak shape; INDEXER collective order verified), verify-gate SUBSUME pick (sgl-project#44047 eats sgl-project#42779, both intents preserved), mm_process_config ambient-widths root-cause (validators now state the full 8-way layout), TLFIX twin re-pinned 282/285. ENTRY 326: BATTERY RE-PIN TABLE -- era pins managers 1307P/0F, spec 406P/0F, server_args 496P/0F, sampling 252P/0F, distributed 213P/0F, mem_cache 2965P/24F (the ACCEPTED device-only 24-node list over 8 files), cargo 966P/0F/1-ignored, five registration/wheel gates rc=0 + the PATH-TO-BOOTABLE statement: CPU-proven vs GPU-window debt -- first-boot needles incl. the sampling.cuh-vs-0.7.2 JIT arbitration (if it JIT-fails, wheel-trio-then-pin per S-FI073, never a lone re-pin), autotune caches SHOULD hit warm (no retune owed on 0.7.2), entry-322 verify-at-boot quartet, and the still-riding 321-era watches (sgl-project#45472/sgl-project#46643 TTFT+starvation, first-delta tool-stream latency). ENTRY 327: WHEELS & VENV RECORD -- pairing matrix (FI 0.7.2 HELD, sgl-kernel 0.4.10/0.4.10 era-consistent with the RETIRED-rule cross-ref, torch/cutlass-dsl MATCH), blake3 1.0.11 INSTALLED with ZERO-DRIFT PROOF (0 battery lines vs ~380; matrix re-read unchanged; negative-shim prefix-sim causality) + no-pip/uv-note (operator lane), the two tree-side wheel reverts with reachability + residual-symbol evidence, check_dockerfile_wheel_pins re-green, FI-0.7.3 adoption contract restated with post-era facts (upstream code now expects 0.7.3 in one reported JIT path; tree HELD 0.7.2; first boot arbitrates), dist-name/module-name note sglang_kernel/sgl_kernel. ENTRY 328: INCIDENT RECORD 2026-11-10 ~16:4x-16:58, honest narrative -- re-plant waves landed into the EDITABLE-IMPORT working tree while :30000/:30001 ran; 9b died ~pre-16:50 (cause UNVERIFIABLE from the user acct, /root logs unreadable; worker-respawn-importing-changed-code is the LEADING MECHANISM, stated AS SUCH); the operator restart hit the init-order crash = the era's flagship find; recovery = merge6-era-backup @ b069e6a + detached checkout 2d87757, 9b re-booted WARM 16:58:52 all needles hit, 9d NEVER dropped (Nov 3, HTTP 200); NEW ERA LAW: working tree = prod import path, integration by branch ref-move ONLY; b2's emergency-freeze WIP 7ccf76a (author 16:55:02) kept in range and completed as C1 -- provenance note. ENTRY 329: BACKFILL AUDIT RECORD -- window 2026-08-10..2026-10-27, universe 2714 = 1830 in-tree / 255 already-documented / 628 NEW REJECTS / 1 NEW-INTERESTING; method one-liners; the qwen4-main-squashed side-branch class discovery (REJECT-MERGED-TO-SIDE-BRANCH x44 -- future sweeps MUST filter by base; orchestrator's "206" NOT FOUND in the artifacts, 44 recorded as verified); sgl-project#36043 NVFP4 skinny GEMM SM120 full paragraph (closed-unmerged, absent-tree-verified, W4A4 M<=16 = our exact decode cell, BENCHMARK-BEFORE-PORT -> S-36043-BENCH filed); artifact paths. EVALUATED: the 671-line DOCS-BLOCK.txt inserted VERBATIM as its own dated block (165 dropped list-commas tidied at insertion, noted once at the block head; nothing else reflowed). DATED CORRECTIONS where the waves superseded 322/323-era operational text: the header PROD-BOOT-FORBIDDEN bullet and entry 323's WHEEL DRIFT + STATE lines get [11-10 ERA-CLOSE CORRECTION] annotations (classes closed, wheel landed, ban now purely the operator gate); marker-zone math re-verified against the wave ledgers (121-at-merge vs 125 recount stands correct; planted == consumed per zone). WATCH LIST: era-close block appended (sgl-project#36043 bench-gated; sgl-project#42790/sgl-project#40916 arrived-via-merge6 noted; sgl-project#43703 revert-trap cross-ref from entry 323; sgl-project#45520 STILL-OPEN re-confirmed at era close -- zero in-window refs, b5 verified the fail-safe layer intact; bootfix's report-only get_tokenizer_worker_class/entrypoints wiring carry). Docs-only: NO .py touched; check_registered_tests rc=0 re-run against this tree. NOTHING PUSHED; the live tree was NOT touched by this wave (ref-move integration follows with HEAD/status equality proofs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) hicache Hierarchical Caching for SGLang run-ci CI: run the baseline test suite on this PR run-ci-amd-extra run-ci-extra CI: also run the extra suite (requires run-ci) run-ci-nv-extra CI: NVIDIA/shared Extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant