fix(qwen35): size the TP sampling scratch from the decodable vocab#761
Open
FeathBow wants to merge 1 commit into
Open
fix(qwen35): size the TP sampling scratch from the decodable vocab#761FeathBow wants to merge 1 commit into
FeathBow wants to merge 1 commit into
Conversation
Signed-off-by: Feathbow <feathbow@gmail.com>
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.
Description
Fixes #760
#676 bounded token selection to the tokenizer's decodable vocabulary and sized every logits arena from
selection_vocab, but it did not touchtp_executor.rs, where the tensor-parallel worker still built itsSampleScratchfrom the checkpoint's paddedvocab_size— a line that predates it, from #627.select_batchrequires the scratch width to equal the logits width, because a mismatch would otherwise be a silent kernel out-of-bounds rather than a clean error, so on any checkpoint whose tokenizer stops short of the padded width every tensor-parallel prefill and decode failed withselect_batch: logits vocab 248077 != scratch vocab 248320. Qwen3.5-4B is such a checkpoint, so TP serving was broken for it.The four tests that cover this path — the two
hf_golden_gateTP2 logits gates,e2e_schedulerTP2, andserving_tp2— are all#[ignore]because they need two CUDA devices, NCCL, and weights, which is why CI stayed green.After the change the only remaining uses of
vocab_sizein this crate are the narrowing comparison itself and the checkpoint tensor-shape validation, both of which want the padded width. Qwen3 and Kimi have no equivalent narrowing and are unaffected.Type of Change