Skip to content

Fix the double BOS problem in the HF chat template - #888

Merged
Ying1123 merged 1 commit into
mainfrom
fix-double-bos
Aug 2, 2024
Merged

Ying1123 merged 1 commit into
mainfrom
fix-double-bos

Conversation

@Ying1123

@Ying1123 Ying1123 commented Aug 2, 2024 •

Copy link
Copy Markdown
Contributor

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=True when applying the HF chat template.

@Ying1123 Ying1123 changed the title Fix the double BOS problem in chat template Fix the double BOS problem in the HF chat template Aug 2, 2024
@Ying1123
Ying1123 merged commit fbd6b94 into main Aug 2, 2024
@Ying1123
Ying1123 deleted the fix-double-bos branch August 2, 2024 07:30
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.
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