[GH-ISSUE #847] Allow system ram to be used instead of SSD when available. #376

Closed
opened 2026-11-04 01:42:27 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @jarrodhroberson on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/847

I have 192GB of system RAM, AMD 9950X, and Radeon R9700 AI Pro and 4TB PCIe 4 NVMe drive.

Running latest LTS Ubuntu.

Would strata run faster with the larger models I can run if all the spillover that is on disk was moved to a RAM DISK?

How much work to add a CLI switch to create a RAM disk and copy the SSD data to it and use it instead?

Originally created by @jarrodhroberson on GitHub (Oct 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/847 I have 192GB of system RAM, AMD 9950X, and Radeon R9700 AI Pro and 4TB PCIe 4 NVMe drive. Running latest LTS Ubuntu. Would strata run faster with the larger models I can run if all the spillover that is on disk was moved to a RAM DISK? How much work to add a CLI switch to create a RAM disk and copy the SSD data to it and use it instead?
Author
Owner

@jangatzke commented on GitHub (Oct 4, 2026):

You don't have to load the model into RAM. Linux will keep the weights in cache (RAM) after the first read as long as there is no memory pressure.

<!-- gh-comment-id:5985222966 --> @jangatzke commented on GitHub (Oct 4, 2026): You don't have to load the model into RAM. Linux will keep the weights in cache (RAM) after the first read as long as there is no memory pressure.
Author
Owner

@apdogod123321-ops commented on GitHub (Oct 4, 2026):

what about windows?

<!-- gh-comment-id:5985321779 --> @apdogod123321-ops commented on GitHub (Oct 4, 2026): what about windows?
Author
Owner

@ecatvids-glitch commented on GitHub (Oct 5, 2026):

Windows also implements file caching for, I assume, similar results.

<!-- gh-comment-id:5986059577 --> @ecatvids-glitch commented on GitHub (Oct 5, 2026): Windows also implements file caching for, I assume, similar results.
Author
Owner

@Quantumcross commented on GitHub (Oct 5, 2026):

I'd like this feature too, I only have slow storage available but tons of ram available (weird in today's world I know), and I'd like to just make sure the n-gram lookup goes hot and stays hot on startup.

<!-- gh-comment-id:5999620031 --> @Quantumcross commented on GitHub (Oct 5, 2026): I'd like this feature too, I only have slow storage available but tons of ram available (weird in today's world I know), and I'd like to just make sure the n-gram lookup goes hot and stays hot on startup.
Author
Owner

@Quantumcross commented on GitHub (Oct 5, 2026):

Ah looks like this is the --ple-io ram flag? I think it should automatically detect that if it detects that the table is on rotational storage, but mine is on a zfs pool backed with rotational storage so it couldn't detect that.

See:#605 #746

<!-- gh-comment-id:6000524178 --> @Quantumcross commented on GitHub (Oct 5, 2026): Ah looks like this is the `--ple-io ram` flag? I think it should automatically detect that if it detects that the table is on rotational storage, but mine is on a zfs pool backed with rotational storage so it couldn't detect that. See:#605 #746
Author
Owner

@apdogod123321-ops commented on GitHub (Oct 5, 2026):

it wont work for me on windows even when I do mmap it just still streams from nvme. I think we should try to make --ple-io ram work on windows.

<!-- gh-comment-id:6001324861 --> @apdogod123321-ops commented on GitHub (Oct 5, 2026): it wont work for me on windows even when I do mmap it just still streams from nvme. I think we should try to make --ple-io ram work on windows.
Author
Owner

@talisp commented on GitHub (Oct 5, 2026):

A data point from a large-RAM Linux box (251 GB RAM, 1 GPU with ~42 GiB usable, 0.1.39, Unsloth UD-IQ4_XS, whose experts are 55 GiB). Short version: for the experts you do not need a RAM disk. When the RAM is big enough, setup already keeps every expert in VRAM or RAM.

