mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1646] [CLOSED] fix(api): honor chat logit_bias on CUDA and HIP #3578
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#3578
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/1646
Author: @CC-David-CC
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:fix/chat-logit-bias-1627📝 Commits (2)
5022b58fix(api): apply request logit biases in CUDA and HIP sampling356aee0docs: demonstrate Hello token bias with measured before and after requests📊 Changes
39 files changed (+3376 additions, -10 deletions)
View changed files
📝
CMakeLists.txt(+3 -0)📝
docs/DETAILS.md(+2 -0)➕
docs/LOGIT_BIAS.md(+80 -0)➕
docs/measurements/logit-bias-1627-20261008/README.md(+96 -0)➕
docs/measurements/logit-bias-1627-20261008/cuda/build-state.json(+8 -0)➕
docs/measurements/logit-bias-1627-20261008/cuda/parser.txt(+1 -0)➕
docs/measurements/logit-bias-1627-20261008/cuda/python.txt(+354 -0)➕
docs/measurements/logit-bias-1627-20261008/cuda/sampler.txt(+12 -0)➕
docs/measurements/logit-bias-1627-20261008/english/complete.json(+6 -0)➕
docs/measurements/logit-bias-1627-20261008/english/engine.txt(+40 -0)➕
docs/measurements/logit-bias-1627-20261008/english/rows.json(+183 -0)➕
docs/measurements/logit-bias-1627-20261008/hip-live/baseline.txt(+45 -0)➕
docs/measurements/logit-bias-1627-20261008/hip-live/complete.json(+8 -0)➕
docs/measurements/logit-bias-1627-20261008/hip-live/mtp.txt(+83 -0)➕
docs/measurements/logit-bias-1627-20261008/hip-live/off.txt(+77 -0)➕
docs/measurements/logit-bias-1627-20261008/hip-live/rows.json(+700 -0)➕
docs/measurements/logit-bias-1627-20261008/hip/build-state.json(+8 -0)➕
docs/measurements/logit-bias-1627-20261008/hip/live-state.json(+5 -0)➕
docs/measurements/logit-bias-1627-20261008/hip/parser.txt(+1 -0)➕
docs/measurements/logit-bias-1627-20261008/hip/python.txt(+360 -0)...and 19 more files
📄 Description
Resolves #1627.
Chat requests accepted logit_bias without applying it. This patch applies per-request biases in CUDA/HIP target sampling, including greedy decoding and ordinary MTP.
Why Hello?
Hello is familiar, is one token (ID 9419) in the tested tokenizer, and is naturally emitted for this prompt. 9419 is a token ID, not a logit/probability; -100 is the requested bias and means exclusion here. Nothing is banned by default.
Same prompt: "Reply with one English greeting, one word only." Temperature 0, max_tokens 8, reasoning_effort "none". Only logit_bias changes:
"logit_bias": {"9419": -100}"logit_bias": [[9419, false]]All four English checks passed on llm-60. Token IDs depend on the tokenizer; a token ban is not a universal word ban.
52 further HTTP checks passed across CUDA and HIP, including MTP, streaming and 103,215 bans. Both builds, 276 Python tests per backend, parser tests and three GPU sampler parity paths per GPU passed. Matched no-bias outputs agree with pristine main
fb58e0db.Invalid input fails before streaming. Older engines, SYCL and continuous batching reject nonempty biases. Multi-GPU and experimental coupled/probabilistic MTP were not validated. No throughput claim.
Full before/after requests and raw results
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.