Skip to content

Optimize mem indices mangement - #619

Merged
hnyls2002 merged 2 commits into
mainfrom
optimize-mem-idx
Jul 14, 2024
Merged

hnyls2002 merged 2 commits into
mainfrom
optimize-mem-idx

Conversation

@hnyls2002

@hnyls2002 hnyls2002 commented Jul 14, 2024 •

Copy link
Copy Markdown
Collaborator

This #418 can promise that the ref count of token_to_kv is at max 1.

Just avoid the torch operation when computing the available size, and use an int var instead, which can bring improvement from 88.1 token / s to 88.8 token / s, approximately 0.8%

@hnyls2002
hnyls2002 merged commit 564a898 into main Jul 14, 2024
@hnyls2002
hnyls2002 deleted the optimize-mem-idx branch July 14, 2024 06:39
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 Aug 7, 2026
… attribution — barlink_abort_gate gains a rank-local replay tag (kind, key, ordinal, seq) written host-side at replay launch on all four graph runners (full, breakable x2 per segment, multi-layer-eagle per rung); Bar1CollectiveAborted now prints REPLAY WINDOW and dumps the capture census in the abort path (first-dying rank never reaches the scheduler-tick dump — closes that half of sgl-project#619, expiry path still open); no device read, no sync, no .item(), key stored by reference with identity assert; 16 hermetic tests + 5 single-line can-fail reverts + 14/14 real-GPU replay smoke on the 5090; suite deltas exactly +16 vs base, 20 pre-existing fails unchanged; family root deliberately NOT claimed — 03:23 wedge dump shows all ranks on the identical owner.py:548 host stack, censuses byte-identical, NOTE_622 records hypotheses and confounds)
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 7, 2026
…capture-census dump — the rank whose compute stream is stuck fires the staged-read warning but never reaches the abort handler, so it dumped no census (the rank-2 gap of the 02:02 crash); _wait_ctl_event now dumps the SAME collective-free census after N expiries (SGLANG_BARLINK_EXPIRY_CENSUS_AFTER, default 3, 0=off), once per process via a bool latch; shares format_local_capture_census with the abort path — structural test pins exactly two callers, no body duplication; 7 new hermetic tests + 616f suite 27 green with stub updated; Qwen draft, operator verified commit, wiring lines and test run)
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 7, 2026
The fixture patched only sys.modules, but 'from package import module'
resolves through the parent package attribute once the real module was
imported earlier in the same pytest process (any prior test file in the
directory run does this), silently bypassing the mock: the three
threshold tests then saw zero dump calls. Patch the parent package
attribute as well. Directory run debug/ now 361 passed (was 3 failed);
pairwise 616f+619 34 passed. Same interference class as the flash_mla
same-process findings.
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