Skip to content

Update readme - #434

Merged
merrymercy merged 2 commits into
mainfrom
ins
May 13, 2024
Merged

merrymercy merged 2 commits into
mainfrom
ins

Conversation

@merrymercy

Copy link
Copy Markdown
Collaborator

No description provided.

@merrymercy
merrymercy merged commit 455c9cc into main May 13, 2024
@merrymercy
merrymercy deleted the ins branch May 13, 2024 07:17
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
vschandramourya pushed a commit to vschandramourya/sglang that referenced this pull request Feb 3, 2026
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
HanHan009527 pushed a commit to HanHan009527/sglang that referenced this pull request Apr 7, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 5, 2026
…m a source that can lie

TWO INDEPENDENT DEFECTS, both rooted in reading a number or a set from the
wrong place.

(A) THE GDN BLOB THAT GOT THROWN AWAY. build_gdn_slot_executor's idle_holders
closure enumerated live offload sessions through kv_session_offload.spills.
_commit_park POPS a sgl-project#224-parked session out of spills while the session stays
alive and keeps its req-pool slot, its radix tree lock and its Mamba/GDN state
slot. GdnSlotRuntime.on_round treats a parked id it cannot find in the
inventory as DEAD and calls forget(sid) on it. So: a session spills, the ladder
exports its GDN state to a blob, the session parks its KV to the next tier, and
the next ladder round discards the blob. It later unparks, restores its KV,
resumes -- and continues with recurrent state that no longer exists. No crash,
no log, wrong tokens.

The comment ("a parked session that died while parked leaves a blob nobody will
ever ask for") was not wrong; its PREMISE was. Absence from the inventory meant
"dead" only while every live session was in spills.

Fixed with KVSessionOffloadManager.live_offload_reqs() -- spilled AND parked --
as the single enumeration, plus kv_session_spill_destination.parked_reqs() as
the one place that knows where parked requests live (inflight_batches now goes
through it too, so the abort scan and the ladder share one answer). Note the
abort scan had ALREADY been taught about parked sessions; the knowledge existed
in the module and the second consumer simply never received it, which is what a
missing accessor costs.

(B) THE HOST-RAM NUMBER. memtier/profile._host_memory_bytes read /proc/meminfo
only, and the kvso host-pool guard sized a PINNED pool against psutil. Inside
this container both are lxcfs-synthesised and do not describe what the process
may have: MemAvailable can EXCEED MemTotal (an arithmetic impossibility, so the
guard was comparing against a number that denotes nothing), and with memory.max
unlimited they report the HOST's figures on a box other containers are also
spending. Over-committing pinned memory is the OOM killer picking a victim, not
a swap.

honest_host_memory_bytes() is now the pure decision: a finite memory.max is the
ceiling (capped by MemTotal), available is that ceiling minus anon and kernel --
page cache is reclaimable and deliberately NOT subtracted, since subtracting it
would refuse boots that would have succeeded; with no finite limit MemTotal is
the ceiling and MemAvailable the estimate, CLAMPED to it and clamped again by
the cgroup's own resident accounting. Anything that cannot be established stays
None rather than being guessed, and the kvso guard then SKIPS with a warning --
refusing to guess beats refusing a good boot on a fabricated figure.

memtier owns this per DESIGN_407 §2.9 (eight ownerless psutil.virtual_memory()
call sites; this module is meant to become the owner, not the ninth), so the
guard reads host_memory_bytes_for_pinning() there rather than adding a ninth.
This is also the honest number sgl-project#547's joint pinned-RAM budget will be built on.

Tests (CUDA_VISIBLE_DEVICES=99, hermetic, no GPU, no server):
  PYTHONPATH=python pytest \
    test/registered/unit/mem_cache/test_gdn_slot_runtime.py \
    test/registered/unit/memtier test/registered/unit/server_args \
    test/registered/unit/test_kv_spill_destination_unit.py \
    test/registered/unit/test_kv_session_offload_unit.py \
    test/registered/unit/test_kv_spill_budget_unit.py \
    test/registered/unit/test_kvso_reclaim_decline_501.py -q
  -> 942 passed, 19 warnings, 103 subtests passed in 14.35s

CAN-FAIL PROVEN, both halves:
- pointing idle_holders back at manager.spills turns
  test_the_builder_sees_a_parked_session red with "Lists differ: ['s'] !=
  ['p', 's']" -- the parked request missing from the inventory is exactly the
  state in which the ladder throws its blob away;
- dropping the MemAvailable clamp turns
  test_the_impossible_meminfo_reading_is_clamped red with
  "134217728000 != 128849018880".
The live-path test executes the real reader on this machine, so neither half is
desk-written-never-executed.

Every input to honest_host_memory_bytes is passed in, so no test asserts
anything about the machine it runs on (directive sgl-project#434).

FEATURE_CATALOG gains the absent-means-dead family entry.
Handoff: /spinning/spill-night-20260804/handoffs/
TICKET_551_gdn_park_and_honest_ram.md -- half A needs a hybrid-model boot with
--kv-session-offload-max-spills 1 (to force a park) and a binding
--gdn-resident-state-slots (to force a vacate), and explicitly states that a run
in which no park or no vacate happened proves nothing.

ruff check: no new findings on any changed file. ruff format: clean on all
added lines. codespell: clean.
DouLC123 pushed a commit to DouLC123/sglang-for-sail that referenced this pull request Nov 30, 2026
…ved fork checkout (release/v0.5.23) (sgl-project#434)

Signed-off-by: Yunzshi310 <[email protected]>
WhiteCmile added a commit to WhiteCmile/sglang that referenced this pull request Dec 1, 2026
…oject#434)

Confirmation-free is the only mode: every ring round is born confirmed.
Deletes the per-round Coordinator confirmation path on both engines:

- Draft: the unconfirmed-direct ledger, ring-waiting rendezvous, seen-set
  dedup, retired-round record, held-result/source-done holds, confirmed
  flush and tombstone retirement, plus the _accept_dispatch ring branch
  (a Coordinator-forwarded ring copy is now always a protocol error)
- Target: the per-round submit of ring rounds (the pre-stamped batch
  branch of _plan_direct_ring and the wave cleanup's queued copies), the
  early-proof replay cache, and every mode check on the bookkeeping
  cleanup paths
- DT_RING_DEST_REGION is constant on (the region is a v2 row's only
  destination); the native-ingress require check goes with the flag
- dt_ring_ibgda: the confirmation-mode team fallback is dead
- tests: drop the confirmation=1 cases; cleanup doubles register in a
  real TargetRoundLedger and assert the held catch-up copies
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