mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4373] [Engine] STRATA_MTP_TOP2 always counts 0 runner-up hits: record_top2() is no longer called #1938
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#1938
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 @pschaub on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4373
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
The problem: Strata drafts a few tokens ahead with the model's MTP layer, and the full model then checks them. The diagnostic
STRATA_MTP_TOP2=1counts how often a rejected draft would have been right with the draft layer's second choice. That shows whether a second draft branch would pay off. On main it always counts 0, whatever the model does, because nothing calls the function that records the second choice any more.The fix: Call it again in the two places where it was called when the diagnostic was added. A PR with the fix follows.
What it brings: The diagnostic works again. On my PC the second choice was right for 39 % of the rejected drafts, where main reports 0. Without the variable nothing changes.
Who it helps: Everyone who uses
STRATA_MTP_TOP2to decide about tree drafts or a second draft branch.Where it breaks:
record_top2()is still there:github.com/Niko1221/Strata@5e8a4cca7d/src/core/mtp.cpp (L556-L574)2312c83badded it together with two calls indraft(), after the first draft and after each further step:github.com/Niko1221/Strata@2312c83bfd/src/core/mtp.cpp (L878-L894)The merge of the Aurora gfx1151 branch onto 0.1.39 (
bc6b6f87) kept the function and lost both calls. Since thentop2()stays -1, so this comparison never matches:src/program/generate.cpp#L16680-L16683
The "0 of 14" in #2227 comes from this too.
Measurements: Qwen3.8-Flash-Next IQ3_XXS with setup's configuration, 6 fixed chat prompts (greedy, thinking off, max_tokens 300), 36 requests per build in 2 sessions:
Smallest steps or command that reproduce it
CMAKE_CUDA_ARCHITECTURES=120).STRATA_MTP_TOP2=1in the environment.strata serve: mtp top2: rejected/runner-up by depth N/0 N/0 N/0 0/0 of N windows, always 0 after the slash.Reproduction status
Reproduced locally
Strata version
main between 0.2.4.2 and 0.2.5, built from source; the code involved is unchanged in 0.2.7
Graphics card, memory and system
RTX 5090 32 GB · 64 GB RAM · Windows 11 (driver 621.01, CUDA 13.4)
Model, size and settings
Qwen3.8-Flash-Next IQ3_XXS (setup's GSQ-RCO file) · 131072 context · pictures on · setup's configuration for this PC (--spec 4 --spec-min-p 0.5 --expert-cache auto --prefill auto --kv int8 --kv-resident 32768 --vram-reserve-mib 700)
Logs
Two requests, each on main and with the two calls back. These runs use fixed settings (the FIXED list in
tools/quant_quality.py), so both builds give the same text and the same windows.main:
with the fix:
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. 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.