Repository navigation
Fix env vars in bench_latency - #1472
Merged
Merged
Conversation
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 17, 2026
…sgl-project#1471 wake verdict exceptions logged weg2xsn229-231 (P --max-running-requests 2): group D's read at the hold delivers 4095 of ~98k tokens for 20+ s after P served the prompt, with the L3 index on (xsn230) and off (xsn231), while P's flush reports every node published. No line named the first unreadable page or the path that refused it, and no line gave a write-through's issue->ack latency. sgl-project#1472 READ-TRACE (hicache_storage._readable_stems): first missing stem, no-file vs partial, arena hits (rate-capped). sgl-project#1472 WT-ACK (_finish_write_through_ack): issue->ack latency per write-through and the count still in flight. The wake verdict's silent except in _weg2_release_dormant_hold now logs the exception (sgl-project#1471 SETTLE n/a). Tests: 1471/1470/1459/1386/1068 -> 75 passed.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 28, 2026
…with a writer the settle hold waits for its ack instead of re-reading every 2 s NF rc12z17-s0 (103bfdf, D log boot ...09281111): weg2-2-17 (41021 tokens, route=short straight to D) read 40512 of 40960 at the wake 11:18:00, then 'sgl-project#1456 HOLD-REFETCH zero-answer' n=2..4 every 2 s beside 'sgl-project#1442 HANDOFF-KEYS NONE registry=[]' and 'sgl-project#1472 READ-TRACE why=no-file', until 'sgl-project#1471 SETTLE-RELEASE lapsed=True held_after_wake_s=20.0' and 'X-GATE uncached=509 verdict=admit' -- the admission it would have had at 11:18:00. weg2-4-36 (1757, 20.0 s) and weg2-5-37 (191, 20.7 s) the same; 7 such holds per rank in that boot. Nobody was writing: the missing pages were D's own decode tail of the previous turn (never secured when D slept), and P never saw the requests. After D's wake the only process that can still fill a parked read is P (D awake = P asleep; D's own write-through writes pages D holds on its device, and a page on D's device is a device match, never a store read). What D can SEE of P per rid lives in the shared hand-off directory: the hand-off chain (weg2.handoff record / handoff_keys.CHAIN_ATTR on the request) and the E-tail parts (weg2.tail_handoff: a *.tmp part or a manifest short of its PP ranks = still writing; a complete manifest = the publish ack). weg2/settle_writer.py classifies (pure: classify, step) and observes (listing at most every 100 ms per request): * none (no chain, no hand-off record, no tail part, nothing under write) -> decided now: the request goes to admission without another re-read (within X D prefills it; over X the X gate refuses by name and the front re-routes via P). Line '#1471w SETTLE-NO-WRITER rid remainder X route=D|P held_s re_reads', then 'SETTLE-RELEASE state=no-writer lapsed=False'. * p-writing -> no re-read until the ack (the re-read cannot see pages that are not there). * p-published -> the ack: re-read now, past the 2 s timer, once; still short after it = no writer left -> decided. * p-handoff (P prefilled it, no tail parts) -> P's page write-through has no D-visible ack: the 2 s re-read stays, unchanged. * unknown (no shared hand-off directory) -> no writer provable: unchanged. '#1471w SETTLE-WRITER rid writer prev action' on every change of state. Only requests already seen short (_1471_short) are classified; a read in flight ('reading') is never decided. Every verdict goes through the existing group MIN of the settle tick (due-vote and release-vote), so a rank that still sees a writer holds the group. No switch: the lapse released the same request 'as it is' 20 s later. Tests test_weg2_settle_writer_p4b_0928 (9): on 1bab093 (module present, tick unwired) 4 red -- metal form not released (and re-read), over-X not released, tail part under write re-read on the 2 s clock, publish ack not re-read before the timer -- with the fix 9 green. Neighbours touching the settle tick / refetch / _1471_short (store_told_hold_tk, p_mamba_retention_h113, 27b_park2_metal, hold_refetch_uniform_xsn296, park_l3_248, post_wake_settle_1471, revoke_reissue_1479, store_short_tail_settle_rc2, x36_settle_dormant): 79 passed on the base, 79 with the fix. Metal marker: '#1471w SETTLE-NO-WRITER ... route=D' within ~1 s of the 'sgl-project#1324 STORE READ INCOMPLETE' of a route=short request, 'SETTLE-RELEASE state=no-writer lapsed=False held_after_wake_s' < 1; no 'lapsed=True' for such rids; the X-GATE admit follows at once.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 14, 2026
…or room instead of ending the prefix NF h8 2b27c61 (boot 1014_115938), P: of 10 boot-start requests 9 loaded exactly their store depth; weg2-0-10 (1853 pages in the store, presence 118592) loaded 56320 -- the whole 8 % (62272 of 750464 tokens). Not a missing file. PP0 12:04:14: the 1024-page batch had 47 pages in the arena, filled 837 from disk ('sgl-project#1433 837 of 837'), and 140 stems found the shared arena FULL (ARENA-PRESENT complete 0 -> 6484 of 6485 in 27 s of boot-start reads; 'ARENA-EVICT need=140', every slot referenced by a read or pinned by a running load-back). Those stems got no slot and ended the prefix at 884 pages; the room came back within seconds (complete 5981 at 12:04:45). Fix: after the fill read its own claims, the stems that are still FULL are evicted + claimed again every 25 ms, at most SGLANG_WEG2_L3FILL_ROOM_WAIT_MS=1500 (prefetch io threads only; 0 = the old form); what gets a slot is read at once, the prefix is cut on what landed. Own claims past a FULL stem are no longer freed unread. The sgl-project#1472 READ-TRACE no-file lines come from _collect_existing_component_keys, which asks every component for every key (mamba is sparse by design); no unlink in this boot (store file count 47055 -> 47792, monotone), and _stat_stems already strikes a no-file stem from the L3 index and the evictor. Tests: py_compile OK; test_l3fill_join_wait_0930.py (+2: full arena waits for room, thread gate).
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Oct 23, 2026
…probe, probe=n:keys:wall:cpu)
Boot boot_weg2_dkr27bint4arbar1int4ar10231444_a45112428e_1023_144422, D TP0 14:49:12-36Z: 34 gaps of 450-580 ms
cause=other, run_ms ~20, spans recv/admit/result < 50 ms, "rest" 400-500 ms -- no span named it. In the same rounds D
re-probed two hand-backs the lifetime gate refused (D-ADMIT-AFTER-REFUSALS refusals=37 waited_s=20.1
gates={lifetime:37}): sgl-project#1439 ARENA-PRESENT keys=118709 / 107619 census=[(0, n)], sgl-project#1472 READ-TRACE asked=512 readable=0
why=no-file, sgl-project#1035 R13 EMPTY KV PREFIX, every round.
HiCacheFile.batch_exists_v2 (the one presence probe all paths take) now reports keys, wall and the CPU of the thread that
ran it (functools.wraps decorator, instrument only) to d_decode_gap.note_probe; the tracker takes them per decode round,
prints probe=n:keys:wall_ms:cpu_ms on the D-DECODE-GAP line and names the gap store_probe when the probes' thread CPU
is at least half of the unnamed rest (also counted in the census). No decision reads it; rank-local, no collective.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix environment variables which can lead to OOM issues