mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-06 08:18:54 +00:00
On a PC whose VRAM cache plus RAM can hold all experts but whose RAM alone cannot (e.g. 32 GB + a 24 GB GPU with Q2_0 / IQ2_XS / the Coder), the plain low-RAM mode (--mmap-experts) reads the non-VRAM experts through the OS file cache, which such a PC keeps giving back to the SSD. The resident variant copies exactly those experts from experts.bin into RAM once at start: - engine: --resident-experts = --mmap-experts --resident-cpu-experts, the copy page-locked when the driver allows (else locked in the working set), 4 GiB headroom, plain mmap with a warning when it does not fit. Built after the prompt path's lend plan: the lendable slots' experts are kept in RAM too, from the last slot down, as far as RAM allows. Adaptive swaps stay on: an evicted expert is copied back from its VRAM slot into the RAM place of the one that replaces it (exchange buffers, committed when the swap lands), so no swap reads the file. - --resident-cpu-experts (the ROCm arm) no longer requires --adapt-every 0 and gets the lend region too; its copy stays pageable with 8 GiB headroom as before. - the PCIe share is gated per source (pcie_layer): the arena answers as before; a page-locked resident copy answers for every layer. Same bits as --mmap-experts for the same placement with --pcie-frac 0 or STRATA_RESIDENT_PIN=0. - INFO arena_mib reports the RAM the experts take in the mmap modes (the resident copy, or 0); the serve log and the CLI report the resident GiB, exchanges and blob reads from the file. - setup: in the low-RAM mode, resident when RAM >= (experts minus the GPU's estimated share at this context, less the image encoder's room) + 10 GB; --low-ram resident|mmap forces a variant; needs engine 0.1.30 (else mmap). - tests: lend-region choice and exchange bookkeeping (CPU only). Default (arena) path unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0154bwiad8gY7wRehCXy27pN