What setup and the engine did here:

  • Setup: RAM budget: 55 GiB of UD-IQ4_XS's experts in RAM, i.e. --resident-budget-gib 55 in the generated args.
  • Engine start log:
    FileExpertSource: RAM budget 55.00 GiB: 9904 of the 22.33 GiB of experts the GPU cache does not hold ...
    strata generate: resident RAM mode: 22.33 GiB of experts in RAM (page-locked), 14672 in the GPU cache;
                     adaptive swaps exchange them with the GPU cache (no file reads)
    
    So 14,672 experts sit in VRAM and the other 9,904 in pinned RAM: all 24,576 of them.
  • After a day of agent traffic: 21.3 M expert reads came from RAM and 220,576 (~1%) from the file tier. On Linux the file tier goes through the page cache (free shows 227 GB of buff/cache here, so the GGUFs stay cached), which is RAM too, as @jangatzke said.

What still comes from the disk by default is the 28.8 GB n-gram (PLE) table. It is read with --ple-io direct, unbuffered and past the page cache (docs/DETAILS.md, "Where the model lives"). --ple-io ram (Linux, #605) keeps that table in RAM; it is the flag @Quantumcross found. We still run the default (direct, on a virtual disk), and we never needed ram: decode is already fast here with the default, mostly at 90–190K tokens of context (official Qwen sampling, replies of 300+ tokens, from the engine log):

Quant Replies Mean p90 Fastest replies
IQ3_S (~3.5 bits) 1,180 ~103 tok/s 124–130 up to ~180
UD-IQ4_XS (~4 bits) 247 ~78 tok/s 89 up to ~106

So in our case the table on disk was not a visible bottleneck (impression; ram might still add something, and we have not measured it).

My opinion for 192 GB on Linux: run setup normally, so it picks the RAM budget, then add --ple-io ram to the args in strata-<model>.json. Check the start log for the resident RAM mode line and the PLE line. I have no data for Windows.

<!-- gh-comment-id:6001887405 --> @talisp commented on GitHub (Oct 5, 2026): A data point from a large-RAM Linux box (251 GB RAM, 1 GPU with ~42 GiB usable, 0.1.39, Unsloth UD-IQ4_XS, whose experts are 55 GiB). Short version: **for the experts you do not need a RAM disk**. When the RAM is big enough, setup already keeps every expert in VRAM or RAM. **What setup and the engine did here:** - **Setup:** `RAM budget: 55 GiB of UD-IQ4_XS's experts in RAM`, i.e. `--resident-budget-gib 55` in the generated args. - **Engine start log:** ``` FileExpertSource: RAM budget 55.00 GiB: 9904 of the 22.33 GiB of experts the GPU cache does not hold ... strata generate: resident RAM mode: 22.33 GiB of experts in RAM (page-locked), 14672 in the GPU cache; adaptive swaps exchange them with the GPU cache (no file reads) ``` So 14,672 experts sit in VRAM and the other 9,904 in pinned RAM: all 24,576 of them. - **After a day of agent traffic:** 21.3 M expert reads came from RAM and 220,576 (~1%) from the file tier. On Linux the file tier goes through the page cache (`free` shows 227 GB of buff/cache here, so the GGUFs stay cached), which is RAM too, as @jangatzke said. **What still comes from the disk by default** is the 28.8 GB n-gram (PLE) table. It is read with `--ple-io direct`, unbuffered and *past* the page cache (`docs/DETAILS.md`, "Where the model lives"). `--ple-io ram` (Linux, #605) keeps that table in RAM; it is the flag @Quantumcross found. We still run the default (`direct`, on a virtual disk), and we never needed `ram`: decode is already fast here with the default, mostly at 90–190K tokens of context (official Qwen sampling, replies of 300+ tokens, from the engine log): | Quant | Replies | Mean | p90 | Fastest replies | |---|---|---|---|---| | IQ3_S (~3.5 bits) | 1,180 | **~103 tok/s** | 124–130 | up to ~180 | | UD-IQ4_XS (~4 bits) | 247 | **~78 tok/s** | 89 | up to ~106 | So in our case the table on disk was not a visible bottleneck (impression; `ram` might still add something, and we have not measured it). **My opinion for 192 GB on Linux:** run setup normally, so it picks the RAM budget, then add `--ple-io ram` to the args in `strata-<model>.json`. Check the start log for the `resident RAM mode` line and the PLE line. I have no data for Windows.
Author
Owner

@Niko1221 commented on GitHub (Oct 6, 2026):

Part of this exists: the experts are loaded into RAM and the SSD is read only for what does not fit (--resident-budget-gib and the low-RAM modes, docs/DETAILS.md). Which RAM size and model are you using? If everything fits in RAM already, an extra RAM cache layer would not help.

<!-- gh-comment-id:6010955301 --> @Niko1221 commented on GitHub (Oct 6, 2026): Part of this exists: the experts are loaded into RAM and the SSD is read only for what does not fit (--resident-budget-gib and the low-RAM modes, docs/DETAILS.md). Which RAM size and model are you using? If everything fits in RAM already, an extra RAM cache layer would not help.
Author
Owner

@jarrodhroberson commented on GitHub (Oct 6, 2026):

You don't have to load the model into RAM. Linux will keep the weights in cache (RAM) after the first read as long as there is no memory pressure.

not doing that on my machine Ubunutu 26.04, I have let it run overnight doing tests and the same RAM allocation the entire time, and I am pretty sure Windows would not cache 80GB either.

I have 182GB free all the time and it is still registering constant hits to my NVMe drive.

<!-- gh-comment-id:6024549591 --> @jarrodhroberson commented on GitHub (Oct 6, 2026): > You don't have to load the model into RAM. Linux will keep the weights in cache (RAM) after the first read as long as there is no memory pressure. not doing that on my machine Ubunutu 26.04, I have let it run overnight doing tests and the same RAM allocation the entire time, and I am pretty sure Windows would not cache 80GB either. I have 182GB free all the time and it is still registering constant hits to my NVMe drive.
Author
Owner

@jarrodhroberson commented on GitHub (Oct 6, 2026):

My opinion for 192 GB on Linux: run setup normally, so it picks the RAM budget, then add --ple-io ram to the args in strata-<model>.json. Check the start log for the resident RAM mode line and the PLE line. I have no data for Windows.

thanks I will try this and see what it does.

<!-- gh-comment-id:6024592270 --> @jarrodhroberson commented on GitHub (Oct 6, 2026): > **My opinion for 192 GB on Linux:** run setup normally, so it picks the RAM budget, then add `--ple-io ram` to the args in `strata-<model>.json`. Check the start log for the `resident RAM mode` line and the PLE line. I have no data for Windows. thanks I will try this and see what it does.
Author
Owner

@Niko1221 commented on GitHub (Oct 7, 2026):

On Linux, --ple-io ram keeps the n-gram table in RAM and --resident-budget-gib (or --resident-experts) keeps the experts in RAM; 0.1.40 loads the --ple-io ram table on 16 threads. On Windows the file is mapped, so it still streams from the page cache; the docs say so. Closing with that answer.

<!-- gh-comment-id:6037827138 --> @Niko1221 commented on GitHub (Oct 7, 2026): On Linux, --ple-io ram keeps the n-gram table in RAM and --resident-budget-gib (or --resident-experts) keeps the experts in RAM; 0.1.40 loads the --ple-io ram table on 16 threads. On Windows the file is mapped, so it still streams from the page cache; the docs say so. Closing with that answer.
Author
Owner

@jarrodhroberson commented on GitHub (Oct 7, 2026):

On Linux, --ple-io ram keeps the n-gram table in RAM and --resident-budget-gib (or --resident-experts) keeps the experts in RAM; 0.1.40 loads the --ple-io ram table on 16 threads. On Windows the file is mapped, so it still streams from the page cache; the docs say so. Closing with that answer.

thanks for the detailed information!

<!-- gh-comment-id:6048932827 --> @jarrodhroberson commented on GitHub (Oct 7, 2026): > On Linux, --ple-io ram keeps the n-gram table in RAM and --resident-budget-gib (or --resident-experts) keeps the experts in RAM; 0.1.40 loads the --ple-io ram table on 16 threads. On Windows the file is mapped, so it still streams from the page cache; the docs say so. Closing with that answer. thanks for the detailed information!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#376
No description provided.