Skip to content

[CI] merge all ci tests into one file - #1289

Merged
merrymercy merged 5 commits into
mainfrom
ci-test
Sep 1, 2024
Merged

merrymercy merged 5 commits into
mainfrom
ci-test

Conversation

@merrymercy

Copy link
Copy Markdown
Collaborator

merge them into one file, so a failed test can quickly cancel all other jobs

Comment thread .github/workflows/lint.yml Resolved
@zhyncs

zhyncs commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

@merrymercy
merrymercy merged commit 761b2ce into main Sep 1, 2024
@merrymercy
merrymercy deleted the ci-test branch September 1, 2024 09:36
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 9, 2026
…terminal; sample r_D on concurrency

The two gates boot weg2sb5g (`80de2d31d1`, 07:06-07:27Z) failed. Both are on
the sgl-project#1289/sgl-project#1290 line and both are mine. The five that passed are recorded in
the boot record; sgl-project#1288's loopback trust (0 x 401), sgl-project#1290's route bases (53
LONG) and sgl-project#1289's flip_s sampler (`flip_s source=live n=1,2`) all held.

======================================================================
GATE 4 -- LEG 2 IS STILL A W50 CANDIDATE, AND THE REQUEUE LOOPS TO 503
======================================================================

53 LONG routes, **3 served** (natural 1/27, salad 2/26), 50 x 503 after 32-64
s. `W50_Weg2TpPrefillExceeded` 104, `W50_requeue` 54, `W35_Weg2XReQueueLoop`
50, and the sgl-project#1290 one-shot refusal was never reached: **0 anchored 413, 0
W52**. (Method note carried from the boot agent: a bare `grep 413` returns 11
hits on the front log, every one a digit coincidence inside
`queued_uncached=41356`; anchored on the HTTP status the count is 0 and the
driver's own census agrees, `{200: 3, 503: 50}`.)

ROOT, from D's own log, per request:

    W50 Weg2TpPrefillExceeded rid=a977bd8d87154067913632f1b8a81f09
        uncached=24657 X=8742
    PHASE-PURITY STORE WITNESS OBSERVATION (n=22) rid=a977bd8d...
        phase=None pp_rank=0 state=unprobed stamp

`uncached=24657` is the WHOLE prompt -- D priced it as if P had never run --
and the witness says the store was never probed for that rid. `WEG2 X-DEFER`,
the completion predicate that exists precisely to hold a request whose store
read is still in flight (`scheduler.py::_weg2_x_defers`), fired **ZERO** times
in the entire boot, so there was no pending read to wait for: the abstain
branch (`pending_ms is None` -> never defer) took every request. D's census:
X-GATE `verdict=W31` 312 / `admit` 84, `replicated_term=group` 396/396; store
witness `cold` 99 / `hit` 18 / `unprobed` 75.

So the P prefill's result never reached D -- and the front's answer was to run
the SAME P prefill again. The bet the requeue exists to place had already been
placed and lost on this exact request.

THE FIX IS THE RULE: **a completed P leg 1 makes the next W50 terminal.**
`_requeue_after_x_refusal` now refuses by name (W53 Weg2StoreHandbackFailed)
with HTTP 413 and the numbers, before any requeue bookkeeping. W53 is
deliberately NOT W52: W52 is "no route can serve this" (a sizing fact known at
admission), W53 is "the route ran and its result did not reach the group that
needed it" (a store/carrier fault found afterwards). Different faults, different
repairs, different names. W53 is free -- the used set is W50/W51/W52,
enumerated before choosing. The refusal names the evidence to collect next
(D's STORE WITNESS state for the rid, `unprobed` = no read was ever issued),
so the next boot does not re-derive this.

SECOND FINDING, STATED AND DELIBERATELY NOT FIXED HERE. `sgl-project#1236 Store >=
P-Pool` is violated on this form: P's pool is 304,655 tokens and its per-token
KV across the three PP ranks is 22528 + 4096 + 6144 = 32,768 B, so a full pool
is **9.30 GiB** against a store configured
`{"max_size":"5G","min_free_space":"1G"}` -- ~4 GiB usable. WHICH REPAIR: size
it, not refuse. A hard launch refusal would block every boot on this rig for a
fault that only bites the LONG route, which W53 now terminates honestly in one
shot instead of 32-64 s; and the arithmetic says sizing is not the proven
cause of THIS rid's `unprobed` anyway (one 24,657-token prompt is 771 MiB and
fits four times over). It is a real second fault at this arm's concurrency.
Sizing lives in `launcher.py`, which this branch does not touch and cannot
test on metal in this window, so it goes to that owner with the arithmetic
pinned in `TheSb5gArithmetic` rather than half-done here.

======================================================================
GATE 5 -- r_d IS NEVER SAMPLED, SO X CAN NEVER RE-SOLVE
======================================================================

`WEG2 X RE-SOLVE` 0 across 64 flips -- and sgl-project#1289's own instrument named the
starved term, which was the point of that ticket:

    WEG2 X NO-SOLVE: no r_d sample yet, so X stays at the carried-in 8742
      (flip_s source=live n=2; have r_d=0 r_p=1 flip_s=2)

ROOT, `front.py::leg2`:

    if verdict in ("single_prefill", "short_mispriced") and _unc > 0 and _w > 0:
        self.note_x_sample("r_d", _unc / _w)

Both admitted verdicts are EXCEPTIONAL -- `single_prefill` is route
CARRIER-EXCEEDS, `short_mispriced` is a SHORT the front UNDER-priced. The
ordinary well-priced SHORT returns `serve` (`_leg2_verdict`), and `serve` was
excluded. sb5g's front-log census: `verdict=serve` 24, `verdict=short` 20, and
ZERO of either admitted verdict against 84 admitted D prefills. The gate was
also incoherent: `short_mispriced` is a seated SHORT at exactly the same
concurrency as `serve`, so it admitted and excluded the same physical
situation depending only on how the front had priced it.

r_D is D's PREFILL rate -- tokens over the wall of a prefill D ran ALONE -- so
the qualifying property is CONCURRENCY. It is now measured directly and
EXACTLY: `_d_admissions` (every arrival at D) not moving across the window
rules out an arrival that came and went inside it, which two
`len(outstanding)` snapshots cannot. A rejected sample increments
`r_d_skipped_concurrent`, so an empty deque can be told from an emitter that
never ran -- the denominator law.

AND THE SAMPLE THAT COMPLETES THE TRIPLE NOW RESOLVES IMMEDIATELY. Without
that, an `r_d` arriving last (exactly sb5g's order) would wait for the next
flip or the eighth drain, so the term that was missing all boot buys nothing
on the pass that finally supplies it.

PROVENANCE: `r_d source=live|none n= src=` joins `flip_s source=` on all three
X decision lines and in `/weg2/state`. One word ("no r_d sample yet") located
this defect; r_D now carries the same.

TESTS, red-first by name: `test_weg2_handback_rd_1291.py`,
`ACompletedLegOneMakesTheRefusalTerminal::test_red_first_the_requeue_
terminates_after_a_completed_leg_one` and
`RdIsSampledOnConcurrencyNotOnAVerdict::test_red_first_the_ordinary_serve_
verdict_is_no_longer_excluded`. The sb5g numbers are the fixture.

MUTANTS, four on gate 4's danger direction (OVER-refusing, since this fix
adds a terminal verdict):
(1) a request with no leg 1 still gets its one requeue -- the bet has not been
    placed for a SHORT or CARRIER-EXCEEDS arrival and the re-offer is correct;
(2) `pending is not None` alone is NOT the condition: a CARRIER-EXCEEDS
    arrival carries a Pending with `skip_leg1=True` and `leg1_done` False, and
    gating on the Pending's presence would refuse it wrongly;
(3) the W52 estimate rule (sgl-project#1290 round 2) is not swallowed by W53;
(4) the terminal check must precede both the X-REQUEUE line and the W35
    branch, or the counters record a lap that never happened.
Three on gate 5's danger direction (admitting a CONCURRENT wall, i.e.
re-introducing sgl-project#1271 (a)'s latency-as-rate):
(5) a concurrent leg 2 is still refused AND counted;
(6) a snapshot-only witness is unsound -- the admissions counter must be in
    the conjunction;
(7) a zero/negative sample is still ignored.
Plus `test_the_counter_is_initialised_in_the_constructor`, because a
hand-built Front in a test is not proof that the real one has the field.

METAL PROOF OWED (UNPROVEN): `W53` > 0 with 413s replacing the 503 loop and
`W35_Weg2XReQueueLoop` = 0; `r_d source=live n>=1` by the second flip and
`WEG2 X RE-SOLVE` > 0; served fraction on the LONG arm above 3/53.

Author: efschu
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