Repository navigation
[Fix] Fix logprob and normalized_logprob - #1428
Merged
Merged
Conversation
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
…DCP extend path Boot kvt6d (16.09. 15:35Z, D-layout TP3 uneven DCP + MTP + graphs, --kv-tail-min-tokens 16384, no memory saver): READY after 120 s, ring 36864 rows/rank bf16, 0 tracebacks at boot. On the needle request the verify plan attended 3 tail rows (6 ring rows held) but tail_merges stayed 0 and the W56 falsifier stopped the step by name: the sgl-project#1426 merge hook sat only on the non-DCP forward_extend, while this layout runs _forward_extend_dcp. Fix: after each of the two paged body reads of _forward_extend_dcp (prefill_wrapper_paged .forward_return_lse over q_full) the rank-local body partial is merged with the rank-local ring partial (_kv_tail_merge_verify) BEFORE cp_lse_ag_out_ar_mha_uneven -- the tail is a partition of this rank's owned set. _kv_tail_merge_verify accepts the 3-D q_full unchanged (the tail wrapper is planned with the same iu.num_qo_heads as the body wrapper). Tests: test/registered/unit/mem_cache/test_kv_tail_1243.py 127 passed, 19 subtests (hermetic); new Test1428: every DCP paged read is followed by the tail merge before the LSE all-gather; merge accepts 3-D q.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…ICE counter, so a CUDA-graph replay counts Boot kvt7d (16.09. 16:06Z, D-layout TP3 uneven DCP + MTP + graphs, --kv-tail-min-tokens 16384): READY after 120 s, 0 tracebacks at boot; the DCP verify merge (sgl-project#1428) ran (tail_merges rose to 288 during graph capture). On the needle request the verify steps replayed captured graphs: the tail wrapper's kernels ran, but note_merge() is Python and a replay runs no Python, so tail_merges_this_step stayed 0 and the W56 falsifier refused a tail that WAS read (W56 raised from init_forward_metadata_out_graph -> _kv_tail_plan_verify -> plan). Fix: KvTailRing._merge_dev, an int64 device scalar bumped in note_merge() by a captured kernel; plan() (out of graph) reads it and folds the delta into tail_merges / tail_merges_this_step before the W56 judgement. Eager steps count once (delta == Python count), replays count on the device only. reset() zeroes it. Tests: test/registered/unit/mem_cache/test_kv_tail_1243.py 130 passed, 19 subtests (hermetic): replayed-graph merges (device bump, no note_merge) are accepted; eager merges are not double counted; reset zeroes the device counter.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 16, 2026
…ject#1285 retry too. xsn188 died at the first wake with W4 although P answered /resume_memory_occupation 200: the kv_cache leg went out on the shared pooled session without an epoch, a stale keep-alive connection raised ServerDisconnectedError before any response line, and plain rpc() has no retry. Both KV legs now go through leg_rpc with credit_epoch(boot_epoch, epoch) -- one retry on a fresh force_close connection, deduplicated on the far side by the epoch-scoped leg ledger. Tests: 1285, 1233, 1394/1369 green.
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.
There are multiple bugs in how we compute the logprob and normalized logprobs. Sometimes the logprobs of input tokens are not returned correctly.
This PR cleans up and fixes them.