Repository navigation
Clean up the usage of flashinfer - #610
Merged
Merged
Conversation
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
Aug 6, 2026
…ilies the desync hid in The 2026-08-06 05:53:59 crash was a rank-arrival desync, and the census was armed and running through all of it. It reported nothing. Not because it failed -- because every family it tracked genuinely agreed: dcp.all_gather 10176x, dcp.all_reduce 2864x, tp.all_gather 580x, tp.all_reduce 36824x, identical on rank 0 and rank 1. The family that diverged was necessarily one nobody counted, and the abort named an 8-byte collective served by the a2a kernel. Neither broadcast nor all_to_all was censused at all. Agreement across every family you count is not health when the failure is in a family you do not count. WHAT CHANGED - collective_clock_families() returns two more names per group, "<group>.broadcast" and "<group>.all_to_all". This is the one place a group's families are named and both instruments read it. The two new names are CENSUS-ONLY: they carry no _COLLECTIVE_CLOCK span, because arming a span is a separate decision with its own cost and its own log-line surface. Naming a family there is not a claim that it is timed, and the docstring now says so. - GroupCoordinator.broadcast and .all_to_all_single bump their family, at the same seam and under the same placement rule as the existing four (after the clock's re-entry guard, before the world_size==1 bypass), so a collective is counted exactly once. all_to_all_single_v shares the all_to_all family: a rank that skips an uneven a2a has skipped an a2a. No bump was added to _all_to_all_single -- the public seam already counted the call that routes through the registered op, and bumping both would double count. - CollectiveCensus.declare_families(): the census payload width is now fixed by replicated config instead of by rank-local state (sgl-project#610). snapshot() is what all_gather_object packs, so the KEY SET is the payload width; left to grow on first use it is a function of what a rank has happened to execute, which is exactly the rank-local state this instrument exists to catch diverging. Group construction is replicated, so each group declares its families at construction and every rank packs the same keys from the first comparison onward. Second effect worth having: a declared family that never fires is visible as 0x instead of absent, so "never counted" and "not instrumented" stop looking alike. Mechanics are unchanged otherwise: same rank-cumulative dict, same gloo all_gather_object cross-check on tp_cpu_group, same union-based differ, same warn-never-raise. Hot-path cost is one further dict increment on two seams, behind the existing module-level bool. TESTS test/registered/unit/distributed/test_collective_census_broadcast_families_583.py, 12 cases, hermetic (CUDA_VISIBLE_DEVICES=99, no torch.distributed init, no group, no CUDA). They drive the REAL dispatch sites and the REAL differ, so they fail on a tree missing the bump rather than on a tree where a string changed. The harness is deliberately arity-tolerant about the family tuple so the can-fail lands on behaviour, not on fixture construction. 12 passed here. 11 of 12 FAILED on bccb87b with the same file. The headline case, test_a_broadcast_desync_is_named (129 vs 128 broadcasts across two ranks), fails there with "'tp.broadcast' not found in set()" -- the differ returns an EMPTY list, which is precisely "the divergence passes silently". test_an_all_to_all_desync_is_named fails the same way ([] != ['tp.all_to_all']). The 1 case that passes on baseline is test_agreement_on_the_new_families_stays_silent, which asserts an empty diff when the counts AGREE; it is the no-cry-wolf guard, not a can-fail case, and it passes on baseline trivially because nothing is counted there. No regressions: test/registered/unit/distributed -> 13 failed / 2404 passed here versus 13 failed / 2392 passed on bccb87b. The failing set is IDENTICAL (set difference empty); the 13 are pre-existing and unrelated (test_uniform_decode_mem_603 and siblings, _FakeScheduler fixtures). The +12 is exactly this commit's new tests. test/registered/unit/managers/test_rank_prefill_log.py: 32 passed, 4 skipped. test_rank_prefill_log.py's family-tuple pin was updated to the six names and now also asserts dcp.broadcast; its sibling that pins the four CLOCK dispatch sites is deliberately left at four, which is what keeps the census-only tail honest. ruff and codespell clean on all changed files. Out of scope, still a boot ticket: the PeerWatchdog sequence-number liveness mechanism that would catch a peer that is alive but not arriving.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 6, 2026
The 21:52:25 specimen names itself once the stacks are read next to the sizes.
All three ranks are parked in the SAME all_reduce
(_gather_hidden_states_and_residual) at the SAME layer_idx, and the second
py-spy round has them advanced to layers 9/9/8 with each rank's nbytes
UNCHANGED. The size is therefore a property of the rank's whole forward, not
of one collective, and the collective SEQUENCE is aligned: this is not a rank
running one collective ahead. It is one logical collective whose shape differs
per rank -- 1690 tokens on rank 0 against 1818 on its peers, every one of them
an exact (num_tokens, 5120) bf16 payload.
prepare_for_extend builds that axis as sum(seq_len - len(prefix_indices)).
Everything there is replicated except the matched prefix, which comes from
this rank's radix cache. Two triggers mutated those caches from rank-local
state while the pools are rank-sized by construction (179825 / 143860 / 136667
tokens on the crashing boot):
* evict_from_tree_cache fired on `available_size() < num_tokens`, where the
DEMAND is replicated (batch.extend_num_tokens) and the AVAILABILITY is
this rank's own shard, so the roomy rank declined an eviction the tight
ranks took;
* load_back EXTENDS the device prefix and succeeded only where local free
space allowed -- no eviction needed to diverge the trees at all.
Both push the same way, and it is the direction the specimen shows: rank 0
owns the largest pool, evicts least, loads back most, matches the longest
prefix and computes the fewest tokens. The 21:08 specimen has the same
asymmetry (334 against 1229). Once the replicas drift, every per-layer TP
all_reduce of the next extend is entered with mismatched shapes and BAR1 spins
on a contribution that cannot arrive -- abort word CLEAN on all three ranks.
sgl-project#603 and sgl-project#610 pinned the decode-mem and prefill-admission DECISIONS with a
MIN-reduce and both explicitly left eviction as a local side effect ("Still
evict locally for the space"). The decisions were uniform; the cache CONTENT
they decided against was not.
The fix publishes the group MIN of available_size() on the tree cache once per
iteration and lets both triggers decide from it. No new collective: the value
rides the reduce _update_uniform_pool_budget already performs unconditionally
and pre-branch, with one extra element (-local_avail) yielding the group MAX
from the same MIN all_reduce. Direction is safe by construction -- min <=
local, so the floor fires whenever the local test did and sometimes when it
did not, which makes under-eviction (an allocator OOM) arithmetically
impossible; slack ranks pay for uniformity by dropping cache they did not
personally need. Activation is collective-derived and exact: the floor is
withheld precisely when every rank reports the same availability, and then the
local test is already uniform.
The pin had to be written in both cache classes. This rig runs
UnifiedRadixCache, not HiRadixCache, and each carries its own load_back with
its own local gate; the first cut pinned only the class the validated boot
never instantiates.
Test results (debug + distributed, one run): 2827 passed, 20 failed, 12
skipped. Those 20 are the SAME 20 the unfixed tree produces at HEAD, compared
name-by-name against a clean worktree at 3752da3 -- zero fix-only
regressions. Of the total, 354 are test/registered/unit/debug/ (unchanged) and
13 are new in
test/registered/unit/distributed/test_uniform_evict_floor_616g.py.
Two sibling stubs in test_uniform_decode_mem_603.py did regress on the first
cut -- a stub that models less surface than the real class -- and now bind the
new method. ruff: no new errors; the added code is format-clean.
The falsifier is proven able to fail: reverting evict_from_tree_cache to
allocator.available_size() turns the eviction verdict from [True, True, True]
back into [False, True, True] and fails
test_the_eviction_trigger_agrees_across_ranks.
On card: the fix binds on a real boot (PYTHONPATH pinned to this tree, pools
179825 / 143860 / 136667, i.e. the wedging geometry). Under the 4-way stress
harness the fixed tree produced ZERO Bar1CollectiveStalled events. The
graph-replay Bar1CollectiveAborted family (host-path collective counts
AGREEING, one-generation block skew) is a different shape, predates this
change, and is still open -- it is not claimed fixed here.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Aug 9, 2026
…keeps cycling
Boot 10 showed the arm delivery finally correct -- all three ranks armed
identically, zero control messages -- and it still wedged:
rank0: on_round -> bounded_collective (flip reduction)
rank1/2: _pull_raw_reqs -> point_to_point_pyobj (chain recv)
Ranks 1 and 2 DID arm and DID reach on_round, but were not parked yet, so
they returned and came back to the chain recv, which is an UNBOUNDED
wait. Rank 0's park predicate went true first; it entered the blocking
reduction -- and entering it stops rank 0 forwarding the very batch its
peers are blocked on. Nobody can join, and rank 0 cannot time out because
the park deadline is evaluated before entry, never from inside the wait.
The existing safety argument ("a parked rank owes no pipeline send")
covers hidden-state sends. It does NOT cover the request-chain forward,
which a parked rank still owes its downstream stage every iteration.
An unbounded wait in a coordination path is also against this fork's
bounded-wait canon (sgl-project#610/sgl-project#615/sgl-project#653). Bound it: a stage with nothing to
receive returns empty, re-reaches its own on_round -- by then parked --
and joins. Idle coordination then needs no chain message at all, which is
what lets the policy stay message-free.
THE INVARIANT, and the reason this is not a one-line timeout: a posted
irecv is a standing promise to the sender, which will deliver into that
exact tensor. It can never be abandoned on a deadline. The Work and its
tensor therefore live in chain_recv_state and are re-polled across calls;
a second irecv is never posted while one is outstanding. Only the SIZE
header is polled -- once it lands the sender is committed to the payload,
so the body keeps the ordinary blocking wait.
Gated on chain_recv_poll_s, wired to 50 ms only when the policy is on.
Every other boot keeps the upstream unbounded path byte-identical.
Tests: 317 passed in the sgl-project#631 flip family, CPU-only. New: a bounded recv
returns empty rather than blocking and never waits an incomplete Work;
three polls of one pending receive post exactly ONE irecv (the
desynchronisation falsifier); a landed size==0 clears the state; poll 0.0
keeps the upstream path.
Also recorded: the first VALID sustained load of this task -- 4 min
agent-like mixed traffic (1 long-prefill worker at 8192/32768 + 3 decode
workers, bs<=4) against the manual-policy server: 52 requests, 52 ok,
0 aborted, post-idle 32768-tok probe 4383.7 tok/s. Earlier load attempts
measured wedged servers and were no measurement at all.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Aug 9, 2026
Restores the arm as a chain message and fixes the ORDER that made it deadlock, rather than removing the message. The message-free variant was built and measured (boot 10): every rank reached an identical verdict and armed itself with zero messages -- and it wedged solid. arms=3, cutovers=0, 0 % GPU, /generate dead at 45 s. THE MECHANISM, which inverts the earlier reading: THE ARM MESSAGE IS THE WAKEUP. Ranks 1..n-1 spend idle time BLOCKED in the chain recv, and forwarding the arm is the only thing that makes them runnable. That is why the manual POST /phase_flip has always worked (~1.2 s cutovers, reproduced all session) and why removing the channel removed the synchronisation. The hazard was never the channel; it was the order. THE INVARIANT (named in code): no rank may enter the flip's BLOCKING consensus reduction while it still owes, or has uncommitted, chain sends. A rank acts on an arm only in the pass AFTER _pp_commit_comm_work has committed the forward carrying it downstream. Intermediate stages obey the same rule on receipt, so the wake propagates strictly ahead of every rank's block; the last rank owes no forward and its deferral is a one-pass no-op. With this ordering the automatic path is byte-for-byte the manual one -- same request, same chain, same wake, same drain-park-meet -- and only the originator differs (policy on rank 0 vs an HTTP caller). That equivalence with a mechanism proven on metal is the design's strongest argument. Two alternatives stay rejected, both measured: a SYNCHRONOUS forward deadlocks worse (a peer need not be in the chain recv at all; found blocked in the hidden-states exchange while this rank blocked in send), and BOUNDING the chain recv decouples a 1:1 send/consume contract so the consumer can skip a consume, unmatched sends accumulate and the SENDERS block (reverted in 3c0115fd6d; its posted-irecv-is-a-promise test is kept as the artifact). (c) BOUNDED JOIN, unconditional backstop: entry to the consensus reduction is now a bounded wait that abandons from INSIDE, disarms, logs loudly and returns to cycling, so the policy may re-arm. Every other flip deadline is evaluated BEFORE entry, so a rank that got in and found no peers previously waited for ever -- an unbounded wait in a coordination path, against sgl-project#610/sgl-project#615/sgl-project#653. The consensus channel now forwards a per-caller timeout_s to bounded_collective. Default 45 s, generous by intent: a peer draining a long prefill is normal and must not trip it. This is a wedge breaker, not a latency control. Tests: 317 passed in the sgl-project#631 flip family, CPU-only. Can-fail proven against the boot-10 specimen: reintroducing arm-in-same-pass turns all three delivery-before-block tests red with "acted on the arm in the pass that forwarded it". Also pinned: the origin guard (a downstream stage receiving a populated list injects nothing -- the 1/2/3-arm self-kill), the last-rank no-op deferral, that a human RPC is never deferred, that abandonment never raises into the event loop, and that the join deadline actually reaches the channel. Operational acceptance under load NOT yet claimed; the boot carrying this is running.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 16, 2026
…ot a live repair MY OWN CLAIM WAS WRONG AND sgl-project#609 WAS RIGHT. a9030fe states that HiMambaRadixCache "is the tree this rig actually runs". It is not. `registry.py:107` says the class has no construction site anywhere, and its module docstring says the default factory routes hierarchical + hybrid-SSM configs to UnifiedRadixCache. The rig DOES run mamba/GDN, which is what misled me, but that configuration lands in UnifiedRadixCache. WHY THIS IS WORTH A COMMIT RATHER THAN A NOTE SOMEWHERE. The module docstring already records three hardening commits that landed on this class BEFORE the reachability gap was found (sgl-project#581). sgl-project#609 exists precisely so a fourth does not arrive believing it is fixing production. a9030fe is that fourth commit, and leaving its claim unqualified in the tree would retire sgl-project#609's warning by contradicting it. WHAT DOES NOT CHANGE. The defect analysis, the fix and the 17 tests stand: the participation vote genuinely reached only two of the three trees, and this class genuinely lacked it. It is kept on the same terms as its three predecessors, under sgl-project#609's explicit decision to retain rather than delete. WHAT DOES CHANGE. There is no live instance and therefore NO GPU ARM: no boot can enter a class nothing constructs. The metal-proof request filed for a9030fe is withdrawn (/spinning/gpu-arb/requests/, same file, annotated rather than deleted so the reasoning survives). The claim in that request that this blocked the HiCache-file-backend mitigation rollback is withdrawn with it. THE LIVE PATHS WERE ALREADY COVERED BEFORE EITHER COMMIT: UnifiedRadixCache carries the vote from sgl-project#580 and HiRadixCache from sgl-project#610. A reader after a production behaviour fix wants unified_radix_cache.py. Tests unchanged and re-run: 17 green.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 16, 2026
…s one thing FOURTH INSTANCE OF THE SAME SHAPE, and the last one in this directory. sgl-project#656 added an engagement-proof call to `dynamic_chunked_prefill_size` and nothing bound it on `_Sched`, so both sizing cases failed with `AttributeError: '_Sched' object has no attribute '_log_dynamic_chunk_engagement'` -- the same one-name-at-a-time signal that let `BudgetHarness` drift three times running. `_log_dynamic_chunk_engagement` is bound off the real class for the same reason `size_for` is: a stand-in that reimplements it stops pinning it. It writes `_dyn_chunk_last_logged` on the instance and reads `chunked_prefill_size`, both of which this harness already had. THE REFINEMENT THIS HARNESS FORCED, and it makes the idiom correct rather than merely repeated. The sgl-project#610 guard descends one level into the callees of the method under test. Applied naively here it demands `length_predictor`, `model_config`, `ps` and `max_prefill_tokens` -- all reachable only through `predict_next_chunk_size`, which `_Sched` OVERRIDES with its own recording stub. That is the whole point of the harness, the production predictor is never reached, and a guard demanding its state would fail on bindings the harness legitimately does not need -- exactly the over-reach the sgl-project#610 docstring warned about but did not yet encode. So `_required_surface` descends only through callees the harness actually INHERITS (`getattr(harness_cls, name) is getattr(Scheduler, name)`). The requirement then equals what the code path really touches. Two cases pin both halves: an overridden callee is not descended into, an inherited one is. The sgl-project#610 guard is retrofitted to the same rule in this commit. It changes nothing there -- every helper that harness uses IS bound off `Scheduler` -- and is done so the two guards are one idiom rather than two that drifted at birth. CAN-FAIL, PROVEN AGAINST THE REAL DRIFT: removing the new binding makes the guard report `['_log_dynamic_chunk_engagement']` in its own message, before the sizing cases can fail with an AttributeError. A second case plants a member nothing binds. RESULT: test/registered/unit/managers is FULLY GREEN -- 2064 passed, 0 failed, 18 skipped. It was 4 failures when this thread of work started and 2 after the `BudgetHarness` fix. NO PRODUCT CODE. Two test files.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 23, 2026
…-project#701's commitment ledger `_budget_state_stub` had drifted behind `PrefillAdder.rem_total_tokens` again: sgl-project#701 appended the cross-pass COMMITMENT LEDGER to the tail of that property (schedule_policy.py:883-885) and the stub carried neither name, so both admission cases died with AttributeError: 'PrefillAdder' object has no attribute 'chunked_admission_enabled' This is the sixth drift of this harness after #616g, sgl-project#639, #639b, #791b and sgl-project#794, and the sixth time `TheAdderStubTracksTheBudgetPredicate` named it instead of letting an AttributeError surface inside an unrelated admission assertion. The guard keeps earning its place. BOTH NAMES ARE BOUND, not just the one the failure reported. `chunked_admission_enabled` was the reported miss; `commitment_ledger` was the next one queued behind it. Binding only the reported name is exactly what reshipped this incident at #639b, whose own note says so. THE PAIR EXERCISES THE SHIPPED CHOKEPOINT RATHER THAN STEPPING AROUND IT. `effective_rem_total_tokens` returns its input unchanged when the ledger is None (planner/chunked_admission.py:233-235), so enabling the flag runs the real tail and provably cannot move the budget this harness is about. Setting the flag False would ALSO make the guard green while quietly taking that tail out of the tested path -- the weaker of the two bindings, and the one this file's own history argues against. TESTS (hermetic, CVD="", CPU only) test_collective_family_siblings_610.py 11 passed (was 3 failed / 8 passed). The can-fail is already resident: `test_the_guard_can_fail` plants a field that does not exist and asserts the guard reports exactly it. Battery over the 7 files that carried every failure, under /spinning/htsglang-gpu/.venv (datasets 5.0.0, full collection): base 500be7e 22 failed / 35 passed before this 15 failed / 46 passed after this 12 failed / 49 passed -3, exactly the tests repaired here. This branch still adds none. Found while opening sgl-project#823: the enforcer there has to add slots to the same packed reduce this harness models, so an already-drifted guard would have been the thing standing between that change and a silent index shift. Repaired first, deliberately. No boot was run. This is desk work.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 23, 2026
…ith a real reduce STRUCTURE/PRIO, root D of the 0516 wedge. This lands the DECISION and its red-first repro; the scheduler wiring is the next commit and is called out below rather than implied. WHAT EXISTS AND WHY IT IS NOT ENOUGH. prefetch_ballot (#791b) carries a CRC digest of the waiting-queue head on the packed MIN-reduce and voids itself when the group's min and max digest differ. sgl-project#823 already gave that detector onset, persistence and recovery-edge logging (scheduler.py:5061). Its own docstring states the limit: "On mismatch the ballot is void for the pass and the caller falls back to the rank-local verdict -- the status quo ante". Surface, then fall back to rank-local. Nothing makes the ranks agree. The detector is untouched here; the enforcer goes beside it. WHERE THE DIVERGENCE IS BORN. SchedulePolicy.calc_priority (schedule_policy.py:197) orders waiting_queue by req.num_matched_prefix_tokens under a CacheAwarePolicy (_sort_by_longest_prefix, :229-232). That number comes from the RANK-LOCAL radix tree and each TP rank's prefix cache evolves independently -- the #616B family. Same queue, same policy, different ORDER. THE RULE, transplanted from sgl-project#791. sgl-project#791 made PP admission uniform with an asymmetric local/told rule: a locally computed value may only be truncated toward what the anchor said, never used to extend it. The TP sibling: the group's match length is the MIN across ranks and every rank sorts by the GROUP number. MIN is the safe direction for the same reason as #616B's evict floor and the ballot itself -- the agreed length is <= every rank's own, so no rank is ever told to reuse a prefix it does not hold. Worst case a rank recomputes a prefix it had cached: slower, never wrong. Capacities stay rank-local; only the DECISION is uniform, per kein-bindender-rang. THE CIRCULARITY, AND WHY THE SLOTS ARE NOT QUEUE POSITIONS. Per-rid values cannot be reduced by queue position when the positions are what diverge -- slot i is a different request on different ranks and a MIN over that is meaningless. Slots are indexed by a CANONICAL rid order (sorted rid strings), which depends only on the rid SET, the replicated part. A rank that does not hold a rid contributes -1, which MIN-reduces to -1 if ANY rank lacks it, so the group drops that rid rather than admitting a request a peer cannot form: delay, never force, the ballot's own safety property. sorted() is deterministic across processes; hash() is not and must never touch this path. TWO BEHAVIOUR CHANGES, each with its own can-fail arm. The second is the one easy to leave implicit: a digest mismatch must stop falling back to rank-local. The group order is derived from the canonical set and the MIN, so it is still computable in exactly the pass where the digest says the orders disagree -- the mismatch case IS the wedge case, and improving only the agreeing case would leave it untouched. head_decision() carries that branch explicitly and reports which rule ran. PURE ON PURPOSE, per sgl-project#823's own lesson in uniform_floor_scope.py:45: inline behind a real all_reduce the only thing a test can check is whether the source still mentions a branch, and a mutant that disabled the recovery edge once survived a whole suite on exactly that. TESTS (hermetic, CVD="", CPU only, real gloo, no CUDA) test/registered/unit/managers/test_tp_head_congruence_823.py 9 passed. Pure arms plus a REAL gloo MIN all_reduce at world=2 and world=3. The premise is asserted, not assumed: test_todays_local_rule_really_does _diverge shows the rank-local rule giving three different orders on the same queue (rank 0 leads with charlie, rank 1 with alpha). Every rank feeds the enforcer ITS OWN diverged queue order, not a shared fixture list. That is load-bearing: with a shared list the canonical-order step is never exercised and mutant 2 below survives. Mutants killed: enforcer switch ignored -> 1 failed (the can-fail arm) slots indexed by queue order -> 2 failed (canonical independence and the real-gloo uniformity) Regression: 38 passed across test_tp_head_congruence_823, test_prefetch_ballot_divergence_823 and test_pp_prefetch_ballot_791b -- the detector suites are unchanged and still green. NOT YET WIRED. get_new_batch_prefill still calls calc_priority's rank-local sort; this commit adds no slots to _update_uniform_pool_budget's packed reduce. That wiring is next and needs care: the layout comments there record that #639b's appended pair silently moved what the host floor read, and the harness modelling that reduce had drifted six times (repaired in the preceding commit). WINDOW-QUEUE ticket stays preflight_pass N until it is wired and green. Second known gap, recorded so it is not mistaken for covered: scheduler.py :7542/:7547 break the candidate loop on get_num_allocatable_reqs() and req_to_token_pool.available_size(), neither of which rides the sgl-project#610/#616g uniform floor. Equal order with unequal counts still yields unequal batches, so the count needs the same treatment as the order. No boot was run. This is desk work.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 23, 2026
W9's second variable, and the same defect in it. The candidate loop stops on a RANK-LOCAL count -- scheduler.py:7542 `get_num_allocatable_reqs` and :7547 `req_to_token_pool.available_size()` -- and neither rides the sgl-project#610/#616g uniform floor that already covers `PrefillAdder`'s token budget. So two ranks can agree perfectly on the ORDER and still build different batches by taking a different number of requests off the same head. That is the other half of the 0516 specimen. The order arm explains "#cached-token 0 vs 16384"; this arm is what puts "#new-seq 1 vs 3" next to it. THE RULE IS THE ONE ALREADY IN THIS FILE, applied to the count: MIN across ranks, so the agreed number is <= every rank's own and no rank is ever asked to seat more than it can. It can only admit FEWER than it would have -- delay, never force, the third time that direction is the safe one here after the order key and the ballot itself. The rank-local capacities remain the INPUTS; only the decision built from them is uniform, which is the kein-bindender-rang line: a binding rank shortens THIS pass, it does not own a permanent share. `batch_decision` now returns the whole decision -- which requests, in which order, how many -- from one place, because two call sites deciding the two halves are two call sites that can drift apart. An unpriced group (no allocator to ask on any rank) rides a sentinel and leaves the local limit untouched, so such a configuration behaves exactly as it does today rather than collapsing to a zero-sized batch. TESTS (hermetic, CVD="", CPU only) test_tp_head_congruence_823.py 15 passed (9 order + 6 count). The premise is asserted, not assumed: with the enforcer off, two ranks with the same order and different free pool admit 3 and 1 -- the specimen's own numbers. `test_both_arms_are_required_for_a_uniform_batch` pins why W9 needs both: order enforced with the count left local STILL yields different batches. Mutants killed on this arm: count uniformisation off -> 1 failed (the can-fail arm) MAX instead of MIN -> 1 failed (uniformity) overshoot the bound (+2) -> "rank 1 was told to admit 3 with room for 1" That third mutant was added after the second one taught me something: MAX can never exceed the local limit (the group MIN is already <= local), so the safety assertion could not catch it and I had not actually proven that assertion was live. It is now. Regression: 55 passed across this suite, both detector suites and the sgl-project#610 collective-family harness. The detectors are untouched. STILL NOT WIRED, so W9 stays preflight_pass N: no slots added to _update_uniform_pool_budget's packed reduce yet, and neither calc_priority nor the candidate loop consumes these decisions. That is the next commit. No boot was run. This is desk work.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 29, 2026
…ery rank extend = min(fill - prefix, cap). Three of the four quantities are now settled by measurement: cap -- group-uniform. sgl-project#610 subtracts each rank's surplus over the group minimum, and all three ranks read 12977. It also never bound: the binding term was chunk(4096) against extends of 253/254/ 277/278. prefix -- equalised by the sgl-project#791 truncation, both branches, code-read. extend -- differs. That is the observed 254 against 301. So the fill differs, and `_refresh_fill_ids` defines it as `origin_input_ids + output_ids` with a rank-identical prompt. `output_ids` is the single rank-local component of the whole equation. And `req.output_ids.append` lives in the RESULT path (batch_result_processor.py:276), which a VOIDED pass never reaches. These boots are void-dominated. That is a complete chain -- void pass, output falls behind, fill falls behind, extend differs, the sgl-project#631 guard fires -- and every link of it is code-read rather than argued. It is not yet MEASURED. This prints `fill_lens` and `out_lens` per rid on the existing `sgl-project#788 PP-ADMISSION verdict` line, which already carries `rids` and `prefix_lens` and already fires on every rank. It is the only carrier that allows a cross-rank comparison FOR THE SAME REQUEST. No new emission: the same `logger.info`, more fields -- the event perturbs this path (measured four times), the bytes do not (measured twice, and this is the third test). THE PREDICTION IS DIRECTIONAL, not just "a difference": the rank with the smaller `out_lens` must also show the smaller `fill_lens` and the smaller extend. A difference in the wrong direction refutes the chain rather than confirming it. If `out_lens` agrees across ranks the chain is sound but not what happened here, and the remaining writer is `pp_carried_fill_tail` (schedule_batch.py:1300-1305), which is also rank-local. I will not compute 301-254=47 into anything, whichever way the numbers land. Name the carrier, then measure the difference -- this window produced four numbers-fit traps and I walked into one. Evidence: desk. py_compile; the format verified by rendering it through logging rather than by counting placeholders. Belegstufe: DESK-BEWIESEN.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 29, 2026
Three carriers were checked for an enrichment and all three fail: no rid-precise log exists after `req.output_ids.append`, `sgl-project#968 MINT` sits in the parked-continuation fact ring rather than the result path, and `sgl-project#788` fires at ADMISSION where `out_len` is structurally 0 (measured, boot 38). A new emission is therefore the only option, not a convenience -- and it is a STATE reading, not a timing signal, the same distinction that carried `published_fundable_floor`. WHAT IT MEASURES. extend = min(fill - prefix, cap). Three terms are settled: cap is group-uniform (sgl-project#610 pins each rank to the group minimum, measured identical at 12977) and never bound (4096 against extends of 253-278); prefix is equalised by the sgl-project#791 truncation, both branches. Fill is defined as `origin_input_ids + output_ids` with a rank-identical prompt, so `output_ids` is the single rank-local component of the whole equation -- and this append, in the RESULT path a voided pass never reaches, is the only place it grows. THREE CONSTRAINTS, each from a mistake made in this window: DENOMINATOR ALWAYS. seen/emitted/unreadable ride on every line whatever they are. A counter that only moves on confirmations is what made me quote a 12:1 neutrality basis that was really 10:5. FIXED CADENCE, NOT A HIT FILTER. "Emit only when interesting" cannot tell a zero from a never-evaluated -- the same shape that made boot 27 unreadable. Every 40th append, whatever it says. SENTINEL THAT CANNOT COLLIDE. `len(output_ids)` can legitimately be 0, so 0 and None are both unusable for "not read"; -1 is the sentinel and the message says so. `floor=unset` already saved one reading this way. THE DEATH FORM IS NOT A SIGNAL HERE, in either direction. Cumulative over 15 no-flip boots of this config: WIDTH=10, IDENTITY=5. At a one-in-three base rate a single flip is noise, and a single non-flip proves nothing. The only question this boot answers is what `out_len` says for the same rid on two ranks. Evidence: desk. py_compile; the format verified by rendering it through logging rather than by counting placeholders. Belegstufe: DESK-BEWIESEN.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 29, 2026
The flip-hosted trace is the structural half of sgl-project#997 and stays off the critical path. This measurement does not need it -- it needs two integers. WHERE. `req.output_ids.extend(next_token_id)` in `process_batch_result_decode` (batch_result_processor.py:873) -- the DECODE append, which is the one that feeds the divergent term. #997b instrumented the PREFILL append instead and could not have seen it: the dying batch was EXTEND, but its fill carries the output_ids from the preceding DECODE steps. WHY THIS IS THE LAST TERM. extend = min(fill - prefix, cap). prefix is equalised by the sgl-project#791 truncation (both branches, code-read); cap is group-uniform (sgl-project#610 pins each rank to the group minimum, measured identical at 12977) and never bound (4096 against extends of 253-278); fill is `origin_input_ids + output_ids` with a rank-identical prompt. `output_ids` is what is left, and this append is where it grows -- inside the RESULT path, which a voided pass never reaches. FOUR CONSTRAINTS, each paid for in this window: COUNT AT THE EVENT, EMIT ELSEWHERE. #997b put its denominator inside the line it gated, so zero lines meant zero information. A denominator that lives in the same call as the event shares the event's fate. THE EMISSION SITE IS VERIFIED TO RUN FIRST. `pp_ring_note` printed 241 lines across all three ranks in boot 36. Boot 40 cost a cycle to the opposite mistake: I fixed a gate on an object that was never constructed, because I checked the arming and not the host. NO HIT FILTER, DENOMINATOR ALWAYS. `seen` and `tracked_rids` ride on every line, and the message states that an empty sample with seen=0 means the append never ran rather than that nothing diverged. SENTINEL -1. `len(output_ids)` can legitimately be 0. The per-rid map is last-writer-wins and bounded at 32 entries: the reader compares one rid across ranks, so one live value per rid is enough. Cumulative, carried in every report: WIDTH=12, IDENTITY=5 over 17 no-flip boots. At a one-in-three base rate the death form is not a signal in either direction, and this is a state reading regardless. Evidence: desk. py_compile on both files; smoke asserting the counter sits at the decode append with a working scheduler path, and that the emission sits in `pp_ring_note`. Belegstufe: DESK-BEWIESEN.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Aug 30, 2026
…e steht, aber der Umbau loest den Stall NICHT -- zwei Korrekturen an meiner eigenen Skizze
Desk-Arbeit, kein Boot. Jeder Slot am Pin relokalisiert.
Volltext: /spinning/gpu-arb/DESIGN_968_budget_verdict_to_pp0.md
== DIE KLASSIFIKATION IST DREI-, NICHT ZWEIWERTIG ==
Die Order fragt "Divergenz-Patch vs echtes physisches MIN". Die acht Slots
zerfallen tatsaechlich in drei Klassen, und die dritte ist der Grund, warum
der Umbau kleiner ausfaellt als gedacht und den Stall nicht behebt:
(a) DIVERGENZ-PATCH -- ein VERDIKT, das jeder Rang rechnet und ueber das man
sich einigt: head_match (sgl-project#823 W9), admit_limit (:6167), Prefetch-Ballot
(#791b). DIESE DREI SIND DIE LOESCHLISTE.
(b) PHYSISCHE EINGABE -- eine per-Rang-Tatsache, die PP0 NICHT SELBST WISSEN
KANN: local_avail (#616g), admission (sgl-project#610), host (sgl-project#639), mamba (#639b),
corridor (sgl-project#794). Muessen weiter reisen, aber als EINGABE in PP0s Verdikt.
(c) DIVERGENZ-DETEKTOR -- die `x, -x`-Paare, die aus einem MIN zugleich Max
liefern, also Uneinigkeit ERKENNEN. Nach dem Rang-Gesetz ist die einzig
legale Reaktion CRASH/STOP; heute speisen sie Kompensation.
== KORREKTUR 1 AN MEINER SKIZZE: die Kadenz-Deckel fallen NICHT ==
§4 Punkt 5 meiner eigenen Skizze behauptete, die sgl-project#1027/sgl-project#1028-Deckel wuerden
mit dem Umbau gegenstandslos. FALSCH. Die drei teuren Calls (memory_snapshot,
memory_stats, mem_get_info) haengen unter Slot 5, und Slot 5 ist eine
PHYSISCHE EINGABE -- PP0 kann PP1s freies VRAM nicht selbst messen. Das
Verdikt zu PP0 zu verschieben nimmt den Followern die ENTSCHEIDUNG ab, nicht
die MESSUNG. Der Stall liegt damit auf einer ANDEREN ACHSE als die
Verdikt-Platzierung: die physische Messung darf nicht auf dem kritischen Pfad
zwischen Rundenbeginn und Barriere liegen (Off-Thread-Sampling; der
`corridor-trace`-Thread existiert bereits). Beides kombinierbar, aber keines
folgt aus dem anderen.
== KORREKTUR 2 / TRANSPORT-VERDIKT: der Ring-Lap traegt es NICHT ==
pp_admission_congruence.py:235 woertlich: eine Entscheidung braucht BIS ZU
`pp_size - 1` Runden (hier 2) ueber den Lap. Und die sgl-project#1027-Sicherheitsanalyse
UEBERTRAEGT SICH NICHT -- die Asymmetrie ist der Kern:
* `trapped` (sgl-project#1027) wird ABGEZOGEN -> ein zu alter, zu grosser Wert VERENGT
einen Cut. Sichere Richtung.
* `corridor_width` (Slot 5) ist eine OBERGRENZE -> ein zu alter, zu grosser
Wert WEITET den gewaehrten Chunk. UNSICHERE Richtung, und exakt der Fall,
vor dem der sgl-project#856-F6-Kommentar an spendable_bytes:606-619 warnt.
Ein Ein-bis-Zwei-Lap-altes Budget ist also fuer mindestens einen Slot in der
unsicheren Richtung. Der Lap traegt das Verdikt in seiner heutigen Phase
nicht. XL-Fork, geht zur Meldung statt in einen stillen Umbau.
Alternativen benannt: (1) frueherer Lap-Punkt -- aendert die Rundenphasen,
Risiko bei den Lockstep-Familien; (2) Piggyback auf bestehendem Kollektiv --
kein neuer Draht, aber PP0s Verdikt raeste auf demselben Reduce, den der
Umbau abschaffen soll. Dritte Moeglichkeit (konservative Marge gegen die
unsichere Richtung) NICHT empfohlen, aber benannt, damit sie nicht spaeter
als neu auftaucht -- sie waere eine vierte Kompensationsschicht.
== AUFWAND, PRAEZISIERT ==
Loeschliste Slots 6-8 zu PP0 M (Verdikte, kein Transportproblem)
Slots 1-5 als Eingaben behalten S (Payload schrumpft, Semantik bleibt)
Stall-Behebung (Messung vom Pfad) M-L (eigene Achse)
Slot 5 unter PP0-Autoritaet XL-Risiko, UNGELOEST
EMPFEHLUNG: Loeschliste und Mess-Achse sind unabhaengig und beide OHNE den
XL-Fork machbar. Der volle PP0-Umbau von Slot 5 wartet auf die
Transport-Entscheidung.
BELEG-STUFE: DESK-BEWIESEN (Slots am Pin relokalisiert, Archaeologie aus den
Einfuege-Kommentaren, Lap-Latenz aus pp_admission_congruence.py:235).
Kein Boot, kein Code geaendert.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.