The VRAM plan: no CUDA-context term in the engine, where the budget is already net of it

in.budget_bytes is cudaMemGetInfo's free figure, read after this process's context exists, and the engine
subtracted a 300 MiB context on top of it: ~290 (IQ3) / ~160 (Q4) expert slots under table 4.3 (review
finding 2).  The engine passes 0; vram_plan_test keeps the study's 300 MiB because its budgets are the cards'
sizes.  Said in vram_plan.hpp's field comment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
This commit is contained in:
Robert KarlandClaude Fable 5.1 committed 2026-10-11 11:20:16 -07:00
1 parent 2b4fcf1f8f
commit 4a998adf2c
2 files changed
+7 -2

No files matched your search

+4 -1
View File
@@ -2203,7 +2203,10 @@ int main(int argc, char** argv) {
(uint64_t) g.n_gdn_layers() * ((uint64_t) g.ssm_state_size * g.ssm_v_heads * g.ssm_state_size +
(uint64_t) g.ssm_conv_channels * (g.ssm_d_conv - 1)) * 4 +
(36ull << 20);
in.cuda_context_bytes = 300ull << 20;
// cudaMemGetInfo's free figure is read after this process's context exists, so the driver's share is
// already out of it: 0 here. The planner's unit test puts the study's 300 MiB in, because its budgets are
// the cards' sizes (table 4.1), not a free figure.
in.cuda_context_bytes = 0;
in.reserve_bytes = (uint64_t) (o.vram_reserve_given ? o.vram_reserve_mib : 300) << 20; // kSmallReserveMib
const bool borrow = !o.no_prefill_borrow && !o.expert_profile.empty();
in.prompt_bytes = (o.prefill_chunk > 0 && !borrow) ? ((uint64_t) (160 + (o.prefill_chunk * 680) / 1024) << 20) : 0;