Repository navigation
Conversation
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.
采样参数未启用 presence、frequency、repetition 惩罚时,跳过不改变 logits 的全词表惩罚计算;EOS 屏蔽和长度惩罚仍正常执行。
为无输出约束的 FP32 greedy 采样增加分块归约,直接计算 token ID 和 logprob,避免生成完整 softmax 缓冲;完整词表的 draft argmax 使用独立的两阶段归约。保留其他输入和采样模式的原有路径。
这些改动从 ReplaySSM 分支独立拆出,不依赖线性注意力或 SSM 状态管理。
验证:
test_greedy_sampling.py10 项通过,覆盖 NaN/Inf、并列最大值、屏蔽词表分块、EOS、惩罚和随机采样;git diff --check通过。未测量性能收益。