Skip to content

Make stop reason a dict instead of str - #1407

Merged
merrymercy merged 4 commits into
mainfrom
fix-stop-reason
Sep 13, 2024
Merged

merrymercy merged 4 commits into
mainfrom
fix-stop-reason

Conversation

@merrymercy

Copy link
Copy Markdown
Collaborator

No description provided.

@zhyncs

zhyncs commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

cc @gryffindor-rr

@merrymercy
merrymercy merged commit b912de1 into main Sep 13, 2024
@merrymercy
merrymercy deleted the fix-stop-reason branch September 13, 2024 03:47
finish_reason=format_finish_reason(
ret_item["meta_info"]["finish_reason"]
finish_reason=(
ret_item["meta_info"]["finish_reason"]["type"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merrymercy Hi! Could you please clarify why you don't return here matched field?
In the current implementation as far as i understand we can't distinguish finish_reason between EOS and our stop tokens

Xeonacid added a commit to Xeonacid/sglang that referenced this pull request Feb 8, 2025
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 16, 2026
…he host pool into a chain of window pieces

Boot xsn148 (three ~80k prompts, cap 262k): P prefilled 79,808 tokens in
22.5 s, then "WEG2 PUBLISH-SWEEP unbacked=13 issued=0 refused=13" --
write_backup refuses a node whole when the host pool cannot hold it
(77,822 tokens against P's 54,254 slots, uniform_host_avail_for_backup),
D found nothing ("ZERO-ANSWER ASKED-AND-NO"), re-queued the requests to
P (W50), and the told carrier stopped P on the re-admission (told=49150
vs own_prefix=0; a separate finding).

publish_unbacked_sweep: a node longer than _weg2_publish_window() (a
quarter of the host pool, page-aligned, at least one 4096 chunk) is split
with the tree's own _split_node into a chain: head pieces are KV-only
nodes (no mamba value, so no anchor pin is charged and the sweep does not
defer them), the original node becomes the tail keeping its anchor and
children; write_backup's parents-first recursion backs the chain up in
order, the tail is re-queued for its own turn. D's claim covers the
chain: contiguous KV prefix, trailing page with the anchor. The bubble
publisher (sgl-project#1406) uses the same sweep, so long prefixes leave the card
piecewise during the prefill.

Tests: prefetch_insert_937, landing_843, 1157, 869b, bubble_1406: 55
passed. Metal: xsn149 (three ~80k prompts).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 16, 2026
…nchor pool, chain pieces release their host copy on the store ack

Boot xsn149: PUBLISH-SPLIT never fired (window 0) -- the bound-tier host
pool wrapper carries no `size`, so the split saw an unknown pool; the
sweep refused the 77k node whole again (refused=13, D found nothing).

_weg2_publish_window reads the anchor pool's size behind the wrapper and
falls back to two chunks when no size is known (small pieces always fit
better). Head pieces of a chain are marked and, when the storage write
of a piece is acked (_drain_backup: l3_present set, host lock dropped),
their host rows are freed (EvictLayer.HOST only; the device copy stays
matchable, l3_present keeps the sweep off it), so a prefix longer than
the host pool STREAMS through it -- the host pool as transit, the arena
as the L2.

Tests: prefetch_insert_937, landing_843, 1157, 869b: 50 passed. Metal:
xsn150 (three ~80k prompts).
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 16, 2026
… node's host copy is transit and is released on the store ack

Boots xsn148-150 (three ~80k prompts, unique ~84k tokens against P's
54,254-slot host pool): write_back kept every acked host copy, the pool
filled, the publish sweep refused the rest (refused=13 on every pass),
D found nothing in the store and re-queued to P. The three ~27k prompts
of xsn146 only fit because they shared 24k of prefix.

With SGLANG_HICACHE_ARENA_DIR set (and SGLANG_WEG2_HOST_TRANSIT=1, the
default), _drain_backup frees the host rows of EVERY node whose storage
write acked (EvictLayer.HOST only; the device copy stays matchable,
l3_present keeps the sweep off it). The host pool is the DMA transit
between card and arena, the arena is the one L2 -- the form the user
asked for on 2026-09-16 -- and a prefix of any length streams through
the pool. The chain-piece release of sgl-project#1407 is the special case of this.

Tests: prefetch_insert_937, landing_843, 1157, 869b, retired_966: 62
passed. Metal: xsn151 (three ~80k prompts).
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.

3 participants