Skip to content

Make the server random by default - #493

Merged
merrymercy merged 1 commit into
mainfrom
fix-random
Jun 1, 2024
Merged

merrymercy merged 1 commit into
mainfrom
fix-random

Conversation

@merrymercy

Copy link
Copy Markdown
Collaborator

No description provided.

@merrymercy
merrymercy merged commit 159cc74 into main Jun 1, 2024
@merrymercy
merrymercy deleted the fix-random branch June 1, 2024 06:33
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…ually binds

sgl-project#449 shipped the per-query-row chunking budget at 2048 MiB, above the peak it
was meant to bound on this fork's serving geometry (--chunked-prefill-size
256: 903 rows fit the old cap against 256 asked for, so the cap discarded the
whole query axis). Lowers the default to 256 MiB (the largest power of two
that binds at both SEQ_CHUNK settings), makes the transient nameable at boot
(dsv4_indexer_prefill_scratch_mib) and itemized in the pinned-reserve
shortfall note. GPU arm packaged under scripts/dev/493_indexer_transient/,
not run (falsifier: peak_bytes_max must fall ~326 MiB/rank between arms).

FEATURE_CATALOG.md §15/§16 additions merged clean (no overlap with the sgl-project#500
audit merge's §1/§2 edits — adjacent but disjoint hunks).

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree):
- test/registered/unit/layers/attention/: 152 passed, 9 skipped,
  480 subtests passed (matches pre-merge expectation).
- test/registered/unit/server_args/ + migration/cli-metadata/ratchet:
  526 passed. test_server_args_mutation_ratchet fails (count 10 > baseline
  0), but the offending lines are all in topology.py, dual_group_lane.py,
  cross_algo_utils.py and uneven_perf.py -- none of which this branch
  touches, and the same count (10) reproduces on 9fab358 before this
  merge. Pre-existing, not a regression from sgl-project#493.
- ruff check --select=F401,F821,UP037 and codespell clean on all
  touched/added files.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…ilent-wrongness sweep

Adds docs/dev/AUDIT_505_silent_wrongness.md (1692 lines, 10 commits): axis A1
(warning-instead-of-error in loader/spec/MoE), A2 (warning-instead-of-error in
memory/dist/pool), B (comment invariants as testable claims), C (numeric
defaults without a binds-proof, the sgl-project#449/sgl-project#493 class generalised), D (catalog
§14/§16 against their code predicates). Cross-cutting: the load-completeness
check binds in only 2 of 186 model loaders; reconciles with the sgl-project#501 audit's
A1-01 finding (two completeness remedies, neither general).

