kv-grow: ported over --vram-elastic (#533); off, with a warning, under --batch, --vram-elastic and --peer-device

The expert cache arena now has three backings (segmented #533, one VMM range for --kv-grow, cudaMalloc), tried in
that order.
This commit is contained in:
Niko1221 committed 2026-10-05 19:57:35 +02:00
1 parent 025bf3b2ef
commit f81876ecef
1 file changed
+6 -1
+6 -1
View File
@@ -3230,7 +3230,12 @@ int main(int argc, char** argv) {
const bool asked = ev != nullptr && ev[0] != '\0' ? ev[0] != '0' : o.kv_grow;
const bool on = asked && !multi_gpu && o.kv_resident <= 0 &&
!o.expert_profile.empty() && !o.resident_cpu_experts && o.expert_cache != 0 && !remote &&
strata::core::vmm_available();
strata::core::vmm_available() &&
// the batch slots carve their own K/V and --vram-elastic's cache is not one VMM range
o.batch == 0 && !o.vram_elastic && o.peer_device < 0;
if (asked && !on)
std::fprintf(stderr, "strata generate: --kv-grow is off (one GPU, a profile, the whole K/V in VRAM, "
"every expert in RAM, no --batch, --vram-elastic or --peer-device)\n");
const char* iv = std::getenv("STRATA_KV_GROW_INIT");
strata::core::qsa_set_kv_elastic(on, iv != nullptr && std::atoll(iv) > 0 ? std::atoll(iv) : 16384);
strata::core::ExpertCache::set_vmm(on);