Skip to content

feat: update Dockerfile - #1033

Merged
zhyncs merged 2 commits into
sgl-project:mainfrom
zhyncs:new
Aug 12, 2024
Merged

zhyncs merged 2 commits into
sgl-project:mainfrom
zhyncs:new

Conversation

@zhyncs

@zhyncs zhyncs commented Aug 11, 2024 •

Copy link
Copy Markdown
Contributor

Motivation

Inspired by #999 so I co-authored with @vhain

  • verify CI
  • support cu118, cu121, cu124
  • verify cu121, cu124 image
  • verify cu118 image

Modification

  1. update Python 3.10 on Ubuntu 20.04
  2. use GitHub Matrix to support SRT only (all build tasks are parallel)
  3. support cu118

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.

@zhyncs zhyncs added the wip label Aug 11, 2024
@zhyncs zhyncs self-assigned this Aug 11, 2024
@zhyncs
zhyncs marked this pull request as draft August 11, 2024 18:26
@zhyncs zhyncs mentioned this pull request Aug 11, 2024
3 tasks done
@zhyncs zhyncs changed the title feat: support Docker SRT only feat: update Dockerfile Aug 12, 2024
@zhyncs
zhyncs marked this pull request as ready for review August 12, 2024 06:07
@zhyncs zhyncs removed the wip label Aug 12, 2024
@zhyncs
zhyncs requested a review from ispobock August 12, 2024 06:07
@zhyncs

zhyncs commented Aug 12, 2024

Copy link
Copy Markdown
Contributor Author

@vhain For stability, we have decided to continue using NVIDIA's image as the base image. I switched the base image to runtime, which cut down 2-3 GB.

@zhyncs
zhyncs merged commit cb99ba4 into sgl-project:main Aug 12, 2024
@zhyncs
zhyncs deleted the new branch August 12, 2024 06:24
@zhyncs

zhyncs commented Aug 12, 2024

Copy link
Copy Markdown
Contributor Author

Hi @vhain May you try the latest image? Thanks.

docker pull lmsysorg/sglang:latest-srt

@vhain

vhain commented Aug 17, 2024

Copy link
Copy Markdown
Contributor

Thanks @zhyncs ! I think this change looks solid and shouldn't have any issue. I will surely test it out, but for now I think our production nodes might continue to run our own image, which uses python:slim as a base image due to the size difference.

I do agree that using NVIDIA base image will be more stable for sure, but our specific use case requires to make the image pulling to be quick as possible to make autoscaling possible. Thanks!

timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
JinyanYi pushed a commit to JinyanYi/sglang that referenced this pull request Jul 27, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…t waited for a chunk the gate refuses to build

BOOT-PROVEN EDGE (boot_855_1050dev_0840f82601_0831_115825, the boot 20
livelock). The open question of the handover was WHY the broken chunk never
completes before the 30 s abandon. It is not a race: inside the armed window
12:22:19-12:22:49 PP0 logged ZERO `Prefill batch` lines and 15 `Decode batch`
lines. The chunk was never attempted, and the re-arm is in the SAME SECOND as
the abandon (12:22:49), so no unarmed window existed in which it could be.
N9's remaining candidate (abandon deadline vs chunk completion time under
growing backlog) is therefore FALSIFIED.

