Tideway and the VRAM/RAM/SSD hierarchy: why big local MoE thrash, and how to manage it

A 155 GB Mixture-of-Experts on a machine with 32 GB of VRAM: without intelligent memory management the system spends most of its time moving weights between tiers, and the GPU sits idle. That is thrashing — the same mechanism that slows a disk when RAM is full. The researchers behind Tideway measured it, and cut it down with an idea that is simple to state and hard to build: VRAM and system RAM are not two separate caches — they are one memory pool.
The problem: three tiers, three independent caches
Mixture-of-Experts models activate only a fraction of their experts per token. A 155 GB model might use 20 GB at a time; the rest waits on RAM or SSD. While the model fits, there is no problem. When it does not, inference engines must decide where each expert lives and when to move it.
The weakness of today's systems — the paper measures it by comparing FreeToken, llama.cpp, SSD-LLaMA and FlashMoE — is that they treat VRAM, RAM and SSD as three independent caches, each with its own replacement policy. The result: an expert evicted from VRAM may already exist in RAM, but the VRAM cache does not know and re-copies everything from the wrong tier. During prefill, streaming weights from the SSD produces waves of unnecessary reads: in their benchmark of a 32K-token prefill split into four 8K chunks, the per-tier LRU hierarchy performs 9 SSD reads where Tideway performs 6.
How Tideway reasons
Three mechanisms cooperate:
1. A unified pool, not three caches. VRAM and RAM form a single address space, with the SSD as the backing tier. When space is needed, the system first reclaims redundant cross-tier copies: if an expert lives in both VRAM and RAM, the VRAM copy is freed instead of evicting another expert. Weights evicted from VRAM return to RAM during idle moments, using the PCIe links in both directions.
2. Phase-aware layouts. Prefill and decode read weights in opposite ways. During prefill the model touches nearly every expert: Tideway borrows VRAM for double-buffered streaming and anchors reusable experts in RAM so a full-model pass does not evict them from the pool. During decode it inverts: the anchors are released and VRAM becomes a set of fixed-address slots into which missing experts are fetched.
3. Paging that does not stop the GPU. Expert transfers cannot wait for the end of a compute block, or the GPU starves. Tideway overlaps the arrival of the next layer's weights with the current layer's computation, and during decode uses piecewise CUDA Graphs: the graph is captured in segments, and between segments the system pages missing experts into the fixed slots without re-capturing anything.
The numbers
Everything is measured on an NVIDIA RTX 5090 (32 GB) with 16–128 GB of system RAM, on three frontier MoE models:
| Model | Format | Size | System RAM | End-to-end latency vs. fastest baseline | TTFT | Decode (TPOT) |
|---|---|---|---|---|---|---|
| Qwen3.6-35B-A3B | BF16 | 67 GiB | 64 GiB | 1.13x | 1.17x | 1.20x |
| Qwen3.6-35B-A3B | BF16 | 67 GiB | 48 GiB | 3.10x | 9.04x | 1.89x |
| Qwen3.6-35B-A3B | BF16 | 67 GiB | 32 GiB | 1.95x | 2.56x | 1.45x |
| Gemma4-26B-A4B | BF16 | 48 GiB | 48 GiB | 1.32x | 1.70x | 1.20x |
| Gemma4-26B-A4B | BF16 | 48 GiB | 32 GiB | 3.18x | 1.45x | 1.48x |
| Gemma4-26B-A4B | BF16 | 48 GiB | 16 GiB | 2.72x | 2.05x | 2.28x |
| DeepSeek-V4-Flash | FP4 | 155 GiB | 128 GiB | 1.58x | 1.15x | 1.36x |
| DeepSeek-V4-Flash | FP4 | 155 GiB | 96 GiB | 2.63x | 1.76x | 1.50x |
| DeepSeek-V4-Flash | FP4 | 155 GiB | 64 GiB | 1.98x | 1.36x | 1.93x |
On average, against the fastest baseline, the paper reports 1.97x end-to-end latency, 2.40x time-to-first-token and 1.61x decode throughput. One detail to notice: the more system RAM there is, the smaller the advantage becomes. With 64 GiB against a 67 GiB model, RAM covers almost everything and there is little left to optimize: 1.13x. With 48 GiB the gap opens and reaches 9.04x on TTFT. RAM is the variable that matters, not the model.
What it means in practice
Tideway is a research project, not a package you install: it requires Linux, Python 3.12, an NVIDIA GPU and the CUDA 13 toolkit, and model checkpoints are supplied separately. The repository is public and the benchmarks are reproducible, but do not expect to pip install it and run a 100 GB MoE on your desktop tomorrow.
What you can take home today:
- System RAM is not waste. On a large MoE, 64 GB of RAM is the difference between a model that moves and one that stalls. If you are evaluating hardware for models that do not fit in VRAM, the RAM budget matters as much as the GPU's memory bandwidth.
- The metrics that matter are TTFT and latency, not peak speed. Prefill dominates when RAM is tight: that is where the 9.04x materializes, and it is the 9.04x you feel when you open a chat.
- Paging already exists, in rough form. llama.cpp and engines with RAM/SSD offload do the same thing with separate caches. The step Tideway demonstrates is the integration: one pool, one policy, a GPU that never waits.
And the limits?
The paper measures on a single GPU class (RTX 5090) with CUDA 13: AMD and Intel are out of scope, and the pure CPU/SSD path that runs MoE models on Mac is untouched. The tables cover a RAM range from 16 to 128 GiB: below 16 there is little to say, and above 128 the advantage thins further. Finally, the "frontier MoE" of the benchmark weigh 48 to 155 GiB: if your model fits in VRAM, Tideway has no reason to exist — the problem it solves is a big-model problem.
Sources
- Tideway: Phase-Aware Tiered Memory Management for MoE Inference on Consumer Devices — abstract and average results
- Afterglow231/Tideway on GitHub — full tables per model and RAM, requirements, build setup
In summary
Large MoE models are not slow locally because the GPU is slow — they are slow because the weights travel. Three independent caches (VRAM, RAM, SSD) that do not talk to each other produce redundant reads and paging waves; a unified pool with phase-aware layouts and a graph-based execution that never pauses between transfers cuts latency by nearly half and time-to-first-token by 2.4x. The project is research, but the criterion it leaves is concrete: for models that do not fit in VRAM, system RAM and the quality of memory management are the variables you decide before anything else.
Article generated with AI
In these reading paths
Enjoyed this article?
Subscribe to the newsletter for new tutorials and guides.

