Repository navigation
Fix the double BOS problem in the HF chat template - #888
Merged
Merged
Conversation
5 tasks done
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
McZyWu
pushed a commit
to McZyWu/sgl-sglang
that referenced
this pull request
Jul 2, 2026
remove MMMU local path override, let evalscope auto-download dataset …
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 1, 2026
…les that could hold it
Two corrections, both read off this message's own output on
boot_855_1076filebacked (15:32:40): "rank 1 has held slot 0 occupied
(rids=NONE) for 90.0s".
WRONG SLOT. The throttle arm is taken when ANY slot is occupied
(`any(b is not None for b in self.mbs)`), but the message reported
`self.mbs[mb_id]` -- whichever slot the loop happened to be on. Those are
different slots, so `rids=NONE` read as "no request is stuck" when it meant
"wrong key". Every occupied slot is now listed with its own rids, and the
loop's slot is reported separately so the two can never be conflated again.
INVISIBLE THROTTLES. `_unresolved_rounds`, `_terminator_spent` and
`_offer_streak` each have exactly ONE clear site: the `elif entry.admitted:`
arm of `record_return_trip`, which runs only when the ring TURNS, while their
increments are deliberately lap-free ("the INCREMENT must survive a broken
ring, the CLEAR only has to work when the ring turns"). A stopped ring
therefore cannot clear the states that throttle the next attempt -- gate and
clearer in one cycle, the sgl-project#955 / sgl-project#888-D2 / sgl-project#858 / sgl-project#748 family, and a
self-sustaining wedge rather than a slow peer.
That hypothesis could NOT be tested against the 1076 wedge, and the reason is
the finding: none of the three is logged anywhere in the tree. Grepping them
returned zero because they have no emitter -- absence of an INSTRUMENT, not
absence of the state, and quoting that zero as an exclusion would have been
the benign-zero class this strand has paid for four times today. They are now
printed at the one moment the question is live, with the reading rule beside
them: non-zero on a stopped ring = the clearer sits behind the gate; all zero
= the throttles are innocent and the stall is upstream of admission.
Desk: matched check drives the real method with an occupied slot 1 while the
loop sits on slot 0 -- it names slot1, keeps "loop was on slot 0" separate,
and prints all three throttle values.
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.
Previously, we applied the HF chat template to get the prompt in the text format and then encode it again, but this can result in double BOS tokens. This PR fixed it by setting
tokenized=Truewhen applying the HF chat template.