Skip to content

Debug schedule optimization - #1465

Closed
hnyls2002 wants to merge 4 commits into
mainfrom
pre-schedule
Closed

hnyls2002 wants to merge 4 commits into
mainfrom
pre-schedule

Conversation

@hnyls2002

Copy link
Copy Markdown
Collaborator

Motivation

Modifications

Checklist

  • Format your code according to the Contributor Guide.
  • Add unit tests as outlined in the Contributor Guide.
  • Update documentation as needed, including docstrings or example tutorials.

@merrymercy merrymercy changed the title Debug Debug schedule optimization Sep 22, 2024
@merrymercy merrymercy closed this Sep 23, 2024
@merrymercy
merrymercy deleted the pre-schedule branch October 14, 2024 05:10
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 17, 2026
…h priority (P only) + PASS-STALL phase stamp

sgl-project#1465: the write-through copies are KERNELS (io_backend=kernel) on
cache_controller.write_stream at default priority.  With P at
--max-running-requests 2 (weg2xsn219/221) the prefill never idles, the
copy kernels starve behind it, the un-backed backlog grows (PP2: 72 ->
103 nodes, 16 in flight, pins 4/18 -> 0/18) and the flip's quiesce flush
drains it in writing_check(write_back=True): 2.0-2.8 s (RESET JOIN 0.00 s,
bubble gate is soft 50 ms).  P->D flip 4.7-6.2 s vs 2.8 s with a gap
between prefills.  SGLANG_HICACHE_WRITE_STREAM_PRIORITY (0 default =
byte-identical); the launcher sets -1 for group P only.  'sgl-project#1465
WRITE-BACK DRAIN n= ms=' names what the flush waited for.
sgl-project#1466: weg2xsn221 still shows whole seconds without a forward on ALL P
ranks twice per request change, both inside the new request's store
probe window (STORE-TOLD INTAKE -> PUBLISHED, 3-4 s).  weg2_pass_timer
decorates recv_requests / _pp_forward_and_process_input_requests /
get_next_batch_to_run / run_batch; event_loop_pp emits 'sgl-project#1466 PASS-STALL
pass_ms fwd_ms recv_ms input_ms schedule_ms other_ms' when a pass minus
its forward exceeds 300 ms.
Tests: 1465 (4) + 1466 (4) + 1173/631/1456/1445/1459 -> 44 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 17, 2026
…caller, EVICT with backup state

With group P at --max-running-requests 2 the backup finds the node's mamba
value EMPTY (86-102 of ~120 backups on weg2xsn219/221/222/225/226; 24 with
one running request) and group D re-enters only the first 4095 tokens
(W31/W35, then an ADMISSION-WEDGE on D).  Three fixes aimed at the
write-back backlog (sgl-project#1465, sgl-project#1467, sgl-project#1468) did not move it, and no existing
line says whether the value was set at insert or who took it away.
Rate-capped 'sgl-project#1469 RETAIN rid= is_finished= token_ids_len= cache_len=
value=', 'sgl-project#1469 FREE caller= slot=' and 'sgl-project#1469 EVICT node= backuped=
host= lock_ref=' answer that.  Tests: 1469 (2) + 1467/924/pingpong -> 19 passed.
efschu pushed a commit to efschu/htsglang that referenced this pull request Oct 20, 2026
… turn-end copy, no displacement/disk I/O in the mamba claim, rank-uniform issue, sgl-project#923 a named refusal

A1: writing_check(write_back=True) waits only for the acks it needs: never an S108 DoneEvent (polled,
    kept in order); K21 and K15 drain their own node's ack only (_s108_drain_own). The flush re-polls
    and reset() joins the copier. sgl-project#1465 line: waited= skipped_turn_end= skipped_not_needed= own=.
A2: under _s108_turn_end_active the mamba anchor claims FREE room only (claim_needs_room on the mamba
    arena; _pdflip_mamba_claim skips H19 displacement and the park spill) -- no drop_unreferenced ->
    _secure_before_drop -> arena_secure_to_disk in a turn end. Full = KV-only, anchor deferred by name.
A3: no wall-clock budget (clock=None), no TP0-only mamba-full stop in a turn-end sweep; a full mamba
    arena never refuses the node on TP0 alone (KV goes out on every rank).
A4: a copier failure (sgl-project#923 row, raising pool) REFUSES the op: DoneEvent ready with .refused, the ack
    path (_s108_ack) aborts the claim, clears the host values, releases the lock, names it
    (S108 TURN-END-REFUSED) and reports through _1421_refused (R12) -- no exception in the scheduler.

Tests (serial, MemoryMax=2G, CUDA_VISIBLE_DEVICES=""): test_s108 18/18 green incl. REAL sweep ->
write_backup -> _pdflip_direct_claim -> controller (mamba full/room), drain-only-own, A4 undo, A3
structure. Review tests 66db115b2f: R1 green, R2 green, R3 (characterisation of the old rank death)
now fails as intended. Mutants red: drain waits on S108, mamba guard off, wall budget back, refused
raises, refused ack completes. Regression vs rc27 1a9b2d9 (47 files): equal; 1465 source-order test
adapted (no empty-set assert any more).
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