Repository navigation
Flash Next shared sessions: FLASHNEXT_LOAD_LIMIT_GB lets the slots take the server past 70% of RAM - #8
Conversation
…ke the server past 70% of RAM, as GLM_LOAD_LIMIT_GB does for GLM
|
The integration onto upstream The slot checks use the new Is the limit intended to cover only model/session allocation or the eventual total including prompt cache? If the former, please document this distinction and add a test for automatic versus explicit cache. If the latter, the selected cap needs to reach cache planning as well. A larger load limit also does not by itself raise the explicit cache's separate 70% gate. This is a contract clarification, not a claim of an observed macOS stall. The pure arithmetic is reviewable locally; M3 model and long-context qualification remain outstanding. |
…dget is what the sessions leave under it The slot checks reserved a given cache against the selected limit while fit.budget still planned the cache against 70% of RAM, so an automatic cache could take the server past the limit and a raised limit did not raise a given cache's own gate. cache_fit.budgetUnder plans the cache under the same ceiling (fitUnder; budget and fit keep 70% for the other hosts), with a test for the automatic and the given budget under a limit. The recipe doc, the limit's comment and the OverMemoryLimit message name the contract.
3aee757 to
03cc874
Compare
|
@cwschroeder good catch, and a slightly embarrassing one. I built a load limit, then left the prompt cache planner reading the old 70% ceiling, like a bouncer who checks IDs at the front door while the side door stays propped open. Sorry about that. The intent was always the whole footprint, so it's the latter. The contract: The fix: commit
Test: a unit test in
Live, on the 256 GB M5 Ultra at
The commit merges cleanly with #7 in either order. I moved the doc paragraph so it doesn't touch the sentence #7 rewrites. As you say, M1 to M4 and your M3 Ultra are still unqualified. |
|
@cwschroeder one more thing for your integration onto upstream I've done the rebase so you don't have to:
The branch's merge commit ( Checks on the branch:
I haven't served this base: the arithmetic is unit-tested, and the same code path is what ran live on the old base. Happy to run it if you want a receipt on |
What this changes
FLASHNEXT_LOAD_LIMIT_GBlets the batching host's session slots take the server past the 70%-of-RAM share, asGLM_LOAD_LIMIT_GBdoes for the GLM loader. Unset, nothing changes.70% of RAM - footprint once loaded - margin. On a 256 GB Mac the engine is at 173.3 GiB once loaded, so 179.2 - 173.3 - 2 leaves about 4 GiB for sessions. One 262,112-token session holds 7.5 GiB (Session.bytes), so four need 30 GiB, which the Mac has but the share doesn't.warnthe GLM loader does, and it refuses text that isn't a number above 0.cache_fit.ceiling()holds the arithmetic, with a unit test. The host uses it for both checks, beforeBackend.initand after.OverMemoryLimitmessage now names the three ways out: fewer streams, a smaller--context, or the limit.One commit,
a5e409e3, on77ebc3fc; it merges cleanly with the sampling PR in either order.Receipt
Mac Studio M5 Ultra (256 GB), macOS 27.0.1,
TensorFold/Qwen3.8-Flash-Next-MLX-6bit-MTPat45032a19,FLASHNEXT_LOAD_LIMIT_GB=225 --parallel 4 --context 262144 --prompt-cache-gib 0:Flash Next: 4 session slots).concurrent12/12,drafts12/12.FLASHNEXT_LOAD_LIMIT_GB=240, about 219 GiB in use). Eight 262k slots are refused at that limit with the new message, as they should be.zig fmt --checkis clean andzig build testpasses, built at77ebc3fcand on a merge ontomaine7c523eb. Receipts: evidence/2026-10-11-pr606-parallel, the-256kfiles.Not run: M1 to M4 (including your M3 Ultra) and CUDA. Unset, the host's arithmetic is unchanged.