Files
Strata/tests/program
Niko1221 794092c46c strata-q36: say a context the card cannot hold before the allocation fails (#5715)
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).
2026-11-11 01:07:29 +01:00
..