Skip to content

Some warnings to crash when CI - #1009

Merged
hnyls2002 merged 2 commits into
mainfrom
ci-crash
Aug 9, 2024
Merged

hnyls2002 merged 2 commits into
mainfrom
ci-crash

Conversation

@hnyls2002

Copy link
Copy Markdown
Collaborator

Thank you for your contribution, we really appreciate it. The following instructions will help improve your pull request and make it easier to receive feedback. If there are any items you don't understand, don't worry. Just submit the pull request and ask the maintainers for help.

Motivation

Make some user warnings to crash when in the CI.

Checklist

  1. Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  2. Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  3. Modify documentation as needed, such as docstrings or example tutorials.

@hnyls2002
hnyls2002 enabled auto-merge (squash) August 9, 2024 22:06
@hnyls2002
hnyls2002 disabled auto-merge August 9, 2024 22:06
@hnyls2002
hnyls2002 merged commit 73fa2d4 into main Aug 9, 2024
@hnyls2002
hnyls2002 deleted the ci-crash branch August 9, 2024 22:16
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
Hide-on-bushsh pushed a commit to Hide-on-bushsh/sgl-project that referenced this pull request Jul 20, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 29, 2026
…s run

The precondition guarding result processing asks only half its question:
`self.mbs[next_mb_id] is not None` says the slot HOLDS a batch, never that the
batch has RUN. On a PP=3 box carrying a single short request the two come
apart inside one iteration -- the slot is filled by this round's admission and
the result step for that same slot runs before any forward has happened, so
`next_batch_result` is still None and absence is consumed as a result.

Boot 68 measured it inside one second at 07:50:17: ADMIT on all three ranks
(rid 43452758, prefix_lens=0 fill_lens=3 out_lens=0), then sgl-project#1003 on PP0 AND
PP1, then sgl-project#1008 holding the request. No forward in between. And no void
anywhere -- 797/798/951/984 all zero -- so nothing had been cancelled; the
pass had simply not run yet.

That single gap produced the whole ladder this window has been climbing. The
prefill result is consumed as absent, so out_lens stays 0; with sgl-project#1008 in place
the request is then held for ever and the instance dies idle on the 120s ring
budget; without sgl-project#1008 it was decoded instead, which is exactly where the
DECODE-labelled 3-token extend, the [1]-vs-[3] graph copy and the
causal_conv1d_update bounds failure all came from.

Not a consumer guard: a slot's result exists only after its pass ran, and this
writes that precondition down where it is used. Nothing is dropped -- the
batch stays in the slot and is processed when its result lands. The counter is
bounded in output but cumulative in value, because "settles after the first
rounds" (the pipeline filling) and "grows with traffic" (passes not
completing) are different diagnoses.

Two corrections ride along. sgl-project#1003's own text blamed a void for the absent
result; boot 68 measured the entire void machinery at zero, so that
attribution was mine, wrong, and is retracted in the message itself -- the
instrument said more than it had measured, which is the class this window
keeps finding in other people's code. And a nested duplicate
`if d2h_event is not None:` left by an over-broad replacement in #1002d is
removed; it was harmless but it was noise at a line that matters.

Evidence: desk, executed. py_compile on both files; the precondition appears
once, no nested duplicate survives, and sgl-project#1003 no longer claims a void.
Belegstufe: DESK-BEWIESEN -- BOOT-BEWIESEN needs the probe to return tokens.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 29, 2026
…n it

sgl-project#1008 held correctly and boots 68 and 69 still starved. The request sits in
the running batch, the hold keeps it out of decode, and
_get_new_batch_prefill_raw declines at its very first gate --
`(running_batch.batch_is_full or len(self.waiting_queue) == 0) and
self.chunked_req is None` -- because the request has already left the waiting
queue. Held by one path, invisible to the other, and the instance dies idle on
the 120s ring budget holding a request it never ran. Both boots died that way,
and boot 69 died of it again after sgl-project#1009 had correctly stopped absence being
consumed as a result.

DELIBERATE DEVIATION, named as the standing order of 2026-08-29 requires. The
convention that a request in the running batch is no longer a prefill
candidate encodes "running means its prefill has run". That is true upstream,
where prefill and decode share a round. It is false for a PP request whose
result is still in flight, and following it here produces a request nobody
owns. So the convention is set aside at this one point rather than executed
into a starvation.

THE DOUBLE-ADMISSION ARGUMENT, which is what makes the re-queue legal against
the #968b prohibition: a request goes back only when NO microbatch slot still
holds it and it is not the chunked carry. It has just been filtered out of the
running batch, it is not in the waiting queue -- that is precisely why the
gate fired -- and no slot references it. No door leads to it at all, and the
queue is the only one left. Nothing is reset or truncated; it returns exactly
as it stands, so no executed prefix is recomputed (Kein-Doppel-Prefill).

The slot census is taken BEFORE the filter, because after it the batch no
longer names the requests being judged.

Counter is cumulative and says what a bad reading looks like: a total that
keeps growing for the same rid means the prefill still never completes, which
would be a different defect than the one this fixes.

Evidence: desk, executed. py_compile; the slot census precedes the candidate
selection, the candidate selection precedes the filter, and the re-queue
follows it. Belegstufe: DESK-BEWIESEN -- BOOT-BEWIESEN needs a served prefill.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 30, 2026
…and falsify (a)

