mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
One session had no check before its K / V were allocated: at 128K on a
12 GB card the engine ended with "cudaMalloc(&p, n * 4) failed: out of
memory (q36_engine.cu:1128)" and nothing else; at 64K with the hybrid
buffers' text a little later.
Engine::init now checks one session the way it already checked several:
the session (fp32 K / V and state) plus, when the experts will not all fit,
the hybrid mode's minimum (the staging pair and the CPU part's outputs,
as place_experts allocates them with no slot) against the free VRAM. Only
a start that cannot succeed is refused, with the owner's wording, and the
exit code stays 1:
strata-q36: a context of {context} tokens does not fit on this graphics
card: its conversation memory needs {X} GiB and only {Y} GiB is free
after the model. Start it again with a shorter context ({fit} tokens fit
here).
X is the session plus the fp16 K / V copy, Y the free VRAM after the model
and the hybrid minimum, fit the largest context in steps of 1024 tokens
that fits Y. The engine never changes the context. A card where not even
1024 tokens fit is not refused here (no sentence for that case); several
sessions keep their own check.
The rule is include/strata/qwen35/context_fit.hpp; tests/program/
q36_context_fit_test.cpp checks it on the reporter's card from his log
(32K starts; 64K and 128K are refused with 47104 tokens said to fit).