FP16 weight cache on by default when the engine runs batch slots on Linux CUDA (3 GiB kept free); gemm_w16_parity test

gemm_dequant_side_parity failed with the cache because its synthetic scratch (10.5 M elements) is smaller than four of its weights, so uncached they take the sliced path and cached one full-N GEMM. The engine's scratch is 32 M elements and every dense projection fits it. gemm_w16_parity runs the engine's scratch, shapes and types, cache off against on, bitwise. STRATA_PF_W16_CACHE_MIB=0 turns it off.
This commit is contained in:
Niko1221 committed 2026-11-03 11:29:44 +01:00
1 parent e318910206
commit 62853e78de
5 files changed
+152 -5

No files matched your search

+7
View File
@@ -84,6 +84,7 @@
#include "strata/core/dflash2.hpp"
#include "strata/core/draft_cap.hpp"
#endif
#include "strata/prefill/gemm.hpp"
#include "strata/prefill/kva.hpp"
#include "strata/prefill/kva_floor.hpp"
#include "strata/prefill/prefill.hpp"
@@ -7865,6 +7866,12 @@ int main(int argc, char** argv) {
}
#endif
}
#if !defined(STRATA_USE_HIP) && !defined(STRATA_GPU_METAL) && !defined(_WIN32)
// 0.2.10.1 (round0212 item 7): the FP16 weight cache is on when the engine runs batch slots on Linux CUDA. Bit-exact against the uncached
// form (gemm_w16_parity, greedy identity 12/12, first-token KL 0); +3.8% (c=1) .. +6.6% (c=8) total tokens/s on l620. It takes only VRAM beyond
// 3 GiB kept free; STRATA_PF_W16_CACHE_MIB=0 turns it off, =N is an explicit budget.
if (o.batch >= 2) strata::prefill::Gemm::set_w16_auto_default(true);
#endif
// #533: --vram-elastic: the cache in physical segments (the VRAM command resizes it between requests). One GPU,
// no helper caches, serve mode: anything else keeps the one cudaMalloc, said once.
if (o.vram_elastic) {