Skip to content

[Minor] Improve logging and rename the health check endpoint name - #1180

Merged
merrymercy merged 2 commits into
mainfrom
improve-style
Aug 22, 2024
Merged

merrymercy merged 2 commits into
mainfrom
improve-style

Conversation

@merrymercy

@merrymercy merrymercy commented Aug 22, 2024 •

Copy link
Copy Markdown
Collaborator
  • Log the whole request instead of input text only
  • Rename /v1/health to /health_generate for the health check in support /v1/health using a generation 1 token #1154. The endpoint name "/v1" are for openai APIs so we do not want to use it for SRT endpoints.
  • Other minor style improvement

@merrymercy merrymercy changed the title [Minor] Improve logging and code style [Minor] Improve logging and rename the health check endpoint name Aug 22, 2024
@merrymercy
merrymercy merged commit 5623826 into main Aug 22, 2024
@merrymercy
merrymercy deleted the improve-style branch August 22, 2024 02:24
@Xu-Chen

Xu-Chen commented Sep 12, 2024

Copy link
Copy Markdown
Contributor

We found that when cuda-graph is turned on, the service will hunag after more than 200 consecutive /health_generate requests (1 req/s ). set --disable-cuda-graph can help solve this problem. Can be reproduced in 0.3.0 with 4* A100.

@zhyncs

zhyncs commented Sep 12, 2024

Copy link
Copy Markdown
Contributor

May u try the latest main? Thanks!

@Xu-Chen

Xu-Chen commented Sep 12, 2024 •

Copy link
Copy Markdown
Contributor

May u try the latest main? Thanks!

Can be reproduced in the latest main with 4* A100.

curl: (28) Operation timed out after 60001 milliseconds with 0 bytes received
done 378

Test code

#!/bin/bash
i=0
while true
do
	curl -m 60 "http://127.0.0.1:8080/health_generate"
	i=$((i+1))
	echo "done $i"
done

error log

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/models/sglang/python/sglang/srt/managers/tokenizer_manager.py", line 448, in _wait_for_response
    await asyncio.wait_for(state.event.wait(), timeout=4)
  File "/opt/conda/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/models/sglang/python/sglang/srt/server.py", line 119, in health_generate
    async for _ in tokenizer_manager.generate_request(gri, request):
  File "/data/models/sglang/python/sglang/srt/managers/tokenizer_manager.py", line 157, in generate_request
    async for response in self._handle_single_request(obj, request):
  File "/data/models/sglang/python/sglang/srt/managers/tokenizer_manager.py", line 284, in _handle_single_request
    async for response in self._wait_for_response(state, obj, rid, request):
  File "/data/models/sglang/python/sglang/srt/managers/tokenizer_manager.py", line 453, in _wait_for_response
    raise ValueError(f"Abort request {rid}")
ValueError: Abort request e077560737d94a788c6a8670c98bf3e8

@Xu-Chen

Xu-Chen commented Sep 19, 2024

Copy link
Copy Markdown
Contributor

May u try the latest main? Thanks!

Any ideas on this issue?

efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 4, 2026
…it in a named stop

BOOT weg1b7 (03:49:20 -> 03:50:24Z) died in a circular PP ring wait: PP0
parked in recv_object[src=2], PP1 tore at the 60 s chain-stall bound, both
downstream ranks ran their two ring-cut drain turns and the group died.

ROOT (built against, and it is NOT the ring cut). The sgl-project#631 row probe peeks
the head proxy frame's admission row and, when the row names a rid this rank
cannot locate, answers False and leaves the frame in the inbox. That
protection is right (boot 631row14: a frame consumed before its request hop
plans nothing and the ring dies upstream-waiting) and is untouched here.
What it lacked is a BOUND, and the defer is not free: PP0 has ALREADY
launched the pass the frame belongs to and is ALREADY parked on its output,
so an unbounded defer closes the ring BY CONSTRUCTION.

