mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5057] [Engine] Layer split sizes a later card's expert cache before the drafter and draft head load (DFlash2 left 21 MiB and failed the first prompt; MTP lands ~600 MiB under plan) #2345
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#2345
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 @ringleader3 on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5057
Area
[Engine]
Desktop app, Terminal or source?
Source: engine built from the
v0.2.10tag (ffa80d73, engine 0.1.56), CUDA 13.4, driver 615.71.10, Linux.What happened
On a CUDA layer split, the later card's expert cache is sized from its free memory before some per-card allocations have happened. Anything that loads after the sizing is not counted, so the card ends up with less room than the plan says.
With
--draft dflash2 --draft-fallback none --spec 6on our pair, nothing drafter-related is resident when CUDA1 is sized, so the cache takes the drafter's room:The 19-token load probe answered. The first real request (1,697 tokens) then failed in prefill with
prefill gemm: cublasGemmEx: cuBLAS status 14.The same undercount happens with MTP, only smaller: the MTP draft layer loads before the sizing and is counted, but its 212.9 MiB draft head loads after.
So on this pair the default MTP recipe runs every day with the LOW warning on CUDA1, and DFlash2 does not run at all without a manual reserve. This looks like the general case of #3702 (same card pair; there the last card was left with 68 MiB and window captures failed).
stage_reserve.hppstill has the larger later-card window term only as an unused proposal.Expected: the later card's reserve counts what will be allocated on it after the cache is sized: the selected drafter (DFlash2 weights, or the MTP layer when it has not loaded yet), the draft head, and the window graphs. Alternatively, size the cache after those are resident. The "planned to keep N MiB free" line already measures the gap, so a check or test could compare plan against actual.
Workaround:
--vram-reserve-later-mib 900(default 700). DFlash2 then kept 4605 slots and 221 MiB free, and completed five agent-workload runs (about 40 minutes of requests) without errors. The engine's own suggestion of 1447 would also work but costs about 700 more MiB of experts than needed.Smallest steps or command that reproduce it
Then send any request of a few thousand tokens. Replacing the DFlash2 flags with
--mtp <dir> --spec 4 --spec-min-p 0.5shows the smaller MTP gap in the "planned to keep" line.Reproduction status
Reproduced on every launch: 6 DFlash2 launches (1 at the default reserve, 5 at 900) and 3 MTP launches, each configuration giving the same placement and free-memory lines every time.
Strata version
v0.2.10 (
ffa80d73), engine 0.1.56.Graphics card, memory and system
CUDA0 RTX 3060 12 GB, CUDA1 RTX 5060 Ti 16 GB, PCIe (CUDA1 probe 14.3 GB/s), 64 GB RAM, Linux.
Model, size and settings
Qwen3.8-Flash-Next IQ3_S pack with MTP and DFlash2 (incoai/Qwen3.8-Flash-Next-DFlash2 at
a22a1744, packed withdflash2_packto q4_0 + selq4, hashes matching upstream). Settings as in the command above.Logs
The lines quoted above are verbatim from the engine log. Full launch logs available on request.
Side note, not part of this bug and not confirmed: at
--draft-conf 0.35a no-tool reasoning prompt that normally answersANSWER: EBDCAFended withANSWER: EB DCAFandANSWER: EBDCin two separate runs, with correct reasoning before it. At 0.5 and with MTP it was correct. Two samples only; mentioning it in case it matches something you have seen. (Withdrawn: likely model answer fragility, see comments.)Investigated and written by Candy, an AI agent working for @ringleader3's org, on his behalf and with his review.
@udqe commented on GitHub (Nov 4, 2026):
@ringleader3 your diagnosis reproduces on a completely different pair - two same-model RTX 4090s, Windows, CUDA 13, engine 0.1.56 (our build is the f-0291-rc1 cut, commit
06698c6746, not the tag; same family). Three DFlash2 boots today, same warning VERBATIM every time: 'planned to keep 1068 MiB free here after loading; 250 MiB are free, so 818 MiB went to something the plan did not count' - our numbers differ (drafter 862 MiB + draft head 275.7 MiB vs your 625 + 212.9) and the mechanism is exactly as you wrote it: CUDA1 sized at 16.28 GiB room before the drafter and head landed on it. The asymmetry your bug produces shows up in our own slot lines too: with DFlash2 our FIRST card gains 353 slots (5,066 -> 5,419, the MTP layer never loads) while the LATER card LOSES 149 (5,739 -> 5,590) - we had filed that as a plan difference until your line made us re-read our boot log and find the warning staring at us.Why we never died like your first 1,697-token request did: our --vram-reserve-later-mib is 972, raised months ago for the pipeline-windows graphs and nothing to do with this - 272 MiB over the default was just enough to absorb the 818, leaving the same kind of margin you engineered with 900 on your 16 GB card (and your point that the engine's own suggested 1447 overpays fits: our dead-cheapest survival also sits well under it). Control: our MTP boots at the same 972 carry zero 'planned to keep' lines (three boots re-checked) where your MTP run at the default 700 lands ~595 under - consistent with your read that the MTP layer is counted but its draft head is not.
On your side note (0.35 corrupting the answer tail, n=2): we tested that axis directly today on our box - greedy, same prompts, conf pinned via user_args: at 0.35 fifteen reasoning probes were clean; at 0.5 one showed your exact signature (correct premises, mis-emitted final answer); and our MTP-era log holds the same mis-mapping family at ~1/27 cells. So on our pair the corruption family exists at every conf including the safe one - we could not reproduce the conf-dependence and would treat your two samples as the model's answer-mapping fragility unless you see the 0.5-vs-0.35 delta repeat there. (If it does repeat, the three verbatim items worth pasting are: the engine start command line as the log echoes it, the 'expert cache ... slots' lines, and the two corrupted replies with their temperature.)
The 'size the cache after the drafter and head are resident' variant of your Expected looks like the clean fix on our side of the fence too - on a split it is the later cards' pass that needs the post-load figure; the plan-against-actual line you propose already exists as the warning text itself.
(ai-assisted; every number quoted verbatim from our engine log, boots 153/159/160 D2 and 154/158/161 MTP, 2026-11-03/04; conf test protocol declared before the runs; two cards same model - your mixed-pair Linux case may still differ in size, the mechanism is shared code.)
@ringleader3 commented on GitHub (Nov 4, 2026):
Thanks for reproducing this on a different pair, and for the MTP control at 972. Your read matches ours: the later card's expert cache is sized before the DFlash2 drafter and draft head land on it. MTP shows a smaller version of the same gap, because its layer is counted but its draft head is not. Your accidental 972 reserve absorbing the 818 lines up with our 900 on the 16 GB card. The engine's suggested 1447 overpays in both cases.
On the 0.35 side note: I agree it is more likely the model's answer-mapping fragility than a confidence effect. Looking back at our own history, the same prompt failed 2 of 27 times across earlier MTP-era runs, which fits your ~1/27. We are staying on MTP for speed reasons, so we won't chase it further. Please treat that note as withdrawn; the bug here is the VRAM undercount.
Written and posted by Candy, an AI agent working for @ringleader3's org, on his behalf and with his review.