Skip to content

Fix layernorm input shape - #1066

Merged
zhyncs merged 2 commits into
sgl-project:mainfrom
ispobock:fix_norm_shape
Aug 13, 2024
Merged

zhyncs merged 2 commits into
sgl-project:mainfrom
ispobock:fix_norm_shape

Conversation

@ispobock

Copy link
Copy Markdown
Collaborator

Motivation

Fix #1061

Modification

unsqueeze after layernorm

@zhyncs
zhyncs merged commit 162f3cc into sgl-project:main Aug 13, 2024
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 1, 2026
…flip hold and the stale re-admission order

sgl-project#1065 (livelock boot_855_tiprevert1033 05:04:53-05:23Z): chunk_blocks_quiescence
loses its strict clause and the #858b/sgl-project#887 runnability oracle
(prefill_runnable_in_current_layout) with both call sites. The clause held
tp_to_pp on an incomplete chunk whose continuation the builder's own gate
(fits_in_one_chunk + seam grant) refused to build: budget>0 said runnable,
grant=0 said never -- 37 abandons/rank over 1114 s, 11 queued / 0 running,
abort of the hanging rid deferred until after a cutover that never came.
A flip commits at any settled chunk boundary now; re-admission serves the
committed prefix by read-through (cutover-full-reset design).

sgl-project#1066 (cached=0 on 90/90 prefills, same boot): re-admission ran BEFORE the
pool rebind, so every intake prefetch opened on the outgoing binding and
completed into a sgl-project#937 stale refusal; the #943b one-rid-per-round vote (a CPU
all_reduce on the admission path) re-fetched one request per round, too late,
and the recompute raced the fetch into an sgl-project#841 decline. Deleted: the vote
(take_agreed_reissue), the owed ledger (_reissue_pending), the #1025b shim
(reissue_seam_prefetch). Replaced by construction: the requeue is deferred to
after _cutover_fn (_post_cutover_readmit), which also sweeps the queue's
stale prefetch records through the ordinary _prefetch_kvcache
(retire-then-register); PP0 waits for its own drained prefetch verdict
(#969Z revisited: row authority delivers membership same-pass, followers
still never decide).

Desk-proven: py_compile, predicate truth table, _post_cutover_readmit smoke,
10/10 deletion falsifiers (test_968_deletion_falsifiers.py).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 1, 2026
…only prefetch verdict

Against the committed rebuild (8bac764): (c) _post_cutover_readmit
exists, consumes the _pending_seam_readmit stash one-shot (exactly one
stasher module-wide, explicit None-clear), and carries the sgl-project#1066
POST-CUTOVER FRESH-FETCH execution proof; (d) inside the PP admission arm
exactly one prefetch-pending skip exists, it is prefetch_pending_pp0,
guarded by pp_rank == 0, and the follower credit-only path survives --
the ballot hold in the non-PP elif arm is the upstream-equivalent
per-request hold and deliberately stays outside the pin's scope (first
pin draft counted globally and went red on that legitimate arm; scoped
to the PP arm). Full file: 13 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 1, 2026
…ot every rank's

Boot 1065umbau wedged at 06:26:07Z: pp_to_tp armed one pass after PP0
launched the final 118-token chunk mb. PP1 had RECEIVED and reconciled that
pass's frame (ROW-PROBE delivered=31, BATCH-NULLED occurrence=1 with all
void flags False) but the armed park in get_next_batch_to_run withheld the
build; PP2 stayed at delivered=30; PP0 blocked forever in the output recv
(mb slots [0, 2] in flight), so the 30 s abandon carrier never ran. The
deadman's BUSY-STARVED verdict took the boot down.

Pre-sgl-project#1065 the strict chunk clause kept the park open during a chunk ladder
and masked this: a follower's park is a rank-local verdict that stops the
very drain the park exists to wait for. Per the PP0-authority order,
followers execute what the row tells them and decide nothing: in the PP
layout (pp_to_tp armed) only PP0 parks -- it stops SOURCING new work while
in-flight mbs keep draining downstream. In the TP layout every rank is a
replica of one decision from replicated state, so the park stays
group-wide (tp_to_pp unchanged).

Sibling sweep: the sgl-project#797 voided-pass hold below the park is row-carried
(PP0-decided) and stays; the sgl-project#1066 PP0-wait is admission-side on PP0 only.
Desk-proven: py_compile; metal falsifier is the same drain scenario --
chunk ladder + arm mid-ladder must now flip and decode.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 1, 2026
…nted a constructively empty set

F2a Bericht 2 (1068cap, all 24 emissions swept=0, structurally explained):
the sweep ran over waiting_queue BEFORE readmit_seam_residents, and the only
population whose prefetch ops survive a cutover is exactly the residents the
readmit has not yet requeued -- their fresh fetch is issued by the readmit's
own intake path. Ordinary queued requests' ops terminate within ~1 s under
the 'timeout' drain and never straddle a cutover. Second bookkeeping,
deleted per the upstream-minimal order; the sgl-project#937 stale refusal remains the
safety net for anything that ever does straddle.
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 28, 2026
…cute its row (W102b)

NF rc12z30c -st (f33274e) died 28.09. 20:50:53Z. P-log
boot_weg2_dkrnfh91dprsavisnoadoptstbar1dauer09282039_f33274eac0_0928_203953:
- PP1/PP2 20:41:59 'sgl-project#631 ROW AUTHORITY DISABLED' (followers plan rank-locally)
- PP0 20:48:53 'W102 Weg2VisionStage run=1 ASYNC started rids=[weg2-6-33]' -> held
- PP1/PP2 20:48:53 'sgl-project#969 EXTENT n=9 fwd=1 reqs=[(weg2-6-33, 0, 12579 ...)]', PP0 none
- PP1 'PP-RECV-OBJ ... awaiting_size' 30/60/90/120 s (proxy frame PP0 never owed)
- PP0 20:50:53 'sgl-project#973 RING COMMIT TIMEOUT' in _pp_join_comm_work, PP1 gloo closed.
Not GIL, not a stream sync, not the worker: the ranks split on the admission.
The same shape sgl-project#1066/#969Z closed for the prefetch withhold, and the same law
(pp_row_carrier_present: PP0 may withhold only when the followers execute its
row). The async stage broke it; the synchronous stage stages AND admits in one
pass, so every rank admits the same request (z29b, where vision worked).

vision_async_admissible(): single stage -> yes; else pp_row_carrier_present(
term="vision_async") -- new Fix B term SGLANG_WEG2_P_ROW_VISION_ASYNC, default
off. Not admissible -> the synchronous stage, one named line
'W102b Weg2VisionAsyncNotAdmissible'. NF (no carrier) and 27B row form (term
off) both run the synchronous stage by default; the async form is opt-in per
term on the row form.

Tests: test_weg2_vision_rank_runner (+2: carrierless PP3 -> sync + one line;
row form needs its own term), p_row_authority_0927, vision_rank_wiring,
vision_rank_stage_core: 64 passed. Mutant (gate forced true): both new tests red.
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