mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#4463
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/3119
Author: @christopherrobertbrooks-tech
Created: 10/19/2026
Status: ❌ Closed
Base:
main← Head:fix/greedy-skips-model-card📝 Commits (1)
081e318serve: temperature 0 stays greedy - no model-card penalties on a greedy request (#2940)📊 Changes
3 files changed (+57 additions, -7 deletions)
View changed files
📝
docs/DETAILS.md(+1 -1)📝
serve/server.py(+29 -5)📝
serve/test_model_card_sampling.py(+27 -1)📄 Description
Problem and result
Since
a8091f4d(#2685) the server merges the model card's sampling under every request. A request that asks fortemperature: 0keeps its temperature but still gets the card'spresence_penalty: 1.5(Flash-Next when notthinking; Qwen3.6 in both thinking states). The engine then samples from penalized logits: the answer is not the
greedy one, and on the Qwen3.6 engine the MTP drafts never run (
specneeds!smp.needs_logits()), so everytemperature-0 request shows
drafts accepted 0 of 0. Still the case on 0.2.0-beta.With this change, when the request, the shared Chat settings or the config's
samplingblock (the first of themthat sets a temperature) asks for temperature 0, the card's penalties are left out. The rest of the card (top_p and
top_k, which greedy decoding ignores) and any penalty the request or the config sets itself still apply.
/propsreports the same. Requests that do not ask for temperature 0 are unchanged.
Related discussion
Resolves #2940: its first suggestion (temperature 0 skips the card's set). The second (a config
samplingblockreplacing the card instead of merging over it) is left alone.
Approach
model_card_sampling(arch, thinking, greedy=False)dropspresence_penalty,frequency_penaltyandrepetition_penaltywhengreedyis set;asks_greedy(*layers)says whether the first layer that sets atemperature sets 0.
_runand/propspass it. One sentence indocs/DETAILS.mdafter "Greedy is only for whoasks for it". Rebased on main (
e88ee39).Validation
Revision: this branch (main
e88ee39+ one commit). GPU runs: the v0.2.0-beta tag (3d1fb48, engine 0.1.45.3) withthis commit applied to its
serve/server.py, built for sm_70 with CUDA 12.9. Tesla V100-PCIe-32GB, i7-13700KF,16 GB RAM, Linux. Qwen3.6-35B-A3B UD-Q4_K_XL (setup's pinned file),
--native --max-context 131072 --prefill auto --mtp 2, every routed expert in VRAM,reasoning_effort: none.Passed:
python -m unittest serve.test_model_card_sampling: 8 tests OK. The two new ones(
test_greedy_gets_no_card_penalty,test_asks_greedy) fail on main (ImportError:asks_greedy).serve/test_*.pyfiles on main and on this branch: the same result for every file (see Failed).temperature: 0, 0.2.0-beta vs this branch; "true greedy" = the same request withpresence_penalty: 0added:strata-bench-v100/benchmark.py(temperature 0, fresh prompts filled to each size, 256-token answers, engine/metrics, 3 runs per size, medians), decode tok/s:"sampling": {"presence_penalty": 0}Prefill is the same in all three (1,168 / 1,733 / 1,793 / 1,606 / 1,360 / 984 / 602 tok/s).
Failed:
serve/test_responses.pyNoLeakedSampler.test_server_close_ends_the_sampler(a thread count:1 != 2), on main and on this branch alike, and on and off on 0.1.45 too.Not run: the Flash-Next engine live, AMD (HIP), Intel, Mac, and the batch path (
--batch N). This changes thePython server only, so there is no backend to build.
Limits
From 16K up the drafts cost on this card with the default FP32 K/V cache (11.6 vs 14.6 tok/s at 114,688). That is
MTP's own trade-off, the same as before
a8091f4d, not something this change adds; the long-context decode itselfis #2464.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.