mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5213] [Engine] DFlash2 confidence ignores --kv-resident: a 32 GB card with KV streaming gets 0.35 where its 8,312 slots want 0.5 #3104
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#3104
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 @sdroege on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5213
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
On a single 32 GB R9700 running Qwen3.8-Flash-Next UD-Q4_K_XL with
--max-context 163840 --kv-resident 32768, an Auto/DFlash2 start picks--draft-conf 0.35. The engine's own log saysexpert cache 8312 slots, anddrafting.CONF_STEPSprescribes 0.5 for 7,500 to 12,000 slots.Measured on this machine, same start otherwise, 3 rounds each, 1,000-token generation:
--draft-confAgainst the MTP on the same build, 0.35 is about -3.4% decode and 0.5 is +8.2%.
Cause (static analysis).
strata_control/drafting.py:505expected_slots()reads--max-context,--kv,--vram-reserve-miband--prefill, but not--kv-resident, and callsvram_fit.session_mib(ctx, kv)without the streamed window. For this config that prices the KV session at 2,382 MiB instead of 792 MiB, 1,590 MiB too high, which is 815 slots. With the window counted the estimate is 11,558, which is the 0.5 step; without it, 12,373, which is the 0.35 step.The estimate is still high after that (11,558 against the engine's 8,312). The remaining gap looks like the nominal 32 GB against 30.7 GiB usable and
SLOT_BASE_MIBnot covering the DFlash2 drafter and draft head, but that part is a separate finding and I have not isolated it.Smallest steps or command that reproduce it
--kv-residentbelow--max-contextand no--draft-conf.--draft-conf 0.35.expert cache N slotsline: 8,312 here."user_args": ["--draft-conf", "0.5"]and start again: decode improves.Expected: the confidence matches the slots the engine actually holds.
Actual: 0.35, one step too low.
Related: #5109, #5129, #5178 (same family: the automatic confidence is wrong for the card).
Proposed fix: read
--kv-residentinexpected_slots()and pass it as the third argument tosession_mib, which already supports it.Reproduction status
Reproduced locally for the symptom; the code cause above is unconfirmed static analysis (I did not patch and rerun).
Strata version
Strata 0.2.10, engine 0.1.56
Graphics card, memory and system
Radeon AI PRO R9700 32 GB, 121.5 GiB RAM, Fedora 44 (kernel 7.2.13-200.fc44.x86_64)
@tskorupka-emiteo commented on GitHub (Nov 5, 2026):
Another card class with the same symptom: one RX 7900 XTX 24 GB (gfx1100, HIP), Qwen3.8-Flash-Next IQ3_XXS, engine 0.1.56,
--max-context 262144 --kv int8 --kv-resident 32768, Auto/DFlash2.--draft-conf 0.7, the 3,000-7,499 step.expert cache 10712 slots, andCONF_STEPSprescribes 0.5 for that.Decode, short prompt, 400 output tokens, greedy, medians of 5-6 per arm. Each value is a separate engine start, run back to back:
--draft-confSo 0.5 is +11% over the automatic value here, and 0.35 is clearly worse, which matches the 7,500-11,999 step of the table. The only way I found to keep 0.5 across starts was
user_argsin the run config with the server started directly (see #5178), becausestrata launchregenerates the config.