Corrects FEATURE_CATALOG.md §14 (Dashboard) and §16 (Measurement/window
infrastructure) with file:line-cited predicates in place of the old short
prose: wizard refusals cite their source; the anonymization gate covers the
rig-artifact share route only, NOT the sgl-project#152 result-share route, which
renders argv verbatim (sgl-project#505-D3); energy metering is GPU board power only,
not wall-socket (no knee-point probe actually exists, sgl-project#505-D6); self-update
switching needs --serve-supervised (sgl-project#505-D8); gpu-arb is a CONVENTION, not
an enforcement (sgl-project#438); forward_peak.py is off unless
SGLANG_FORWARD_PEAK_PATH is set, and that env var has no environ.py entry
(sgl-project#505-D11); CollectiveClock covers plain-prefill-only, cuda-only,
pp_size==1-only -- no decode/verify-round equivalent (sgl-project#505-D14); the
measured-KV-budget stale-boot trap only applies when the feature flag is on.

Real conflict as briefed: HEAD's sgl-project#493 merge had appended a "transient-rate
sampler" paragraph to the end of the OLD §16 prose; sgl-project#505's branch rewrote
that same prose from base, sentence by sentence, with citations. Resolved by
taking sgl-project#505's full rewrite (precision wins) and re-appending the sgl-project#493
paragraph after it unchanged, plus a one-line cross-reference noting
forward_peak needs SGLANG_FORWARD_PEAK_PATH set before use (ties sgl-project#493's
"use forward_peak's nvml_free_bytes_min" advice to sgl-project#505-D11's off-by-default
finding). §14 conflict-free (git auto-merged; HEAD never touched that
section). All 17 catalog sections and the four previously-preserved additive
paragraphs (two-axis §1, matrix doctrine §2, MERGE-DUTY owner-sites +
SITREP §12, NVENC §13) verified still present.

Verified: 1f2b24e (sgl-project#501 fix commit) is confirmed an ancestor of the
current line tip via the earlier fix/kvso-reclaim-decline-501 merge --
the sgl-project#505 audit's own warning that sgl-project#501 was absent from ITS base does not
apply to this integration line. git diff --stat d653405..HEAD -- '*.py'
empty (pure docs). codespell clean on both touched files. Scrubbed for
personal email/PAT/private-IP leakage -- no hits in either audit document.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…each with a falsifier

B3 (draft-KV-DCP now keys on the installer's own predicate
uneven_weighted_dcp_enabled(), admitting the --rank-kv-ratio route the
sibling speculation x DCP gate already accepted -- the -67% draft-KV win is
no longer unreachable for flag-route boots); B8 (validate_breakable_boot's
None arm split into a NO_SERVER_ARGS sentinel that skips vs. an unresolvable
backend that refuses by name); B10 (verdict: the kvso x speculation refusal
is DELIBERATE, not stale -- reason and the one unobserved round now in the
message, KVSO_ALLOW_SPEC surfaced in --enable-kv-session-offload's CLI help
for the first time); B2 (--rank-kv-ratio without a placement refuses by name
instead of being accepted-and-inert); B18 (the marlin uneven-TP coarsening
fold reads a per-backend marlin_packable_linear declaration instead of a
class-name list; of the three configs the audit named, only MarlinConfig
was a genuine latent gap, W8A8Fp8Config/QuarkConfig reach no marlin repack
entry point); planner/flags.py's two inverted registry edges (I-2/I-3) plus
a new contract test that drives every declared uneven-TP edge against the
live ServerArgs validation instead of trusting the registry by inspection.

Adds a status header to AUDIT_500_mechanism_reach.md §5 recording the six
fixes and two corrections-from-execution. Manually extended that header
with the sgl-project#503 B1-refutation (the sgl-project#503 branch predates B1's discovery
entirely, so it couldn't record it): combined board is now B1 REFUTED
(sgl-project#503), B2/B3/B8/B10/B18 + the flags.py registry FIXED (sgl-project#504), B4-B7, B9,
B11-B17, B19, B20 still OPEN -- one place to read the whole status rather
than two disjoint headers.

Clean auto-merge, no conflict: FEATURE_CATALOG.md's touched regions (near
the preamble, and in §1/§3/§12-adjacent prose) were untouched by every merge
since the ac84f5d base; server_args.py was untouched by sgl-project#503/sgl-project#505/sgl-project#506/
sgl-project#509 (its only other change on this line, sgl-project#493, is already inside the base).
All 17 catalog sections and the four previously-preserved additive
paragraphs (two-axis §1, matrix doctrine §2, MERGE-DUTY owner-sites +
SITREP §12, NVENC §13) verified present; the sgl-project#505 §16 corrections (gpu-arb
convention-not-enforcement, forward_peak off-by-default, CollectiveClock
prefill-only) verified present and unaffected.

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree):
- test_flag_registry_contract_500.py alone: 15 passed (exact target).
- test/registered/unit/server_args/: 532 passed, 86 subtests (up from 526
  pre-merge -- the new/extended test files account for the delta).
- test/registered/unit/planner/ (HTSGLANG_TEST_MODEL_DIR set): 2223 passed,
  1 skipped, 352 subtests -- crossing-check against sgl-project#503 (which also worked
  the planner edge): both merges coexist without collision, count is above
  the sgl-project#503-alone baseline of 2205 as expected from sgl-project#504's added tests.
- test/registered/unit/layers/moe/: 153 passed, 395 subtests (includes the
  new test_breakable_boot_gate_500.py).
- test/registered/unit/distributed/ (touched via test_marlin_unit_coarsening.py):
  24 failed, 2134 passed, 8 skipped, 721 subtests. Diffed the failing-test
  list against the sgl-project#503-merge state line by line: BYTE-IDENTICAL set of 24
  failures, only the passed/subtests counts grew (from marlin coarsening's
  new cases) -- confirmed non-regression, not just a count match.
- ruff check --select=F401,F821,UP037: 2 findings (planner/flags.py:1717
  `"Profile"`, test_rank_kv_ratio_args.py's unused `math` import), both
  confirmed pre-existing at the ac84f5d base and outside sgl-project#504's diff
  hunks. No ruff format run (CLAUDE.md: do not reformat planner/* and other
  listed subtrees -- unrelated churn buries the semantic diff).
- codespell clean on all 18 touched/added files.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…-cost probe, the F2 instrument

sgl-project#462 (the breakable MoE-offload CUDA-graph route) was already merged onto
this line long ago; this pulls in two new commits added on top since,
building the sgl-project#494 F2 measurement instrument that ticket named as missing.

srt/utils/break_cost_clock.py prices ONE CUDA-graph crossing of a
breakable capture (segment_end -> eager slot -> segment_start) with a CUDA
event pair around every segment and every break slot in
BreakableCUDAGraph.replay(). Per crossing: gap_in_ms / slot_ms / gap_out_ms
(device wait, device compute, device wait) plus host_ms split into the
four F2 terms (rendezvous, planning, publish, fetch), bracketed via
break_cost_phase() in MoEExpertOffloadCache.prepare_breakable; per round:
compute_ms / wait_ms / span_ms / residual_ms, per rank, as JSONL. Read via
SGLANG_BREAK_COST_DEFER_ROUNDS (default 2) rounds late through query()
only, so the read never synchronises the round it measures.
SGLANG_BREAK_COST_PROBE=1, OFF by default and byte-neutral off (the
disabled replay() loop is the original one statement-for-statement -- no
event created, none recorded, nothing allocated per round, pinned by a
call-count spy). Route-agnostic: any eager_on_graph break point is priced,
not only the MoE one. Reader: scripts/dev/494_break_cost/summarise.py.
21 hermetic tests, three executed can-fail arms. No GPU number exists yet
-- the probe has never run on a card; it is the instrument F2 was missing,
not a result.

FEATURE_CATALOG.md §16 conflict as expected: this branch's own base
predates every merge from today (sgl-project#493/sgl-project#505/sgl-project#459/etc.), so its diff carried
the OLD short §16 base prose alongside its new "Break-cost probe"
paragraph. Kept HEAD's full precise §16 (all of today's corrections) and
appended the Break-cost-probe paragraph after it, discarding only the
superseded old base text the branch's own diff had inherited. §3's small
in-place edit ("its instrument now exists (sgl-project#494, §16 break-cost probe)")
landed with no conflict at all -- untouched by anything else on the line.
All 17 sections and every other additive paragraph verified present.

Tests (CUDA_VISIBLE_DEVICES=99, PYTHONPATH pinned to this worktree; test
tree is tests/moe_offload/, not test/registered/):
- test_break_cost_probe_494.py + test_breakable_route_462.py: 58 passed
  (21 + 37, matching the catalog's own count for each file).
- tests/moe_offload/ (full): 2 failed, 455 passed, 34 skipped -- both
  failures in test_gguf_moe_offload.py, a file this branch's diff never
  touches. Bisected across today's entire merge history AND the prior
  session's tips back to 9fab358 (before sgl-project#500's audit branch base):
  the same 2 failures reproduce identically at every single point,
  including before this session's work began. Confirmed NOT a new
  regression from sgl-project#494/sgl-project#462 or anything merged today -- a long-standing
  pre-existing issue, out of scope for this merge.
- ruff check --select=F401,F821,UP037: 18 findings in expert_offload.py
  and break_cost_clock.py (including two F821 undefined-name hits),
  ALL confirmed pre-existing at cc5a92e and outside this branch's
  three diff hunks (import addition + two break_cost_phase() wraps).
- codespell: clean on all 6 touched/added files.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 4, 2026
… band is measured

User idea: hand Qwen the measured data plus the transcript and let it decide
who is speaking. Recorded as a three-stage design (rules -> doubt band ->
shadow-mode arbiter) with the evidence schema, the answer schema and the
fallback.

THE CALL: the restart bundle carries the EVIDENCE RECORD, the arbiter is the
cut straight after, and the split is a dependency rather than a preference.
The doubt band's edges are the numbers the section 2 measurement is being
taken for, on the NEW signal path -- after the language filter and the sticky
pin change which segments reach the comparison at all. An arbiter shipped
against the old 0.637 bar would be invoked on the wrong set of turns and its
hit rate measured against a band nobody can defend (sgl-project#493 class). The evidence
record is built for the measurement regardless and is the arbiter's later
payload, so it is built once and serves both.

THREE CONSTRAINTS recorded before they become silent defects: the arbiter
must not touch the MT history (`mt.remember`, session.py:1499-1501, six-turn
rolling context at mt.py:200-217) or it poisons every following translation;
it sits in the critical path because attribution precedes translation, so it
is affordable only inside the doubt band and a timeout is its own state, not
a blocked turn; and it is a call into the same INT8 fast lane the tenant
already uses, not a second engine.

Shadow mode is measured against corrections that already exist in the code:
resolve_line, merge_speakers, a typed name. The risk being managed is the
plausible-wrong answer -- an arbiter handed four clusters will always name
one, and it will sound reasonable doing it.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 4, 2026
…t-order finding that is not where it was reported

The standalone profile path puts a ~2.6 GiB second copy of the talker on a card
a live tenant and a serving rank already use, and on 2026-08-04 that cost
minutes of VRAM triage on an unattributed pid -- this run. It now renames
itself sglang::488-talker-profile-GUEST in both /proc/<pid>/comm and
/proc/<pid>/cmdline, so ps, top, py-spy and nvidia-smi attribute it on sight.
GUEST is deliberate: it answers the second triage question, which is not whose
process this is but whether it belongs on that card. Best-effort by two
mechanisms (setproctitle for argv, prctl for comm) because a diagnostic aid
must never kill the run it is diagnosing.

Pinned as a BINDS-PROOF rather than "the mechanism exists" (sgl-project#493): the test
calls the tagger and reads the result back out of /proc, and separately asserts
the ticket number survives the kernel's 15-byte comm truncation -- outside that
window `top` would show nothing useful. 20 hermetic, green.

The in-process path needs no marker; it runs inside the tenant's own pid.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 4, 2026
…d real speech is off

THE FAMILY SESSION ANSWERED TWO QUESTIONS AT ONCE, and one answer is against
my own code.

(1) THE OVERLAP FILTER DESTROYED A REAL UTTERANCE. Line 6 of the live
transcript is `speaker-interjection`: "Hallo Lamina Mahl, es waere nett, wenn
ich eine Unterschrift..." -- a German sentence from a real person, discarded.
The floor it lost to was line 5, `es`, "!Gracias por ver el video!": a 0.88 s
segment carrying the canonical Whisper hallucination, at language confidence
1.000. The rule behaved exactly as specified and still deleted speech,
because THE LANGUAGE THAT HELD THE FLOOR WAS FABRICATED. A filter whose input
can be invented must not have destructive authority, so `overlap_discard`
defaults to OFF; the mechanism and its arms stay, and the default is now
itself a pinned assertion. It goes back on with a trustworthy floor (minimum
floor-segment duration plus a hallucination check), calibrated, not guessed.
It also logged NOTHING when it fired -- found by reading the transcript and
noticing the speaker id. Destructive decisions now log loudly.

(2) THE LAST TURN WAS THE WEDGE, not a discard: line 8 has a decision record,
a speaker and no translation. The metrics that only started flowing at this
restart put a number on it: `tts_first_audio_seconds_max = 193.36 s` for one
synthesis, against a 5.4 s median. So the provisional 90 s unit deadline
BINDS on the real distribution rather than sitting above it (sgl-project#493) -- the
number that justifies it was measured, not assumed.

THE DEADLINES. asyncio.timeout around recognition, around each synthesis
UNIT, and around the drain. On expiry the worker is CANCELLED (abandoning it
keeps the card busy), the turn fails loudly with its stage named, and exactly
ONE automatic re-drive follows -- queued and drained OUTSIDE the turn lock,
because `redrive` takes that lock and retrying from inside would deadlock the
session more interestingly than the bug being fixed.

TWO SCOPING MISTAKES THE PINS CAUGHT, both worth recording. The drain timeout
first wrapped the whole block and swallowed MT's own timeout, bypassing its
retry. And the auto-redrive first fired on any retryable failure, which
reintroduced through the recovery door exactly the retry
`test_a_stream_that_already_spoke_is_not_restarted` forbids. It is now
limited to the SYNTHESIS stage: each stage owns its retry policy, and this
one exists for the stage that had none.

Falsifier: probe-free, in-suite. A talker that accepts a unit and never
yields; with the deadline the turn fails and the NEXT turn still works, and
the measured control is that without it the same call hangs (8 s cutoff,
"HUNG -- the wedge"). Plus a control that a healthy turn does not trip it.

Also: the DELETE session route existed all along and had no CALLER -- four
gate runs took the slots to 5 of 8, and at 8 the user cannot open one. The
gate now releases what it allocates. And a read-only harvester,
collect_family_session.py, which is what produced the two findings above.

520 passed, ruff and codespell clean. NOT deployed in this commit.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 5, 2026
…ledger

The ledger's CALIBRATED half has never been measured on a card and the model
as a whole has never been checked against a real boot. This makes both a
window ticket that is pure execution rather than improvisation.

scripts/vram_ledger/calibrate_cards.py -- gate (a). One subprocess per card,
pinned with CUDA_VISIBLE_DEVICES=GPU-<uuid>: the UUID form, never an index.
An index here is sgl-project#349 sweep-3 arm L, where a budget was accepted against one
card and the rank then bound another. Per-card time box; a hang is killed and
named, never waited on. A partial run writes NOTHING -- a cache file missing a
card makes that card's term unbounded at the next boot, which reads as a
ledger bug rather than as the incomplete measurement it is.

The card set and driver come from card_probe._inventory(), the same source
live_fingerprint() reads at boot. Not incidental: the fingerprint is a hash of
those two, so assembling either differently would write a good calibration
under a key the boot never looks up -- the cache would miss forever while a
valid-looking file sat beside it. A test pins the two keys equal.

scripts/vram_ledger/compare_boot_peaks.py -- gate (b). Samples per-card VRAM
at 100 ms (the interval that caught sgl-project#493; 1 Hz would have reported a healthy
card), parses a boot log and the production recipe, and emits a per-term delta
table. The gate is that the difference is EXPLAINED, not that it is small: an
unexplained residual of any size is a finding, an explained one of 800 MiB is
not.

docs/dev/TICKET_582_vram_ledger_gpu_gates.md -- acceptance criteria for both
gates, what falsifies each, and the window running order. Section 3 gives the
per-rank activation correction its own decisive falsifier: co-locating two
ranks on the 5090 versus splitting them predicts a 3968 MiB difference between
the ledger's model and the one it replaced, far above any noise. It also names
the cheap pre-check (per-process sampling of both rank PIDs) that can settle it
without spending two boots, and says what to do if it IS falsified -- charge by
the ranks that can prefill simultaneously, not revert to a shared constant.

Mock smokes (22 tests, CUDA_VISIBLE_DEVICES=99) found three real bugs before
any window:
  * the ledger-row regex was anchored at line start, so it matched a
    hand-written sample and would have matched nothing in a real prefixed log
    -- the harness would have silently reported "no itemization" on a ledger
    boot, inside the window, with no time to debug it;
  * --duration 0 returned having sampled nothing;
  * an unresolvable inventory raised a traceback instead of naming the
    CUDA_VISIBLE_DEVICES pin that caused it.
The parser is now pinned by a round trip against the REAL renderer rather than
against a hand-written imitation that can drift from it.

Tests: 64 passed test/registered/unit/mem_ledger/, 551 passed
test/registered/unit/server_args/ (unchanged baseline). ruff check + format +
codespell clean.

Not proven until the window: every calibrated number, the modeled terms against
any real recipe, the per-rank activation correction, whether the mechanism caps
bound their transients at the charged values, and multi-tenant co-residence.
Torches97 pushed a commit to Torches97/sglang-for-sail that referenced this pull request Dec 1, 2026
…Flash (sgl-project#494)

Why:
- The Fast Sanity (deepseek-v4.1-flash) PPU recipe on zhenwu_m890 needs --engram-config '{"lookup":"all_reduce"}' for Engram lookup.

How:
- Add --engram-config '{"lookup":"all_reduce"}' to variants.default.extra_args in test/ppu/recipes/deepseek-ai/DeepSeek-V4.1-Flash.yaml.
- Regenerate test/ppu/README.md via scripts/ci/ppu/ppu_recipe.py render-matrix.
- Register --engram-config in _sample_sglang_parser() in scripts/ci/ppu/test_recipe_ci.py.

Test:
- python3 -B scripts/ci/ppu/ppu_recipe.py validate --all --sglang-parser skip
- python3 -B scripts/ci/ppu/ppu_recipe.py render-matrix --check
- python3 -B -m unittest discover -s scripts/ci/ppu -p 'test_recipe*.py' (136/136 passed)

Refs sgl-project#493
Torches97 pushed a commit to Torches97/sglang-for-sail that referenced this pull request Dec 1, 2026
…Flash (sgl-project#494)

Why:
- The Fast Sanity (deepseek-v4.1-flash) PPU recipe on zhenwu_m890 needs --engram-config '{"lookup":"all_reduce"}' for Engram lookup.

How:
- Add --engram-config '{"lookup":"all_reduce"}' to variants.default.extra_args in test/ppu/recipes/deepseek-ai/DeepSeek-V4.1-Flash.yaml.
- Regenerate test/ppu/README.md via scripts/ci/ppu/ppu_recipe.py render-matrix.
- Register --engram-config in _sample_sglang_parser() in scripts/ci/ppu/test_recipe_ci.py.

Test:
- python3 -B scripts/ci/ppu/ppu_recipe.py validate --all --sglang-parser skip
- python3 -B scripts/ci/ppu/ppu_recipe.py render-matrix --check
- python3 -B -m unittest discover -s scripts/ci/ppu -p 'test_recipe*.py' (136/136 passed)

Refs sgl-project#493
1195343015 pushed a commit to 1195343015/sglang that referenced this pull request Dec 2, 2026
…Flash (sgl-project#494)

Why:
- The Fast Sanity (deepseek-v4.1-flash) PPU recipe on zhenwu_m890 needs --engram-config '{"lookup":"all_reduce"}' for Engram lookup.

How:
- Add --engram-config '{"lookup":"all_reduce"}' to variants.default.extra_args in test/ppu/recipes/deepseek-ai/DeepSeek-V4.1-Flash.yaml.
- Regenerate test/ppu/README.md via scripts/ci/ppu/ppu_recipe.py render-matrix.
- Register --engram-config in _sample_sglang_parser() in scripts/ci/ppu/test_recipe_ci.py.

Test:
- python3 -B scripts/ci/ppu/ppu_recipe.py validate --all --sglang-parser skip
- python3 -B scripts/ci/ppu/ppu_recipe.py render-matrix --check
- python3 -B -m unittest discover -s scripts/ci/ppu -p 'test_recipe*.py' (136/136 passed)

Refs sgl-project#493
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