mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3676] [CLOSED] [Serve] a greedy request no longer inherits the model card's penalties (MTP stays on) #4744
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#4744
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/3676
Author: @yang478
Created: 10/22/2026
Status: ❌ Closed
Base:
main← Head:pr/serve-greedy-keep-mtp📝 Commits (1)
2290346serve: a greedy request no longer inherits the model card's penalties (MTP stays on)📊 Changes
2 files changed (+105 additions, -4 deletions)
View changed files
📝
serve/server.py(+49 -4)➕
serve/test_sampling_merge.py(+56 -0)📄 Description
Area: [Serve]
Problem and result
A greedy request (temperature 0) inherited the model card's sampling defaults, penalties included. A presence / frequency / repetition penalty makes the engine score the last
penalty_last_nlogits and turns its speculation (MTP) off for that request — and at temperature 0 a penalty cannot change which token wins. So a card like Qwen3.6-35B-A3B's non-thinking one (presence_penalty1.5) silently disabled MTP on every greedy request, for nothing.With this PR the penalty defaults are not merged under greedy unless the request itself asks for a penalty. An explicit request penalty is kept (with a one-line note in the server window); the neutral case notes that MTP stays on. Sampling at temperature above 0 is unchanged.
Related discussion
none
Approach
serve/server.py: the hand-rolled defaults merge ingenerate_eventsbecomesmerge_sampling(defaults, request) -> (merged, note). The request's own fields still win over the defaults; a null still falls back to the default.merge_sampling: undertemperature <= 0the three penalties stay at the engine's neutral values (0.0 / 0.0 / 1.0) unless the request names one of them. The rule matches what the MTP path needs: neutral penalties keep speculation on.serve/test_sampling_merge.py: 5 offline tests (no engine, no GPU): greedy neutralizes the card's penalties, an explicit penalty is kept with the note, temperature > 0 is untouched, a config-level greedy default is covered too.The diff is 2 files, +105/-4. Merges cleanly with main
011c9e6.Validation
Environment: Windows 11 (10.0.26200), Python 3.12.14, serve/ only, no GPU needed. Branch head
2290346on main011c9e6.python -m pytest serve/test_sampling_merge.py -q→ 5 passed.python -m pytest serve/test_sampling_merge.py serve/test_tool_call_envelope.py serve/test_answer_speed.py serve/test_ready_timeout.py -q→ 22 passed, 2 skipped, 36 subtests passed (the existing serve tests on the same tree, no regression).Limits
Behavior change: under greedy, a config-level or model-card penalty no longer reaches the engine unless the request asks for it. That is the point of the change, but it is a change. Everything outside greedy sampling is byte-identical.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.