Repository navigation
Make stop reason a dict instead of str - #1407
Merged
Merged
Conversation
Contributor
g-drozdov
reviewed
Oct 8, 2024
| finish_reason=format_finish_reason( | ||
| ret_item["meta_info"]["finish_reason"] | ||
| finish_reason=( | ||
| ret_item["meta_info"]["finish_reason"]["type"] |
Contributor
There was a problem hiding this comment.
@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
Closed
5 tasks done
Xeonacid
added a commit
to Xeonacid/sglang
that referenced
this pull request
Feb 8, 2025
Comply with OpenAI's behavior. Example can be seen at their example [1]. See the code on the right. Fixes sgl-project#1407 [1] https://platform.openai.com/docs/api-reference/chat/streaming
1 of 5 tasks
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).
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.
No description provided.