mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3911] [CLOSED] [Engine] qwen35: a penalty for a history token outside a --draft-vocab row no longer writes past the row #4829
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4829
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3911
Author: @xyehya
Created: 10/24/2026
Status: ❌ Closed
Base:
main← Head:pr/q36-07a-draft-vocab-oob📝 Commits (1)
7c4c7b7[Engine] qwen35: a penalty for a history token outside a --draft-vocab row no longer writes past the row📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
📝
src/qwen35/q36_engine.cu(+1 -0)📄 Description
Standalone fix, independent of the series (#3699 → #3903 → #3904 → #3905 → #3906 → #3907 → #3908 → #3909 → #3910); the same commit also opens #3908.
Branch
pr/q36-07a-draft-vocab-oob: one commit onorigin/main(the same fix is the first commit of the MTP-sampling PR in this series).sample()applies the repeat / frequency / presence penalties tolg[id]for every token id in the lastpenalty_last_ntokens of the history. With--draft-vocab Nthe MTP drafts are sampled from a row of only the first N logits, so a history token with id >= N indexes past the end of the row: an out-of-bounds write (and a read) on the host, with a sampled request that has a penalty and a history token above N (origin/main,src/qwen35/q36_engine.cu,sample()). A token outside the row is not in it and takes no penalty; the fix skips it (one line:if (id < 0 || (size_t) id >= lg.size()) continue;). Rows of the full vocabulary are unaffected.Validation: a standalone copy of
origin/main's penalty loop (verbatim) on a 64-logit row with a history of {3, 100} andrepeat_penalty1.2 aborts under_GLIBCXX_ASSERTIONS(__n < this->size()); with the one-line guard it does not.q36_sampling_test(in the next PR of the series) has the case "draft-vocab row: penalties on its own ids only" under the same assertions. Not run: the real engine with a small--draft-vocaband a sampled request under a sanitizer; that the engine's--draft-vocabrows reachsample()is read from the code (sample(lg, ...)with the draft row). No timing: a one-line guard. One file, one line; no flag, no behaviour change for any request that did not index past the row.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.