The defer's own premise -- "an unlocatable rid PROVES a chain send is in
flight, bounded by rendezvous+transfer" -- is false for both populations
measured in weg1b7:

  * a rid PP0 RETRACTED after sealing the row. PP0 shipped sgl-project#631 PROXY-SEND
    t40 naming 772368da and c25108f3, then the discretionary #888b parked-
    carrier relief retracted c25108f3 in the NEXT scheduling iteration
    (#969AD RETRACT site=_retract_decode_and_requeue fwd_ct=157). A sealed
    row cannot be amended, so _missing can never empty.
  * a re-admitted resident (sgl-project#968 READMIT CACHED, last_queued_as=cutover-
    requeue) requeued rank-locally by _add_request_to_queue -- no chain hop
    for it exists or ever will.

Ranks disagreeing about a rid is RAENGE-NIE-UNEINS, and the sanctioned
answer there is a bounded, NAMED stop -- never a silent unbounded wait.
sgl-project#1071's occupant horizon is the precedent this follows, down to "0 disables".

CHANGE
  python/sglang/srt/managers/pp_row_defer_horizon.py  (new, 300 lines)
      RowDeferHorizon: per-slot clock over the (frame stamp, missing-rid set)
      identity. First sighting defers. A CHANGED missing set is a hop landing
      and restarts the clock -- the boot 631row15 world (43k hot defers on a
      TURNING ring) therefore never reaches the bound. A DIFFERENT frame also
      restarts it, so a slot whose head alternates cannot inherit a
      predecessor's age. Only the same frame with the same missing set, held
      past SGLANG_PP_ROW_DEFER_HORIZON_S (default 20 s), answers defer=False
      with a message naming slot, wait, occurrences, rids, BOTH measured
      shapes, what is deliberately not repaired, and the remedy knob.
      PURE: no logger, no wire, no scheduler attribute -- the caller owns the
      raise, as parked_carrier_relief and min_free_slots_delayer are built.
      20 s is chosen against three measured neighbours: orders of magnitude
      above the healthy case (weg1b7's three defers of one frame land in the
      same log second), BELOW the 60 s chain stall bound so THIS names the
      contradiction before the ring cut misreports it as "closed ring on the
      request chain", and BELOW the 90 s sgl-project#1071 horizon.

  scheduler_pp_mixin.py:9184-9243   the defer consults the horizon and raises
      PpRowDeferHorizonLapsed past the bound. It does NOT consume the frame
      (that revives boot 631row14) and does NOT emit a void (that revives the
      sgl-project#801 reverse corpse). The DEFER log line now carries held=%.1fs.
  scheduler_pp_mixin.py:9266-9271   a satisfied or unreadable row clears the
      slot's clock, so a resolved wait cannot age a later one into the bound.
  scheduler_pp_mixin.py:8912-8941   _pp_row_chain_pending's docstring
      corrected: its _pp_row_chain_owed arm returns True on an INFERENCE, not
      on proof of availability, and the receive it opens is bounded by this
      horizon rather than by transfer time. Do not read that True as uniform
      evidence of a posted message.

EVIDENCE
  RED FIRST on parent 2615514 (scratch worktree /spinning/wt-1180-red,
  only the new test file copied in): 12 failed / 2 passed. Two of the reds
  are BEHAVIOURAL, not import errors --
    test_the_defer_is_not_unbounded: "the row probe deferred the same
      unsatisfiable row 4096 times over an hour of its own clock without ever
      stopping" (imports nothing new, on purpose);
    test_a_satisfied_row_clears_the_clock_its_own_defer_armed: "the defer
      must have armed a clock".
  FIXED: 14 passed / 0 failed.

  MUTANTS 6/6 died, each patch verified applied:
    M1 never raise (fix inert)                                    DIED
    M2 bound never lapses                                         DIED
    M3 a changed missing set does not restart the clock           DIED
    M4 satisfied row leaves its clock behind                      DIED
    M5 no frame token in the identity                             DIED
    M6 DANGER DIRECTION: stop on the FIRST defer                  DIED
  M4 survived the first round -- the locatable-row test was vacuous (no
  horizon object existed to inspect). The recovery test above was added to
  make the clear observable, and M4 then died.

  ruff parity: 3 pre-existing errors on the parent, the same 3 after
  (F841 carries_flip_arm, E741 l x2). Import smoke hermetic (CVD="").

  SUITE ONCE, both trees, same command, sequentially (crowding-free box,
  load ~2.9), test/registered/unit/managers with the five pre-existing
  collection-error modules ignored (the same five on both trees: the sgl-project#1044
  import-broken *_631 quartet plus test_quiescence_no_carry_858):
    parent 2615514 : 240 failed / 4767 passed / 2 skipped / 638 subtests
    fixed             : 240 failed / 4781 passed / 2 skipped / 638 subtests
  Delta = +14 passed, exactly the new file; the FAILED NAME SETS are byte
  identical (diff empty, 236 names each side). Counting probe declared
  honestly: 236 extracted names vs the summary's 240 on BOTH trees -- a
  symmetric extraction gap of 4 that is not investigated here and cannot
  affect the A/B, since both sides carry the same 236 names and the same
  summary.

RESIDUALS, deliberately NOT fixed here
  * The stop is RANK-LOCAL, exactly like sgl-project#1071's: the deferring rank raises,
    the others then die on their own collectives or the deadman. A
    group-uniform stop would need a collective on the wedged path, which is
    what the ring cut already refuses.
  * #888b's discretionary yield is untouched. Making it protect published
    rids is refused: the entry decision and the victim count must be
    rank-uniform (the sgl-project#583 precondition stated in _maybe_yield_parked_carrier
    itself), and only PP0 builds rows, so a PP0-only term would make ranks
    pop different numbers of victims -- a silent rank divergence traded for
    this deadlock.
  * The ring cut's arc asymmetry (pp_flip_drain_leftover_dicts receives only
    from the draining rank's own upstream, scheduler_pp_mixin.py:6796) is left
    as it is: it is fork-own compensation, and under upstream-minimal a defect
    inside a compensation layer is a deletion candidate, not a repair order --
    and widening it could not clear PP1's _missing anyway.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 4, 2026
…ll-clock seconds

Review round 1 blocked the horizon build on reachability: a wall-clock
horizon's lapse was unreachable on the weg1b7 specimen, so the guard could
not have fired on the boot it was built for. The bound is now counted in
ring laps, which is the quantity the deadlock is actually made of.

The premise the defer rests on is named in the module and is FALSE for two
populations measured in weg1b7:

  * a re-admitted resident (sgl-project#968 READMIT CACHED, last_queued_as=
    cutover-requeue) is requeued rank-locally -- no chain hop exists to
    wait for;
  * a retracted-after-sealing rid (the #888b parked-carrier relief runs
    after the admission row was sealed) names a rid that will never arrive.

Both make "an unlocatable rid PROVES a chain send is in flight" untrue, and
a frame deferred for ever closes the ring by construction: PP0 has already
launched the pass and is already parked in the receive for its output.

pp_row_defer_horizon.py -> pp_row_defer_cap.py (the name now says what it
counts). The sgl-project#631 row-probe protection itself is unchanged and unweakened;
this only gives it an end.

EVIDENCE

Red-first (falsifiers copied onto parent 8f45927, scratch worktree):
  17 failed / 3 passed of the 20 pins in
  test/registered/unit/managers/test_pp_row_defer_cap_1180.py.
  Green on this tree: 20 passed.

Mutants: 8/8 died (harness /spinning/wt-1180-mut/run_mutants.py, every
  patch byte-verified as applied before its run). They cover both danger
  directions: M6 turns the documented `0 disables` escape into an instant
  killer, M8 stops the group on the ordinary first-sighting hedge. M3 (fork
  the cap into a local literal) was the mutant that exposed a vacuous test
  and forced the AST pin described under B3. One further mutant was DELETED
  rather than reported as a survivor: it edited a docstring sentence only,
  which no behavioural suite can distinguish, so it tested the harness, not
  the coverage. Its behavioural twin M4b dies.

Suites, once, both trees, same five ignores (sgl-project#1044 import-broken modules:
  test_phase_flip_spec_seam_631, test_quiescence_no_carry_858,
  test_phase_flip_decode_relay_631, test_phase_flip_draft_bootstrap_631,
  test_pp_proxy_stamp_631 -- ImportError x4 + AttributeError
  pp_flip_drain_tensor_dicts, identical on both trees):

  parent 8f45927 : 264 failed, 4761 passed, 18 skipped, 5 errors (890s)
  this tree         : 247 failed, 4764 passed, 18 skipped, 0 errors (938s)

  The whole difference is accounted for, by name, not by tally:
  - FAILED/ERROR name sets diffed. Names appearing ONLY on the fixed tree:
    ZERO. This change introduces no new failure.
  - The 17 fewer failures are exactly the 17 red-first falsifiers above.
  - The 5 errors are the collection errors of the five ignored modules; the
    parent scratch worktree collected them, this tree does not.
  - Collected node-ID sets diffed (collect-only, both trees): 5039 vs 5025.
    The 14 collected only on the parent are the entire retired
    test_pp_row_defer_horizon_1180.py -- the file this commit RENAMES. Each
    of its 14 names has a 1:1 successor among the 20; six pins are new.
    No behaviour lost coverage.

  One retired name is a deliberate SEMANTIC INVERSION, not a rename:
  test_the_bound_is_exclusive_at_its_own_value became
  test_the_cap_is_inclusive_at_its_own_value. This is B3 doing its work:
  pp_admission_congruence.py:1036 escalates only after "more than
  UNRESOLVED_DEFER_CAP consecutive passes", i.e. CAP passes are permitted
  and the stop falls on CAP+1 -- inclusive. `occurrence <= bound` matches
  the admission layer; the horizon's exclusive reading did not. Adopting
  the shared object without adopting its arithmetic would have been a
  second accounting wearing the first one's name.

ruff: parity. The same 3 pre-existing errors on both trees; none in the
  files this commit touches.

Not run: no boot, no GPU. This is desk work only.

FINDINGS CONFIRMED AND CONSCIOUSLY LEFT

B4 (the stop is rank-local; a defer taken by one rank alone is itself a
  divergence) CONFIRMED VERBATIM, NOT FIXED. The text is not a review
  opinion, it is the admission layer's own docstring at
  pp_admission_congruence.py:443-446: "ON THE WIRE because the rank that
  OBSERVES the miss is never the rank that can ACT on it: only PP0 chooses
  `told`. Downstream ranks report; PP0 owns the count and the escalation
  (`UNRESOLVED_DEFER_CAP`). A defer that only one rank takes IS the next
  divergence, so no rank takes one alone."

  This cap is rank-local and therefore stands in real tension with that
  rule. Left deliberately, for a reason that is itself the RAENGE-NIE-UNEINS
  law: the remedy for a rank-local decision is to put it on the wire, and
  the wire here is inside the region this stop exists to protect. Adding a
  collective to the row-probe path would give the deadlock a new place to
  live -- the failure this ticket is closing. The honest shape is: the cap
  raises, it does not compensate; every rank on the same unresolvable
  identity reaches the same bound at the same lap, so the stop is expected
  to be group-wide in practice, but that is an ARGUMENT, not a measurement.
  Making it a group fact is sgl-project#968's PP0-authoritative rebuild, not this fix.

B5 (a wall-clock horizon can lapse from scheduling noise alone) DISSOLVED BY
  CONSTRUCTION rather than fixed: the unit is now ring laps, the identity
  restarts on a new frame stamp, there is no wall clock anywhere in
  pp_row_defer_cap.py, and the zero-call-site clear_all() of the horizon
  module is gone (grep count 0). A finding about a clock cannot survive the
  removal of the clock.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 28, 2026
…roup P execute its row -- counters + sgl-project#1180 chain receiver re-built, carrier split per PP0 term, told stays armed

WHY IT WAS OFF. fb3631c (sgl-project#1233 S0, 07.09.) un-wove the phase flip and pinned pp_flip_counters /
pp_chain_receiver to None, the value they had with the flip flag off ("Every value this commit pins
is the value the expression already produced with the flag off") -- not a crash, leak or crawl
finding. On group P the followers since plan from their own pool (rc12o P log 1807/1811 "sgl-project#631 ROW
AUTHORITY DISABLED"): the class W27, sgl-project#1004, TF and SF closed term by term. 5c97a22 (sgl-project#973) then
disabled the PP0 carrier terms on purpose (sgl-project#973 RING COMMIT TIMEOUT: PP0 withheld, followers
admitted). What re-arming must address, read off the code: (a) the frame probe
_pp_proxy_frame_pending needs the counters, and the loop's pacemaker _pp_row_chain_pending needs the
chain receiver too -- without it the follower blocks in the chain recv each iteration, visits slot k
before frame k exists and falls a slot behind (631row5 crawl class); (b) pp_row_carrier_present=True
would DISARM the told carrier P runs on (weg2_store_told.armed) and re-arm every PP0 term at once.

weg2/p_row_authority.py (SGLANG_WEG2_P_ROW_AUTHORITY, DEFAULT OFF by operator order -- activated per
profile / --env-p in the proof boot; off = both stay None, every image byte for byte):
  * init_request_receiver: PhaseFlipCounters (all PP ranks, attn rank 0, swept at boot) BEFORE the
    PpChainReceiver (followers; consumed count published through the counters) -- the flip-era
    builders minus the flip gate -- and the receiver is handed to SchedulerRequestReceiver;
  * the chain receive is bounded: SGLANG_WEG2_P_ROW_CHAIN_STALL_S (default 120 s; 0 or unset -> 120,
    never unbounded); expiry raises the named PpChainRecvStalled (no stall service wired: a stop, not
    a local decision);
  * START CHECK: switch on on a PP group but counters (any rank) or the receiver (a follower) missing
    -> "W-P-ROW Weg2RowAuthorityIncomplete" at startup; armed -> "P-ROW-AUTHORITY armed" line;
  * pp_row_carrier_present(scheduler, term=None) split: on the row form every PP0 term answers its
    own switch, DEFAULT OFF -- SGLANG_WEG2_P_ROW_WITHHOLD (sgl-project#1066/sgl-project#1175), _FLOOR_CLAMP (sgl-project#1039),
    _CORRIDOR (sgl-project#794); no term -> False, so weg2_store_told stays armed and the sgl-project#1245 drop keeps its
    answer; off the row form the counter-based answer is unchanged;
  * P-ROW-COST (followers, 60 s): plan ms of row-executed passes p50/p90, frames, probe calls/
    drained/delivered/vanish/quiet/head_other.
Existing protections are the executor's own: frame without a row -> "sgl-project#631 ROW AUTHORITY" stop;
frame before its requests -> left in the inbox (631row14); no frame -> nothing planned (#969J);
sgl-project#1004 / sgl-project#1233 W27 / sgl-project#791 FORWARDED SCHEDULE UNEXECUTABLE STOP.

Tests: test_weg2_p_row_authority_0927.py 15 (default off incl. terms; stall bound finite; counters
built/swept only when on; receiver gets the stall bound and the consumed hook, none on PP0;
half-armed follower / PP0 refused by name; complete arms, off silent; init wiring order and the
receiver handed on; carrier split per term, no term False, old form unchanged; told armed on the
row form; the three PP0 sites pass their term; pacemaker model: counter-gated follower executes
every frame at its slot, the blocking-chain mutant falls behind; P-ROW-COST line and hook).

Profile switch (operator 27.09.): ModelProfile.p_row_authority (default False, both registry rows) feeds
switch_defaults()[SGLANG_WEG2_P_ROW_AUTHORITY]; p_row_authority.enabled(): an explicit env wins, unset
follows the published form's profile default (off everywhere). The proof boot switches it on per docker
profile gpu-arb/docker/profiles/27b-row-authority.env (27b-release-draft.env + _form
SGLANG_WEG2_P_ROW_AUTHORITY 1; K0-K3 criteria in the file). Rebased onto unified 2494e7e.
Test: + registry rows all off, profile default followed, explicit env wins (16 total).

Rebased 28.09. from b16128a onto unified 7055ec7 (cherry-pick, no conflict). Targeted
suites on 7055ec7+Fix B: p_row_authority 16, unify_s2 16, unify_s3 35, told (27b_fidelity 11,
array_key_rc12z2 4, store_told_1400 24, hold_tk 8), pp_chain (abort_check_824 4, receiver 8,
row_defer_cap_1180 20) all passed; pp_chain_flush_deadlock_788 3 failed -- identical 3 on
7055ec7 without Fix B (stub lacks _weg2_vote_pass_hook/_pp_post_send), pre-existing.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 30, 2026
…P0 launched ran here; a paused request resumes only when every P stage released and D stopped growing

Metal dual22 (f5jsd5, ...09301524 @29a9e2aa63). The pause itself held:
P-PAUSE, P-PAUSED requeue, RELEASE on PP0/PP1/PP2, pressure 0, no W50. Then:
- 15:32:13,278 requeue. At 15:32:13,434 the front sent B (same rid
  weg2-0-8) back to P.
- 15:32:13 PP2 applied its recorded abort ("PP0 idle since 1.0 s") while
  PP0's frame fwd 340 for the OLD instance (tokens 2048-3072) still sat in
  its inbox. PP0's frame then named a rid PP2 no longer had: "ROW-PROBE
  DEFER ... not locatable" -> PpRowDeferCapExceeded sgl-project#1180 -> DEBUG-HOLD
  rank 2 -> W17 -> B 503.
- pauses rose to 2: the resume went straight into D still growing.

(a) PP0's idle stamp (dual P, /dev/shm) now carries PP0's forward count. A
follower applies its recorded chunked abort only when its own forward_ct has
reached it, i.e. it has executed every pass PP0 launched. "PP0 idle" alone
is not ordered with the ring. A stamp without the count applies nothing.

(b) The front sends a requeued PAUSED head (dual_paused_n > 0) back to P
only when EVERY card ledger shows pressure 0, P committed 0 (every P stage
released) and D demand 0 (D grew or stopped asking)
(card_kv_ledger.p_resume_ready). Lines "WEG2 DUAL RESUME-WAIT" (throttled,
per card (pressure, P committed, D demand)) and "WEG2 DUAL RESUME". An
ordinary head is not held. D's clear_pressure clears its demand too, and D's
tick clears both whenever it is not growing.

Tests test_weg2_dual22_resume_order_0930 cover:
- the fwd 339/340 still pending on PP2 -> no abort, then applied;
- the paused head waits for PP2's release AND for D's demand, then resumes;
- an ordinary head is not held;
- cleared pressure clears demand.
Red on e62d063: 3 failed, 1 guard passed. Green now: 4 passed, plus the
dual20 file 11 passed. Neighbours (14 files: ledger, dual P/D, _dual_pump,
pause): 89 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 30, 2026
…) holds under pressure and holds a paused head until resume; a requeued pause is never handed to D

Metal dual23 (hceth5, ...09301558 @e61d82fdd2). The pause worked (B served
in the end, needle HIT, RELEASE x3, no sgl-project#1180), with one FAIL, W50 for B:
- 16:07:02,473 P-PAUSE weg2-0-8 (B not started: prompt_tokens=0).
- 16:07:04,552 P-PAUSED requeue (pauses=1).
- 16:07:04,620 D-ADMIT weg2-0-8. The pause path returned the Pending from
  the pass's `one`, and the pool's on_done handed it to D.
- 16:07:04,686 a second P-PAUSE at unchanged pressure 360710144. The running
  pass took the requeued head again; the pump's gates run only before a NEW
  pass, so there were 0 RESUME-WAIT lines.
- 16:07:09 D refused it (uncached 129186 > X) -> W50 re-route through P.

Now:
- _dual_requeue_paused marks the Pending (dual_requeued). _on_leg1_done
  skips it via _dual_skip_after_requeue: it is back in leg 1, never D's.
- The pool's may_dispatch adds _dual_dispatch_held(), so no NEW leg 1 leaves
  while any card presses P, and a paused head leaves only when
  _dual_resume_held allows it (pressure 0, P committed 0, D demand 0 on
  every card). This applies inside a running pass as well as before a new
  one. Two pauses at unchanged pressure are impossible.

Tests test_weg2_dual23_requeue_gate_0930 replay the dual23 sequence through
the real _p_drain_pool (pause mid-leg, 200/prompt_tokens=0, requeue): B is
not handed to D, not dispatched again, and pauses stays 1. They also check
the real drain wires both gates. Red on e61d82f (2 failed), green now (2
passed). Neighbours (19 files: ledger, dual P/D, pump, pause, drain pool):
125 passed. One failure is pre-existing and identical on e61d82f:
test_weg2_l3_index_1459 Wiring (a Semaphore source check).
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 1, 2026
…chedule decides it (sgl-project#1180-W), hand-backs read below the sgl-project#915 threshold

Metal gmps4 (dual1m ...10011614, 6ff17a0) died 16:19:25Z on P PP1:
PpRowDeferCapExceeded sgl-project#1180 -- slot 0 held PP0's frame naming weg2-0-9, which
PP1 could not locate. Sequence: PP0 admitted weg2-0-9 into slot 0 (fwd 118),
then the client's AbortReq reached all P ranks in the same pass. PP0 took it
as a chunked abort (xsn324: two more chunks, slots 1-2); PP1 still held the
request in its WAITING queue (told/paced-admit absorbed, frame not yet
consumed) and popped it at receipt -- PP0's slot-0 frame then named a rid PP1
no longer had.
sgl-project#1180-W: a PP follower under row authority (True/unknown; never the
pass-aligned form, PP0, non-PP, abort_all) holds a waiting-queue abort
(WEG2-PP-WAITING-ABORT held) and follows PP0's forwarded schedule each pass
(weg2.pp_abort.follower_waiting_abort_verdict): named -> keep (admitted this
pass), admitted -> the chunked abort path, pp_size frames naming others -> pop,
PP0 idle (sgl-project#1268) -> pop, no frame -> keep.

Same boot, weg2-0-7 N=25: P published its N-1 anchor (END-ANCHOR units=24/24
ok), but D's store read was refused by the sgl-project#915 threshold (vote_negative
need=24 threshold=256), D matched 0, uncached 25 -> W31/W50 -> re-route
through P -> the same refusal. In the dual layout every D request is a P
hand-back: dual_handback_min_tokens() = 1 on group D (min_tokens of the read).
The anchor fix itself held: 16x DUAL-HANDBACK d_uncached=1 admit, END-ANCHOR
units = N-1, HANDOFF-KEYS offset=1.

Tests: test_weg2_dual_abort_handback_1001 7/7 (verdict table; the gmps4
sequence on the real scheduler methods: not popped at receipt, kept while
PP0's frame names it, handed to the chunked path once admitted; PP0-popped ->
pop after pp_size frames; no frame keeps, PP0 idle releases; immediate on PP0
/ non-PP / abort_all / pass-aligned; hand-back min tokens; wiring) + the
anchor file 6/6; red on 6ff17a0 (import). Gate: 84 test files touching
aborts / PP abort / prefetch min tokens, 643 run: 4 failed / 12 errors, the
identical set on 6ff17a0.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 1, 2026
…chedule decides it (sgl-project#1180-W), hand-backs read below the sgl-project#915 threshold

Metal gmps4 (dual1m ...10011614, 6ff17a0) died 16:19:25Z on P PP1:
PpRowDeferCapExceeded sgl-project#1180 -- slot 0 held PP0's frame naming weg2-0-9, which
PP1 could not locate. Sequence: PP0 admitted weg2-0-9 into slot 0 (fwd 118),
then the client's AbortReq reached all P ranks in the same pass. PP0 took it
as a chunked abort (xsn324: two more chunks, slots 1-2); PP1 still held the
request in its WAITING queue (told/paced-admit absorbed, frame not yet
consumed) and popped it at receipt -- PP0's slot-0 frame then named a rid PP1
no longer had.
sgl-project#1180-W: a PP follower under row authority (True/unknown; never the
pass-aligned form, PP0, non-PP, abort_all) holds a waiting-queue abort
(WEG2-PP-WAITING-ABORT held) and follows PP0's forwarded schedule each pass
(weg2.pp_abort.follower_waiting_abort_verdict): named -> keep (admitted this
pass), admitted -> the chunked abort path, pp_size frames naming others -> pop,
PP0 idle (sgl-project#1268) -> pop, no frame -> keep.

Same boot, weg2-0-7 N=25: P published its N-1 anchor (END-ANCHOR units=24/24
ok), but D's store read was refused by the sgl-project#915 threshold (vote_negative
need=24 threshold=256), D matched 0, uncached 25 -> W31/W50 -> re-route
through P -> the same refusal. In the dual layout every D request is a P
hand-back: dual_handback_min_tokens() = 1 on group D (min_tokens of the read).
The anchor fix itself held: 16x DUAL-HANDBACK d_uncached=1 admit, END-ANCHOR
units = N-1, HANDOFF-KEYS offset=1.

Tests: test_weg2_dual_abort_handback_1001 7/7 (verdict table; the gmps4
sequence on the real scheduler methods: not popped at receipt, kept while
PP0's frame names it, handed to the chunked path once admitted; PP0-popped ->
pop after pp_size frames; no frame keeps, PP0 idle releases; immediate on PP0
/ non-PP / abort_all / pass-aligned; hand-back min tokens; wiring) + the
anchor file 6/6; red on 6ff17a0 (import). Gate: 84 test files touching
aborts / PP abort / prefetch min tokens, 643 run: 4 failed / 12 errors, the
identical set on 6ff17a0.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 1, 2026
…9c0f76f

fe5c550 (dual seat, on da33b3c): exact 27B anchor keying for every
P->D hand-back, D claims N-1, sgl-project#1180-W follower waiting-abort hold,
handback_min_tokens, L3 identity carries anchor_keying (new 27B L3
directory). Merged without textual conflicts. Integration fixes:

* scheduler: the two sgl-project#1180-W hooks are called through the class
  (Scheduler._weg2_process_waiting_aborts(self),
  Scheduler._weg2_defer_waiting_abort(self, recv_req)); the #791c/xsn324
  abort harnesses drive these methods on a bare namespace and both hooks
  are no-ops without pending waiting aborts. The dual seat's wiring test
  follows the call form.
* anchor tests that used the 27B row as the vehicle of the UPSTREAM keying
  (fork_anchor, p_trim_end_anchor, store_short_tail) pin
  SGLANG_WEG2_BIGRAM_ANCHOR_EXACT=0 explicitly; the two P-TRIM controls
  (end_anchor_claim_mark, end_anchor_exact_probe page 64) key their anchors
  like the new insert (committed ids + held-back prompt token) and expect
  the N-1 probe (1024 for N=1025, was the N-2 page floor 960 -- the W50 the
  commit fixes); the page-64 harness gives its request origin_input_ids.

Gate (83 files: handback/abort/anchor/form/L3 identity + the N2 suites):
19 failed / 1318 passed, the same 19 as N2 9c0f76f; the 23 failures
fe5c550 brings on its own are resolved above. handback tests 14 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 1, 2026
…t#1180-W waiting-queue abort holds

27B N3 sgl-project#2 (boot dkr27browauthoritybar1fs10011814, e9736b8): at 18:18:13Z
an H102 burst aborted weg2-0-3 / weg2-0-4 while both still sat in the
followers' waiting queues (#TW TWIN-DEFER). PP0 applied the aborts, PP1/PP2
held them (sgl-project#1180-W "WEG2-PP-WAITING-ABORT held"). PP0 then ran one short
request and went idle; a frameless follower skips the plan (PLAN BYPASS), so
_weg2_process_waiting_aborts never ran again, and the #791C idle-vote release
(weg2_791c_release_on_idle_vote) returned at once because it looked at
_pending_chunked_abort_req only. 6643x "WEG2-P-IDLE-VERDICT idle=False
blocking_rank=1 blockers=[waiting_queue]", every P /flush_cache 400, W3
Weg2DrainWitnessDisagreement at 18:19:44Z.

The hook now also runs when _weg2_pending_waiting_aborts holds rids: same
gates (follower, row authority, PP0 idle in the vote, own microbatches
drained), then process_pending_chunked_abort under _791c_pp0_drained ->
follower_waiting_abort_verdict answers pop. Guard: a hold that survives such
a vote is named (WEG2-PP-WAITING-ABORT STALE rids=... votes=...).

Tests: test_weg2_w3_waiting_abort_vote_1001.py 4 passed -- (a) idle-PP0 vote
pops the held waiting aborts, (b) no release without idle PP0 or with
undrained microbatches, PP0 / pass-aligned form untouched, (c) the chunked
#791C release unchanged; (a)(b) red on d479845; mutant (hook gated on the
chunked abort only) turns (a)(b) red again.
Gate (97 files: pp_abort/chunked abort/idle vote/handback/pp mixin, -n 2,
nice/ionice, MemAvailable 106 GB): base 124 failed / 1152 passed, fix 123
failed / 1153 passed; the one xdist-only difference
(test_ring_commit_bounded_973 arm1a) fails identically on base and fix when
run serially (4 failed / 1 passed both, twice each).
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 16, 2026
…ads only frames in flight (_pp_launched_batches + chunked_req), a busy-PP0 vote keeps the hold, a second abort joins an open hold

A1: pp0_inflight_reqs read mbs / last_batch / running_*, which keep a COMPLETED batch
until the slot is planned again. A rid that ran on every rank and was requeued on every
rank (#968b requeue, void park, retreat) then stamped True; PP0 popped it at receipt and
the followers held an abort no frame ever ends (reviewer probe P2: still held after 50
frameless passes, released only by the next idle-PP0 lap). Now: _pp_launched_batches
(set at the launch on every rank, popped when the slot's result is consumed, sgl-project#1225) plus
chunked_req.
A2: negative test for weg2_791c_release_on_idle_vote -- a vote with PP0 busy keeps the
hold, the frame stays executable, the admitting plan applies PP0's abort (kills R2).
Defence: a second abort of a rid whose hold is open joins the hold instead of popping at
receipt on a later stamp (reviewer P1, unreachable under the ring invariant).

Tests: test_weg2_pp_waiting_abort_k14_1015.py 30/30 (6 new: A1 completed-slot + requeued
rid -> stamp False, no zombie; A1 mutant (old inflight form) -> zombie after 50 passes;
A2 busy vote keeps the hold; A2 mutant R2 -> sgl-project#1180; second abort joins; mutant
no-join -> sgl-project#1180). Specimen tests stay green.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 16, 2026
…like the live loop; S10b puts a COMPLETED slot-2 batch of the requeued rid in mbs/last_batch (nf-review-k14-1016 A1)

S10/S10c: PP0's launched slot-2 batch is also registered in _pp_launched_batches (sgl-project#1225,
set at the launch on every rank). S10b: the rid ran everywhere, slot 2 delivered (mbs and
last_batch still hold the completed batch, _pp_launched_batches does not), requeued
everywhere, then the abort -- G10 is red if a follower is left holding it (the zombie).

Matrix: fa7d8e1 (K14 + Nachbesserung) 35/35 GRUEN; 6d2ca68 S10b ROT 'G10
ABORT-UNIFORM' (the A1 zombie), rest GRUEN; 1cfbf32 S10 and S10c ROT GRUPPENSTOPP
sgl-project#1180, rest GRUEN.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 16, 2026
…robe findet die END-ANCHOR-Tails -- sie liest die gemeinsame Aufzaehlung pp_request_locations statt ihrer eigenen vier Orte

Boots 1016_150003 (weg2-6-94) und 1016_151644 (weg2-0-20), derselbe Client-Request nach jedem Neustart:
89664 Tokens, 89600 gecacht, uncached Rest 64. Der Rest passt ganz in einen Chunk, also teilt die
END-ANCHOR-Regel (sgl-project#1233, Anker bei floor_grain(N-1), grain 4) ihn in Body 60 + Tail 4. Mit fnFL2 H42
(multi anchor tails) lebt der Tail in Scheduler.anchor_tails -- absichtlich NICHT im einzigen
chunked_req-Feld (das fuehrte weiter weg2-0-18: 'sgl-project#992 CHUNKED CONTINUATION NOT NAMED rid=weg2-0-18
decision_names=weg2-0-20'). PP1/PP2 mintet denselben Tail aus der weitergeleiteten Geometrie
(ANCHOR-TAILS minted_rids=weg2-0-20 bei slot 1). PP0s slot-2-Zeile nennt den Tail; die sgl-project#631-Row-Probe
in _pp_proxy_frame_pending zaehlte aber nur waiting_queue, chunked_req, den Slot-Chunk und running_batch
-> "not yet locatable" ohne Aenderung -> 4 Laps -> PpRowDeferCapExceeded, RANK_EXCEPTION. Der
Early-Settle (equal/short_satisfied) ist nur der Weg zum ganzen-Chunk-Rest, nicht die Ursache.

Fix: _known = pp_request_locations(self) (sgl-project#946: jede Stelle, an der ein Request leben kann, inkl.
anchor_tails und Slot-Ring) plus der Chunk des genannten Slots. Keine Lap-Grenze geaendert; eine rid,
die an keinem Ort liegt, wird weiter verschoben und endet benannt.

Tests: test_pp_row_probe_anchor_tail_1016.py 3 gruen (weg2-6-94 ueber die Lap-Grenze hinaus
lokalisierbar, weg2-0-20 nach equal-Early-Settle, eine rid an keinem Ort wird weiter verschoben); auf
1f4b3e7 rot 2. Mutant: anchor_tails aus pp_request_locations entfernt -> ROT 1. Regression 9 Dateien
(Row-Probe/sgl-project#1180/#791T/sgl-project#968/sgl-project#946/sgl-project#961/sgl-project#971/H42/K14/244): Kopf 221/1 rot = Basis 221/1 rot (vorbestehend
test_weg2_p_multi_anchor_tails_h42::test_count_arm_uses_the_fresh_admission_count). Kaltstart-Rig s7s8
28/28 GRUEN.
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.

3 participants