Skip to content

Improve the structure of CI - #911

Merged
Ying1123 merged 9 commits into
mainfrom
improve-ci
Aug 4, 2024
Merged

Ying1123 merged 9 commits into
mainfrom
improve-ci

Conversation

@Ying1123

@Ying1123 Ying1123 commented Aug 4, 2024 •

Copy link
Copy Markdown
Contributor
  • Add a new file run_suite.py to run many test_*.py in a single command, so we do not need to update .github/workflows/unit-test.yml every time to add a new test.
  • Move deprecated folder out of the test folder
  • Port two more evals from openai/simple-eval: math and gpqa

@min-xu-et

Copy link
Copy Markdown
Contributor

maybe add a readme.md under test dir to tell people how to run tests on their local machines?

@Ying1123

Ying1123 commented Aug 4, 2024

Copy link
Copy Markdown
Contributor Author

Great suggestion! I removed the deprecated test_process.md and added a new file here to list the test instructions.
image

@Ying1123
Ying1123 merged commit 995af5a into main Aug 4, 2024
@Ying1123
Ying1123 deleted the improve-ci branch August 4, 2024 06:09
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
chx96642264 pushed a commit to chx96642264/sglang that referenced this pull request Jul 2, 2026
Simplify VL thinking accuracy tests, update DeepSeek V3.2 dataset to gsm8k, lower kimi-k2.6 throughput threshold
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 26, 2026
…st-pool double free routed through binding_generation) into the flip train
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 27, 2026
… candidate set that could not see it

THE STRUCTURAL FACT, and it explains two defects at once. `scheduler.py` built
the #943b re-issue's candidate set as `{r.rid: r for r in self.waiting_queue}`.
A chunked continuation is never in the waiting queue: #797b deliberately
RESTORES it as `self.chunked_req`, because that state outlives the round and
putting it back is what stopped boot instr19 dying on `extend_range.end`. So

  * the re-issue could not nominate the request that was stuck -- measured
    `PREFETCH RE-ISSUED` 0 across six boots -- and
  * that request never re-entered through the waiting-queue path where the
    sgl-project#630/sgl-project#944 clamp applies, which is why the offer froze at `told=8192` for
    thousands of passes.

ONE cause, both symptoms, and the FOURTH instance of the compensator
reachability class -- found at the desk by the #944c ratchet rather than on a
boot, which is what that ratchet was built for.

REACHABILITY ARM FIRST, red before any fix code: the candidate set must contain
a chunked continuation. `pp_request_locations` now returns the four places a
request can live -- waiting queue, `chunked_req`, the named slot's chunked req,
running batch -- the SAME enumeration sgl-project#944 walks for the reconcile lookup.
Sharing the list is the point: a fifth place must not be discovered once per
consumer, which is exactly how #797c/sgl-project#798/sgl-project#944 became three tickets for one
class. Every lookup is a getattr, and that is load-bearing rather than
defensive here: this mapping feeds `take_agreed_reissue`, a COLLECTIVE, and a
rank that raised while building candidates would skip an all_reduce its peers
had already entered.

DECIDE AT THE VOID, ACT AT THE CHUNK BOUNDARY. The void is where the group
already agrees, but it fires after the pass was committed and launched --
replanning there rewrites a pass in flight (instr20). `scheduler.py`'s
`add_chunked_req` call site is the one legal point: `add_chunked_req` derives
everything from `len(req.prefix_indices)` and only THEN calls
`set_extend_range`, so nothing about the next chunk is committed and changing
the premise cannot contradict a report that has not been made. sgl-project#906/sgl-project#890 hole 2
already gates that exact site and its own comment establishes the safety.

THE MARK IS STAMPED WITH THE BINDING GENERATION (operator decision). It rides
on the REQUEST, because the rank that must act is not always the rank that saw
the void and #797b restores the same object. Stamped, it survives the chunked
restore (same generation -- the purpose) and invalidates ITSELF on a retract or
cutover (the generation moves, the reader sees it as absent). No
`reset_for_retract` special case and no cleanup path that can be forgotten --
the rule sgl-project#911 already uses for completion routing. `current_generation()` /
`write_back_stamp_is_current()` are module-level in `hicache_phase_binding` and
available at both ends, which was the operator's stated precondition.

RE-FETCH IS PREFERRED, AND IT IS A LAW. `told=0` on the measured rid discards
8192 tokens -- two full `--chunked-prefill-size 4096` chunks -- against a
standing user law that allows at most ONE chunk of loss. The store still holds
the pages, so the escape re-fetches under the current generation and KEEPS the
premise; `told=0` is the bounded last resort for when no fetch can be issued,
and it logs the number of tokens it throws away. A law breach may be necessary;
it may never be silent. The mark is consumed on either branch so the escape
cannot re-fire every chunk.

FOUR FALSIFIER ARMS, all on the real path:
  1 reachability -- the candidate set contains a chunked continuation (red first)
  2 stamping     -- live within a generation, absent once it moves
  3 the law      -- re-fetch preferred, keeps the prefix; `told=0` names its discard
  4 uniformity   -- THREE REAL GLOO PROCESSES, each stamping and reading its own
                    request, before and after the generation moves; a
                    single-process test cannot tell "the generation is global"
                    from "I just wrote this object"

