mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4098] [Engine] --prefill-head-alias: every request fails with "native head upload: out of memory" #1789
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#1789
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 @PierpaoloPernici on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4098
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
With
--prefill-head-alias --short-read 0on a 32 GB card, the model starts and reaches "ready", then every request fails with HTTP 400:and the server prints:
The prompt is read (no prefill error), then the head cannot be put back. It is not a slow path and not the #2065 memory-pressure warning: the request simply does not complete, at any context size I tried, on a card whose expert cache is filled to the reserve on purpose (276 MiB free at request start).
The numbers say the flag's own free-VRAM figure is about 426 MiB optimistic while the head is 497 MiB (521 472 000 bytes), so any
--vram-reserve-mibbelow about 925 MiB fails.--vram-reserve-mib 960— the value the engine itself suggests in the #2065 warning — is enough.--vram-reserve-mib 700(what setup wrote into this install) and832are not.--vram-reserve-mib--max-context 16384--visionremoved--kv-grow)Two things are worth separating:
--kv-grow), so a reserve that passes the start-up check cannot hold the 497 MiB head at the end of a prompt read.tools/ab_engine.pyposts one warm-up answer before it treats the server as ready; against this config it made the server restart the engine 34 times in 8 min 44 s (34 "engine started" lines in that arm's log, 13:00:53 to 13:09:37) and never got ready. Worth knowing because a bug that is one failed request in the log looks like a hung install from the outside.Smallest steps or command that reproduce it
From a source checkout with a Qwen3.8-Flash-Next IQ3_S pack (the flags below are the install's own
strata-<model>.json, plus the two the alias needs):Same with
--vram-reserve-mib 960instead of700: the same request answers 200. Reproduced 3/3 at 700, 1/1 at 832; works 1/1 at 960 and 1/1 at 2000.Reproduction status
Reproduced locally
Strata version
Strata 0.2.5 (source checkout
41cf05a0), engine 0.1.50 (engine/strata --version->strata 0.1.50), built 2026-10-25.Graphics card, memory and system
NVIDIA GeForce RTX 5090, 32 GiB VRAM (compute capability 12.0), driver 615.78.08 · AMD Ryzen 7 9800X3D, 8 cores / 16 threads, 62.2 GiB RAM · Linux 7.3.0-5-cachyos.
Model, size and settings
Qwen3.8-Flash-Next GSQ-RCO IQ3_S (2 shards: main + PLE table), 262144-token context,
--kv int8,--expert-cache auto(expert cache 10 162 slots / 19.28 GiB; 11 790 slots / 22.37 GiB with--kv-grow), MTP draft layer (--spec 4 --spec-min-p 0.55), pictures on,--vram-reserve-mib 700in the install's config.STRATA_DEQUANT_WIDE=1,STRATA_GDN_CHUNKED=1.Logs
Start-up, reserve 700 (fails):
Same build, reserve 960 (works):
Request failure (reserve 832, with
--kv-grow):What I ruled out (each one measured, one flag changed per run)
--kv-growis not the trigger. It fails without it (reserve 700) and with it (reserve 832), so the elastic K/V is not what breaks the restore.--visionfrom the args fails the same way.--max-context 16384fails the same way (same 276 MiB free).--vram-reserve-mib: 700/832 fail, 960/2000 work.Duplicates I checked first
native head uploadtogether with--prefill-head-alias.Why I am filing it rather than commenting on #2724
#2724 reported two other things about this flag (a 3x slower cold prefill at 2048-token chunks, and the abort "the output head was reloaded at another address, so the captured verify graphs would read freed memory") and was closed in the 0.2.0-beta tracker reset. This is a different message and a different point in the code (a plain
out of memoryfrom the head upload, not an address change), and it makes the flag unusable at the reserve values this install has. The 8192 -> 2048 prompt chunk cap that #2724 measured is still there and is reproduced here:prompt chunk head alias: 2048 tokens with 20230 MiB borrowed.Reading the code (unconfirmed static analysis, not a proven cause)
src/program/generate.cpp~14172-14180, after the prompt read:The restore happens after
refill()has given the lent slots back to the cache and after the scratch is released, so at that point the only room left is the reserve. The start-up line that decides how much the alias may borrow (prompt chunk head alias: N tokens with X MiB borrowed and Y MiB free) says 702 MiB free while the engine itself reports 276 MiB free once everything is loaded, which is less than the 521 472 000-byte head. I have not stepped this in a debugger; it is a reading of the order of the calls.What would fix it, in my view
Either reserve the head's own bytes when the alias is on (so the start-up "free" figure cannot be spent by the prompt borrow), or fall back to keeping the head resident instead of failing the request. A line at start-up saying "the alias needs --vram-reserve-mib at least N on this card" would have saved me the four runs above.
@github-actions[bot] commented on GitHub (Oct 25, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 25, 2026):
Thanks, this follows the format now.
@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.