(b) FIXED and DESK-PROVEN. `pool_tokens` was `max_total_tokens or 0`, and
`arena_tokens` is `kv_pool_tokens or kv_depth_tokens`, so every boot that does
not pass --max-total-tokens silently priced its arena as
`chunked_prefill_size * 64`. On the sgl-project#855 boot that is 4096*64 = 262144 -- a
number that LOOKS like the context length and tracks it not at all. Proof of
the defect: the refusal text was byte-identical at --context-length 131072.
Proof of the fix, end to end through launch_server: the same command now
prints "for a 131072-token arena". When --max-total-tokens is unset the arena
is now --context-length, which is the operating point the operator actually
stated.

(a) NOT FIXED -- root identified, effort reported instead of a rushed change,
because this gate is the one that prevents the 2026-08-05 OOM class and an
error in the permissive direction re-opens it.

FALSIFIER (scripts/int8_368/falsifier_1009_running_cut.py): price the RUNNING,
SERVING cut with the solver's own model. It is infeasible on all three ranks:

  stage0 5090: resident 35517.4  budget 31800  headroom -4741.4  feasible=False
  stage1 3080: resident 21874.5  budget 18800  headroom -4098.5  feasible=False
  stage2 3080: resident 19512.1  budget 19800  headroom  -736.1  feasible=False

ROOT, from the census itself -- the terms are physically impossible:

  rank  params+pools+graphs   NVML used   excess
  pp0        38644.2 MiB      30464.8    +8179.4
  pp1        21405.8          16986.6    +4419.2
  pp2        22070.7          17652.6    +4418.2

A process cannot hold more than the driver reports it using. CUDA-graph
memory lives INSIDE the torch caching allocator's pool, so counting
`graphs_mib` as a separate addend beside `pools_mib` double-books it. The
excesses are the same order as the headroom deficits, which is why real
configurations price as infeasible.

The fix belongs in the census/calibration semantics (residency_census.py's
graphs_mib derivation and the residual it feeds), NOT in the solver's search:
the search is correct given its inputs. Sizing: M, and it must be
NVML-reconciled -- the invariant to enforce is
params + pools + graphs <= nvml_used, asserted per rank at census time, so a
double-count can never again leave the instrument silently. Until then
--pp-solve-cut cannot emit a cut for this rig and the PP pins stay hand-set
and UNACCEPTED.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 30, 2026
…mitted, and it COSTS pool

Merged 338af39 (c77c904) and re-ran --pp-solve-cut on census-855-v2.
BOOT-PROVEN: server up, coherent (Paris / 143-67=76), deadman armed.

THE SOLVER EMITTED A CUT -- the PP layer split is no longer hand-pinned:

  --pp-layer-ratio 32,17,15  (attention per stage [8,4,4] of 16)
  makespan=3089.6ms  pacer=stage1  min_headroom=48MiB

The predicted dip line appeared verbatim and is admissible, not a warning:
stage0 peak occupancy 157.0 MiB above the at-rest reserve, 48.0 MiB of the
205 MiB allowance left.

AND THE RESULT IS A REGRESSION ON THE NUMBER THIS STRAND CARES ABOUT.

  PP-phase per-rank capacity, hand pin [32,18,14] -> solved [32,17,15]:
    PP0  616,670 -> 643,198   (+26,528)
    PP1  725,191 -> 729,329   (+4,138)
    PP2  640,066 -> 592,677   (-47,389)   <- now the binding rank
  PP WORLD (min)  616,670 -> 592,677  = -23,993 tokens, -3.9 %
  TP id space     616,670 -> 592,677  (it is sized to the PP id space)
  TP global                           1,264,320

This is not a defect in the peer's fix, and I am not asking for it to be
tuned. It is the OBJECTIVE: --pp-solve-cut calls solve_pp_cut, whose stated
job is "minimizes the lockstep prefill makespan subject to a hard per-rank
memory constraint" (server_args.py:16701). It bought makespan and paid for it
in pool, which is exactly what it was asked to do. The world min is a MIN, so
moving a layer off the poor stage is what matters, and [32,17,15] moved one
ONTO it.

THE LEVER THIS EXPOSES, PRESENT-BUT-UNWIRED: pp_cut.py already carries
solve_pp_cut_for_kv_floor (:1361) and world_kv_floor (:1327) -- a solver whose
objective IS the KV floor. It has NO flag. Its only caller in the whole tree is
solve_pp_cut_for_kv_floor_at_seam_fixed_point inside pp_cut.py itself
(:1913); grep across python/sglang/srt for a call site outside that file
returns nothing. So the objective the operator actually wants was built and
never wired to a boot.

That is the honest next step for the 1M question, and it is small: a second
symbolic value for --pp-solve-cut (or a --pp-solve-objective kv-floor) that
dispatches to the existing solver. I am NOT building it in this message --
flagging it so the choice of objective is made deliberately rather than
inherited, since makespan and pool trade against each other and this boot is
the measurement that proves they do.

Both pins now fall on the PP side (--pp-stage-ratio and --pp-attn-stage-ratio
are gone; the solver materialises --pp-layer-ratio and chose attn [8,4,4]
itself). The TP weight vector 32,16,16 remains hand-pinned: there is still no
solver emitter for it (server_args.py:8612-8617 refuses when it is None).
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.

1 participant