From e48c803e018afc805915e227a08ecf1d2f87cce5 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Tue, 13 Oct 2026 01:49:34 +0200 Subject: [PATCH] native packs: the sized cache's budget counts the 256-byte slots it is filled with - an NVFP4 blob (2,764,816 B with its scale tail) got one slot fewer than asked, none at --expert-cache 1 Found by the quant yardstick (--expert-cache 1) on the NVFP4 GPTQ pack: 'pre-filled 0 of 0 slots', and the verify windows refused to run. Every other native format's blob is rows x row bytes with 1280 / 2560 rows, a multiple of 256, so its budget is unchanged. --- src/program/generate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 615a2da0..ad06c3a1 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -5079,7 +5079,10 @@ int main(int argc, char** argv) { size_t free_b = 0, total_b = 0; free_b = strata::core::device_free_bytes(); (void) total_b; const auto& lay = strata::kernels::cpu::expert_layout(); - const uint64_t budget = (uint64_t) o.expert_cache * lay.max_blob; // what the uniform sizing granted + // what the uniform sizing granted, in the 256-byte slots the loop below counts: the blob formats of 1280 / 2560 + // rows are whole multiples of 256 already; an NVFP4 blob's 16-byte scale tail is not, and the unrounded budget + // held one slot fewer than asked (--expert-cache 1: none) + const uint64_t budget = (uint64_t) o.expert_cache * ((lay.max_blob + 255) / 256 * 256); uint64_t used = 0; const size_t keep_free = ((size_t) o.vram_reserve_mib << 20) + (size_t) pipe_first; size_t free_room = free_b > keep_free ? free_b - keep_free : 0;