mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2940] 0.1.45: non-thinking requests inherit the card's presence_penalty 1.5 (temperature 0 too), ~25% slower decode #1187
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#1187
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?
Originally created by @Cass67 on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2940
Since 0.1.45 (
a8091f4d, #2685) a request with thinking off picks up the model card's instruct set under the config's sampling block, so presence_penalty 1.5 ends up on every non-thinking request that doesn't send one. That includes temperature 0 requests, which I'd expect to be plain greedy, and a config sampling block with temperature/top_p/top_k still inherits the card's presence.On 4x 7900 XT (UD-Q4_K_XL, layer split 12,24,39, --pipeline-windows 2, MTP) it cost me about a quarter of decode: code prompt 89 -> 65-72 tok/s, prose 51 -> 44. STRATA_DECODE_TIMING shows the windows going from 32 to 47 ms, with draft and commit no longer hidden. Same request with an explicit presence_penalty 0 is back to 91-96. It looked like an engine regression at first, but the 0.1.44 engine binary was just as slow under the 0.1.45 server.py.
Maybe temperature 0 should skip the card set, and a config sampling block should replace it rather than merge on top? Setting presence_penalty 0 in the config works around it for now.
@beastrobin commented on GitHub (Oct 18, 2026):
Reproduced on Windows + RTX PRO 6000 Blackwell (sm_120), server v0.1.45 (
serve/server.pyat477ac13c). The engine binary does not matter here — your own note that the 0.1.44 engine was slow under the 0.1.45 server matches what the code says:_runmerges{**model_card_sampling(self.model_arch, thinking), **self.sampling_defaults, **self.shared}(server.py:4193) and only fields the request itself sends override, soMODEL_CARD_SAMPLING["qwen4exp"]["instruct"]'spresence_penalty: 1.5survives a baretemperature: 0./propshardcodes the thinking=True set too but that one asks for pp 1.5 by design.Measured arm, one card, all experts resident, Qwen3.8-Flash-Next GSQ-RCO IQ3_S (official pack), engine locally built from v0.1.45, parallel 4 with --batch-mtp rt drafting, config sampling block temperature 1.0 / top_p 0.95 / top_k 20 / repetition_penalty 1.1 / penalty_last_n 256 and NO presence_penalty — exactly the failing shape you describe. Non-thinking requests via
chat_template_kwargs.enable_thinking=false(a top-levelenable_thinkingis ignored by this endpoint), streamed, ~600 tokens out, same prompt template, fresh nonce each call, four interleaved pairs on an idle box:presence_penalty: 0+26.3% cost from the inherited penalty, which lines up with your quarter of decode on 4x 7900 XT. The mechanism looks universal across backends; the magnitude agrees between RDNA3 here and Blackwell there.
One difference I could not reproduce: a non-thinking arm that only sets
temperature: 0was NOT slowed here (its chunk times matched the pp=0 arm), so the per-token penalty path appears cheap when drafting is greedy on this tier — I stopped at what I measured and did not chase inside the engine. If penalty cost really rides on draft rejections under sampling only, "temperature 0 skips the card set" may be less urgent than it looked; overriding/merging (configsamplingblock replaces rather than merges the card set, or the card set drops its own presence default when repetition handling is already configured) is what bites users like us day to day.Workaround confirmed on this box, no rebuild needed:
"presence_penalty": 0inside the run config'ssamplingblock wins over the card set through the merge order, applied here and steady since. Not tested: thinking ON requests beyond noting the qwen4exp thinking set carries no presence term at all, and the /settings shared layer (svc.shared) would also win by merge order but I did not exercise POST /settings for it.@Vop3p commented on GitHub (Oct 18, 2026):
Same here on AMD, and one more piece of the mechanism: on a layer split it is not only that the sampling changes. Any penalty turns
--pipeline-windowsoff for the request. Ingenerate.cpp,pl_serialsends a request withhist_n > 0to the serial loop, and says so once per reason:It is printed once per process, so it is easy to miss. That matches your 32 -> 47 ms windows with draft and commit no longer hidden: the two cards stop overlapping.
Rig: 2x RX 6900 XT (gfx1030), ROCm 10.0, Linux, Flash-Next GSQ-RCO IQ3_S, 262144 context,
--kv int8 --kv-resident 32768, layer split with part of the experts in RAM,--spec 3 --spec-min-p 0.7,--pipeline-windows 2,"parallel": 2. Engine 0.1.45 plus two local opt-in patches (one of them keeps--pipeline-windowsfor a lone request beside--batchslots; without it this comparison is not possible on a"parallel": 2config). Same binary and config in both arms, a fresh engine per arm, requests without a sampling field, thinking off, 32K prompt, 256 new tokens, 2 runs each:samplingin the config (card set: 0.7 / 0.8 / 20 + presence 1.5)"sampling": {"temperature": 0, "presence_penalty": 0}The serial-loop line is in the first arm's log and not in the second's. The 0.1.44 server sent the same requests greedy, so it ran them on the pipeline.
+1 to both suggestions (temperature 0 skips the card set; a config
samplingblock replaces the card set instead of merging over it). It might also help to say it louder when a penalty disables the pipeline: once per process at stderr is hard to connect to "decode got slower after the update".Developed with an AI coding assistant; every number above was measured on 2x RX 6900 XT (gfx1030), ROCm 10.0, Linux.
@cybernetic-ua commented on GitHub (Oct 18, 2026):
Same symptom on Windows, engine-independent like @beastrobin showed — but our config already pins
presence_penalty: 0, so at least one MORE 0.1.45 server-side slowdown path is in play.Setup: Windows 11, RTX 5070 Ti 16 GB, 64 GB RAM, Qwen3.8-Flash-Next UD-Q4_K_XL hybrid (
--resident-budget-gib 44 --kv q4_0 --mtp rt --spec 4), run-configsamplingblock explicitly sets temperature/top_p/top_k/min_p/repetition_penalty/presence_penalty: 0. Bench: 23-turn agent replay (tool-calls, temp 1.0, top_p .95), single client, RAM window cleaned before each run.git checkout v0.1.44.1 -- serve/)So the binary doesn't matter (confirms the above), the server version does, and our delta is −45%, larger than the ~25% the inherited card penalty explains — and per the
_runmerge order{**card, **sampling_defaults, ...}the card set cannot override our explicitpresence_penalty: 0. The trigger for us is something else in the 0.1.45serve/.One visible difference between the two servers, same client, same requests: several replay turns get tokenized larger under 0.1.45 (e.g. one turn 6020 → 7839 prompt tokens; several others +1–3%). If this is the “prompt tokenisation from the last shared prefix” change re-including something per turn (thinking blocks from the previous answer?), the per-turn KV/context grows, and on a hybrid setup where experts stream from RAM/SSD, decode cost rides context hard. Or it could simply be per-token overhead in the new streaming path — STRATA_DECODE_TIMING across the two servers is the next check on our side.
Production workaround holding: 0.1.45 engine + 0.1.44.1
serve/pinned in the working tree. Bisectingserve/over v0.1.44.1..v0.1.45 (21 commits touch it) with the agent replay as the good/bad gate; will report the culprit commit here.@cybernetic-ua commented on GitHub (Oct 18, 2026):
Correction to my earlier comment above — I retract the "second server-side slowdown path" claim. It was a measurement artifact on our side, not a Strata regression.
Our rig runs the chat agent on the SAME model the bench replays (ud-q4_k_xl through llama-swap). During the night runs every agent turn reloaded a second 44 GB engine into RAM mid-bench, and our watchdog failed to kill it (a pid-namespace mismatch on MSYS). The bisect harness, once fixed to identify the bench ancestor by CommandLine, measured every
serve/commit between v0.1.44.1 and v0.1.45 — the 0.1.45 server included — at 42-52 tok/s on this same rig, identical to 0.1.44.1's server. Final anchor: engine 0.1.45 + server 0.1.45 = 48.2 tok/s median over the 23-turn agent replay, in a clean RAM window.So: no regression from the python server for us; the -45% table above is retracted as contaminated data. Sorry for the noise — the genuine finding in this issue (@Cass67, @beastrobin, @Vop3p: card-inherited presence_penalty 1.5 costing ~25% when the run config doesn't pin it) stands on its own and is the only server-side slowdown we can still reproduce... we can't, because our config pins all the fields. Production is now on the full 0.1.45 (engine + server).
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@Vop3p commented on GitHub (Oct 23, 2026):
Re-tested on 0.2.2 (engine 0.1.47, the
rx6000Linux package and a source build of the v0.2.2 tag), as the reopen rules ask: still there, and it also answers "is the rx6000 package slow" for anyone who tries it with the setup defaults.Rig: 2x RX 6900 XT 16 GB (gfx1030, PCIe 4.0 x8 each), Ryzen 5 5600X, 128 GB DDR4, Ubuntu 26.04, kernel 7.0, ROCm 10.0 driver. Qwen3.8-Flash-Next GSQ-RCO IQ3_S (native pack), 131072 context,
--kv int8 --kv-resident 32768, layer split auto (0-23 / 24-47),--spec 3 --spec-min-p 0.7 --pipeline-windows 2, no environment variables,"parallel"unset. Fresh engine per arm,benchmark.py4K / 32K / 128K prompts x 2, 256 tokens out, thinking off, no sampling fields in the request (the shape that inherits the card's instruct set). Medians of the two runs; full per-request data in the report PR linked below.samplingdecodes seriallyin the loga0116b27)ed4773eb)e88ee39d, engine 0.1.45.3)011c9e60, engine 0.1.47)rx6000package (0.1.47){"temperature": 0, "presence_penalty": 0}rx6000package{"temperature": 0, "presence_penalty": 0}Prompt speed is the same in every row (4K 460-466, 32K 759-768, 128K 871-875 tok/s), draft acceptance too (about 80-85%), 0 stalls.
STRATA_DECODE_TIMING=1on the two 0.2.2 arms without a sampling block: 31-34 ms per window = verify 27.6-30.4 + commit/emit 0.7-1.0 + draft 2.3-2.8 (the serial loop's accounting), against 25-26 ms withpresence_penalty 0where draft and commit read 0.00 (hidden behind the other window), the same as 0.1.44.STRATA_MTP_STAGE0=1changes nothing on the serial path (59.6 / 56.0 / 63.8), as expected. Swapping the package's bundled ROCm 7.1 libraries for the system ROCm 10 ones changes nothing either (61.8 / 59.6 / 61.4), so this is not the package.So on 0.2.2 the chain is unchanged from my comment above: the server's
model_card_samplingputspresence_penalty 1.5on a non-thinking request that sends no sampling; the engine'spl_serialrule sends any request with penalties to the serial loop under--pipeline-windows 2; the two cards stop overlapping, -20% decode on this split. The maintainer's own2026-10-20-0.2.1-idle-gpuA/B (pipeline windows 2 "gained 5.4% on code only") and the CUDA numbers on #3095 were taken with greedy, thinking-off requests and may have gone down the same path; the one-line log message is printed once per process, so it is easy to miss.Two ways out that keep the card's sampling for the people who want it: skip the card's presence penalty (or the whole card set) for a temperature 0 request, as @Cass67 proposed; or let the pipelined loop take requests with penalties, which is the fix that also helps requests that ask for them. Until then:
"sampling": {"presence_penalty": 0}in the run config.Developed with an AI coding assistant; every number above was measured on the machine described here. Report with per-request data: #3787.
@Vop3p commented on GitHub (Oct 23, 2026):
/reopen