THE BINDING TERM, with file:line. `prefill_blocked_here`
(phase_purity.py:1087-1095) grants the sgl-project#887 one-chunk exception only when BOTH
`prefill_allowed_in_tp_now(spent)` AND `tp_compute_fits_in_one_chunk` hold --
deliberately, so the gate and the sgl-project#838 detector permit the same batches
(REGISTER_OPEN_876 on sgl-project#887). `tp_compute_fits_in_one_chunk` is `0 < pending <
chunked_prefill_size`. The last grant was 12:22:11 with new_tokens=3392 against
a 4096 cap; the backlog then crossed the cap and never came back (12347 ->
48866 -> 101075 tok), so the gate refused on every later round, SILENTLY, at
its final `return not _relaxed(...)`.

The grant is spent AT the grant (`_spend_tp_compute_chunk`), so a refusal on
the `fits` term leaves the budget untouched. The hold
(`prefill_runnable_in_current_layout`, phase_flip_runtime.py:156) read ONLY
that budget, kept answering "TP can still make progress", and
`chunk_blocks_quiescence` kept the rank un-quiescent for ever: PP0 armed 29 /
committed 4 / abandoned 48, `this rank ready=0` in all 72 abandon lines,
backlog 4618 -> 101075 tok.

CLASS: a hold predicate that predicts another gate's decision in a different
currency. SIBLING SWEEP over the three consumers of the sgl-project#887 grant: the gate
itself reads both terms; `maybe_arm_phase_policy` (sgl-project#942, scheduler.py:13611-
13632) reads both terms and says so in its own comment; the flip hold read
one. The fix makes the third consistent with the two that were already right,
by passing the gate's OWN side-effect-free probe rather than a second copy of
it. FUTURE CHECK: a new reader of `tp_compute_budget_remaining` that makes a
runnability claim must also read `tp_compute_fits_in_one_chunk`.

AND THE OPERATOR'S CONDITION, which turns this from a deletion into a
replacement. Once the hold correctly reports "this layout cannot finish the
chunk", the cutover commits over the broken chunk. That is licensed by sgl-project#988
riding the prefix across (loss <= 1 chunk = the sgl-project#939 grant) ONLY while the
COMPLETED pages are settled in the store. The old strict arm blocked on
"incomplete"; it now blocks on the real hazard -- an unacked prefix -- read
from the EXISTING sgl-project#792/sgl-project#703 fence (`ongoing_write_through`, the same counter
sgl-project#1050's `reclaim_rows_for_drop` and `on_idle` gate on), never a second ledger.
Unknown is refusal, never permission. The hold is bounded by the ack
(milliseconds), with the 30 s park deadline still the outer backstop; no
second clock.

UNTOUCHED AND PINNED BY TEST: mid-admission (no pool row -> still blocks),
non-strict (residual, still filed not solved), and pp_to_tp drain-and-flip
(runnable HERE -> still blocks, which is what keeps all prefill in PP).
The PP-microbatch-in-flight half has its own predicate and is not read here.

DETECTION: `_why_not` returned one string for three different holds. It now
names which term is holding, including the new unacked-prefix case.

DESK CHECK (matched to the error class of this edit -- a control-flow
inversion in a restructured predicate, which py_compile and import smoke are
structurally blind to): devtools/check_1033_quiescence_edge.py, 24 cases,
hermetic CUDA_VISIBLE_DEVICES="", all pass. Includes a RED-FIRST arm that
evaluates the PRE-FIX expressions on the measured boot-20 state (budget 2,
pending 48866, cap 4096) and asserts they produce the wedge, and the POST-FIX
expressions on the same state and asserts they commit only against an acked
prefix. Plus compile + import + an order proof that both probes are assigned
before either read inside get_next_batch_to_run.

NOT YET BOOT-PROVEN. This is DESK-PROVEN at the predicate; the metal proof is
boot 21.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 31, 2026
…the one that stopped

Detection posten (b) of the sgl-project#1033 forensics. Upstream's sentence -- "Server
couldn't get a response from detokenizer" -- names the LAST link in the chain
as the suspect. Measured 2026-08-31 on the boot-20 livelock specimen
(specimen_1051_detok_hang): the detokenizer was idle in recv_pyobj with its
last work finished and nobody sending, while the scheduler spun arm/abandon on
a flip that could never reach quiescence. The line pointed a whole window at
the wrong process.

Upstream text kept VERBATIM so the known string still greps, with a fork clause
after it that says what the silence means and names the three scheduler alarms
that identify the link which actually stopped (ADMISSION-WEDGE / FLIP ABANDONED
/ ARM-UNFUNDED). Log text only; no behaviour change, no new call.

Companion (not in this repo): devtools/boot_deadman.sh now carries the same
three markers as a STARVED-ADMISSION tier.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 1, 2026
…d a pp_to_tp/tp_to_pp livelock, 0 decode

Bisected against a51e5e8f28 (last decode-green boot, 297 decode batches).
git bisect narrowed to an ambiguous parent/child pair
(96bdb4a / 67b08b8) after several sgl-project#631-style crash-only commits
were skipped; direct-parent verification (67b08b8^ == fdb7b21, the
last confirmed-good commit) resolved it definitively in favor of
67b08b8 ("[sgl-project#1033] The flip hold asked half the one-chunk grant").

That commit added two new terms to the pp_to_tp/tp_to_pp quiescence
predicates: `fits_in_one_chunk` in `prefill_runnable_in_current_layout`
and a new `completed_chunk_pages_acked` ack-gate consumed by
`chunk_blocks_quiescence`. Root-caused via a first, WRONG partial revert
(kept `fits_in_one_chunk`, reverted only the ack-gate) that still failed
on the metal with a NEW symptom: 51 flips alternating every 27-40s (a
flip-flop livelock, 0 decode) plus a separate sgl-project#928-anchor retraction loop
on one request. Reading the full original diff showed the pre-sgl-project#1033 code
never had an ack-gate either (unconditional `return False`), so that half
of my hand revert was a no-op; `fits_in_one_chunk` was the actual driver.

This reverts 67b08b8's entire diff (both functions plus the
scheduler.py wiring in `build_flip_quiescence_fn`), applied at the
current branch tip via `git revert --no-commit` rather than a blanket
file-copy from the old commit: none of the 12 commits that touched these
two files between 67b08b8 and this tip touch these functions (only
one, [#1054d], and it edits an unrelated region ~11000 lines away), so
the revert applied with zero conflicts and preserves every later commit's
work in both files intact.

Per upstream-minimal: the sgl-project#1033 mechanism was itself a fork-own
compensation layer over the sgl-project#887 one-chunk grant; its own defect (an
unreachable-in-practice "both halves must agree" premise that instead
produced a livelock) makes it a deletion candidate, not a repair target.
Deleted the now-stale devtools/check_1033_quiescence_edge.py alongside it
(it exercised `fits_in_one_chunk`/`completed_chunk_pages_acked`, both
gone).

Test results (BOOT-PROVEN, two independent boots, driver load
disc631_driver.py --duration 480 --words 24000 --concurrency 2):
  - boot_855_fullrevert1033_67b08b87b6_0901_044806.log (smoke, at the
    bisect commit): VERDICT=GOOD, 15 decode batches, single clean
    pp_to_tp flip (no flip-flop), 0 crashes.
  - boot_855_tiprevert1033_2b23c255fb_0901_050011.log (this exact commit
    content, at branch tip): VERDICT=GOOD, 12 decode batches (accept
    rate 0.66), single clean pp_to_tp flip (3 reconciled rank-flips, no
    flip-flop), 0 Tracebacks, 0 sgl-project#631 crash markers, 0 sgl-project#928-retraction
    markers.

Not yet run: the >=30 min real-router-agent-load acceptance test
(Phase 3). This commit closes Phase 1/2 (bisection + root-cause fix,
boot-proven) only.
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