TESTS, per file, each module alone in a fresh process, against the 70bbd98
baseline: 791-congruence 11/11, 630 5/5, 791-wiring 3/3, 798 12/12, 797 31/31,
944-unit 30, 944-gloo 6 (5 + the uniformity arm), 946 11 (new). 109 passed,
0 failed. ruff (F401,F821,UP037), ruff format clean on the touched files;
codespell unchanged from HEAD (2 pre-existing hits in scheduler.py, neither
mine).
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 27, 2026
…store instead, by content key

WINDOW-946RF-0828 PROVED THE ROOT RATHER THAN SUGGESTING IT: reason=anchor_no_vote
5 of 5, and "[sgl-project#915 prefetch-gate] no observation" confirming from the other side
that the gate was never reached at all. The escape's precondition was

    locally_eligible = last_host_node.backuped or last_host_node is root_node

and `backuped` means "the full KV is ALREADY in THIS rank's host pool" -- local
residency demanded as the entry price for an operation whose whole purpose is to
obtain what is NOT resident. THE PRECONDITION IS ANTI-CORRELATED WITH THE
SITUATION THE ESCAPE EXISTS FOR. Five instances in this family were compensators
in the wrong PLACE; this is the first that was in the right place asking the
wrong QUESTION.

THE REPLACEMENT: presence by CONTENT KEY. `HiCacheController.store_presence_pages`
computes the page-hash chain with the SAME helper the real fetch uses
(`get_hash_str` -> `batch_exists`, the `_storage_hit_query` path) and asks the
backend once. A second spelling of a key chain would be a second installer of the
same payload -- the rule #949b was just fixed under, one layer up.

WHY THIS IS MORE THAN A BUG FIX. Under sgl-project#706 the store is geometry-neutral: a page
carries all attention layers for its tokens and the cut happens at READ time, so
the key is a function of CONTENT, not of any rank's layout or residency. A
content-key fetch therefore lands in the CURRENT layout and sidesteps the
layer-sharded seam problem of sgl-project#941 entirely -- the practical route to cached>0
after a flip, host store instead of device seam carry.

ONE GATE BLOCKED TWO COMPENSATORS. sgl-project#939/#943b's re-issue already had its
reachability half fixed (sgl-project#946 widened the candidate set to pp_request_locations,
scheduler.py:8354) and it still never fired, because the chosen rid is re-issued
through this same `_prefetch_kvcache` and died at this same anchor. That is why
PREFETCH RE-ISSUED read 0 for seven boots AFTER its candidate set was corrected.
One fix serves both.

COVERAGE CHECKS BEFORE BUILDING, two of which changed the design:
 * sgl-project#937/sgl-project#911 generation routing already sits on the insert path
   (unified_radix_cache.py:3192-3198), so this adds NO second completion path --
   the fetch completes through the ordinary route and inherits the refusal.
 * sgl-project#915's gate is TRAVERSED, not bypassed: only the ANCHOR term changes, so
   too_short and rate_limited can still speak. That keeps the capacity-asymmetry
   candidate measurable instead of assumed away.
 * sgl-project#706 IS landed (six production importers; --phase-flip-canonical-kv-page in
   the boot), contrary to a stale "when it lands" comment in disk_tier_control.py
   that would have had this design built on a false absence.
 * sgl-project#941's kv_reshard seam route is PRICED in the ticket as the alternative and
   deliberately not built -- it answers a different question.

GROUP UNIFORMITY: `prefetch_from_storage` is a collective under `symmetric`
(sgl-project#580), so the rank-local presence answer enters the EXISTING vote as
`locally_eligible`. Never a new early return, never a new collective -- a
rank-local answer that skipped the vote is the sgl-project#580 desync itself.

COST, bounded by construction: the whole key chain goes in ONE batch_exists, the
verdict is cached on the request per streak increment, and an anchored request
short-circuits before any probe -- so the default admission path pays nothing.

TESTS: 5 arms RED FIRST, all four failing with the metal reason
`declined:anchor_no_vote` verbatim before the fix. Delivery proven by the EFFECT
(rid in ongoing_prefetch), never by a return value. Counter-arm: an empty store
declines with `declined:store_absent` and never enters the fetch. Can-fail proven
by mutation. `anchor_no_vote` survives for tree caches with no controller to ask,
because calling that "store_absent" would claim a check never made.

Blast radius 44 modules, each alone in a fresh process, identical script both
sides vs 3303289: BEFORE 1167 passed / 9 failed, AFTER 1172 / 9. Exactly ONE
module differs (946: 42 -> 47). The 9 failures are pre-existing and identical
both sides (580: 7, 610: 2). Extraction count probe 9 == 9.

ruff (F401,F821,UP037) clean. cache_controller.py is NOT ruff-format-clean at
HEAD, so it was NOT formatted wholesale -- the diff is 61 insertions and ZERO
deletions; a wholesale run had touched two unrelated asserts and was reverted.
The two codespell hits in scheduler.py are pre-existing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants