‹ Back to Blog ‹ Back to Blog On this page 1. The idea: GPU memory as a cache of experts 2. Performance results 3. Why it works 3.1 A token reads a few experts, and keeps reusing them 3.2 A decode step is a byte problem 3.3 The link is 16x slower than VRAM, so only unread weights can leave the GPU 4. The building blocks 4.1 Two places for every expert 4.2 The MoE kernel never knows 4.3 Decide and copy on the GPU, inside the graph 4.4 Steps larger than K: waves 4.5 A third tier on NVMe 5. Try it 6. How we measured On this page 1. The idea: GPU memory as a cache of experts 2. Performance results 3. Why it works 3.1 A token reads a few experts, and keeps reusing them 3.2 A decode step is a byte problem 3.3 The link is 16x slower than VRAM, so only unread weights can leave the GPU 4. The building blocks 4.1 Two places for every expert 4.2 The MoE kernel never knows 4.3 Decide and copy on the GPU, inside the graph 4.4 Steps larger than K: waves 4.5 A third tier on NVMe 5. Try it 6. How we measured Mixture-of-Experts (MoE) models are now a popular shape of open-weight LLMs, and most of their parameters are experts. A token only uses top_k of the E experts in each layer, but every expert has to be somewhere the GPU can reach quickly, and a consumer GPU has 8–16 GB of VRAM: Qwen3-30B-A3B in 4-bit is 17 GB, its FP8 version 31 GB, Qwen3-Next-80B-A3B in NVFP4 about 48 GB. Paged Experts lets SGLang keep only part of a MoE model’s experts in GPU memory and the rest in host RAM, with every expert still computed on the GPU. That serves models that did not fit before, and it turns the VRAM the experts take into something you can trade: give it to the KV cache for longer context or more concurrent requests, or spend it on a larger, higher-precision checkpoint. It is merged into SGLang main and enabled with one flag, --enable-paged-experts . TL;DR Run MoE models that do not fit your GPU. On a 16 GB RTX 5070 Ti, Qwen3-Next-80B-A3B NVFP4 (48 GB) decodes at 116 tok/s with its experts in host RAM; with an NVMe drive behind host RAM, DeepSeek-V4-Flash (167 GB) runs at 13.0 tok/s on the same card with 62 GB of RAM. It unlocks new trade-offs. Even if a model would fit VRAM, Paged Experts can be used to limit the number of experts to gain VRAM for e.g. longer contexts or more concurrent requests. How it works. Each MoE layer keeps K of its experts on the GPU and all of them in pinned host RAM. Before the layer runs, the GPU checks the routed experts against the resident ones and copies in the missing ones, replacing the least recently used, all inside the decode step’s CUDA graph. Why it works. A token reads only a few experts per layer, and consecutive tokens keep returning to the same ones: at 91 of 128 experts resident, 0.8 % of routed experts are not on the GPU when the token reaches the layer. And everything in a decode step except those copies already runs as fast as the GPU can read its weights. 1. The idea: GPU memory as a cache of experts Take one MoE layer of Qwen3-30B-A3B: 128 experts, of which each token uses 8. On a 16 GB card all 128 do not fit next to attention and the KV cache, but 91 do. Paged Experts keeps those 91 in slots on the GPU (the resident experts) and all 128 in a host store in pinned RAM. The router does not know: it still routes over all 128. Before the layer runs, a small decide kernel checks the 8 experts the router picked against the slots: a resident expert is used where it sits, a missing one is copied over PCIe into the slot of the least recently used expert, and the layer’s own fused-MoE kernel runs over the slots. At K = 91, 0.8 % of routed experts miss. If this sounds like virtual memory, it is meant to. An expert is a fixed-size block of weights that a token reads whole or not at all, which makes it a natural page; a miss is a page fault, and paging decides only where an expert sits when the GPU reads it, never which experts run. Two things are unlike an operating system: the GPU handles its own faults, inside the decode step’s CUDA graph, and nothing is ever computed on the CPU: the page always comes to the GPU. When host RAM runs out, the same scheme goes one tier further, with an NVMe drive behind the host store (section 4.5). Figure 1: One MoE layer, one decode step. Everything in the blue frame runs on the GPU inside the decode CUDA graph. What it buys. Without paging, every expert of every layer has to sit in VRAM, and the experts take most of it. With paging, how many stay resident is a choice, and the VRAM they do not use goes elsewhere: to the KV cache for longer context or more concurrent requests, or to a larger, higher-precision checkpoint. On Qwen3-30B GPTQ, a 10,240-token KV cache leaves K = 91 of 128 resident (241.5 tok/s), the model’s full 40,960-token context K = 62 (218.3 tok/s), and four requests of 16,384 tokens K = 44 (183.1 tok/s). SGLang picks K from what is left once the KV cache you asked for is allocated. What paging needs in return is host RAM for one copy of every expert (13.9 GiB for Qwen3-30B GPTQ, 40.5 GiB for Qwen3-Next-80B NVFP4), or an NVMe drive for the rest. Figure 2: The VRAM the KV cache does not take holds experts. More context means fewer resident experts and slower decode. 2. Performance results One desktop (RTX 5070 Ti 16 GB, PCIe 5.0, 62 GB RAM, a PCIe 5.0 NVMe drive) and one laptop (RTX 4070 Laptop 8 GB, 54 GB RAM under WSL2). The laptop’s GPU sits on PCIe 4.0 x8 instead of the desktop’s 5.0 x16: read its row as a slower-link data point. Decode is one request at a time after warm-up, K is chosen automatically, and the RAM-tier rows keep a 10,240-token KV cache. a / b are two runs of the same configuration. TTFT is the median for short ShareGPT prompts and for natural, non-repeating prompts of about 1,470 tokens; the desktop’s disk-tier rows were measured with the long prompts only. The full setup is in section 6. model (size) GPU K of E on the GPU host RAM for experts decode tok/s, 1 request TTFT p50, short prompts TTFT p50, ~1.5k-token prompt Qwen3-30B-A3B GPTQ-Int4 (17 GB) 16 GB desktop 91 of 128 13.9 GiB 241.5 43 ms 259 ms gpt-oss-20b MXFP4 (14 GB) 16 GB desktop 28 of 32 10.3 GiB 173.5 38 ms 200 ms Qwen3-Next-80B-A3B NVFP4 (48 GB) 16 GB desktop 99 of 512 40.5 GiB 116.2 191 ms 687 ms Qwen3-30B-A3B FP8 (31 GB) 16 GB desktop 44 of 128 27.0 GiB 113.0 191 ms 398 ms DeepSeek-V4-Flash-0731 (167 GB) 16 GB desktop 8 of 256 45 GiB + NVMe 13.0 / 13.0 – 8.88 / 8.91 s Qwen3.8-Flash-Next-FP8 (186 GB) 16 GB desktop 10 of 512 36 GiB + NVMe 14.9 / 14.9 – 7.40 / 7.41 s Qwen3-Next-80B-A3B NVFP4 (48 GB) 8 GB laptop 17 of 512 18 GiB + NVMe 16.2 / 16.5 1.35 s 4.56 / 4.72 s Paging does not change what the model computes: section 4.2 shows paged layers are bit-identical to unpaged ones. GSM8K is a sanity check on top (thinking off): on all 1,319 questions (one standard error is about 0.6 points) 0.938 for Qwen3-30B GPTQ, 0.951 for its FP8 version, 0.954 for Qwen3-Next and 0.950 for gpt-oss-20b; on 200 questions (about 1.4 points) 0.98 for DeepSeek-V4-Flash and 0.965 for Qwen3.8. Section 1 shows what longer context costs. Figure 3: Decode speed for one request on a 16 GB GPU, with K picked automatically. None of these models runs fully resident at the table’s setting. gpt-oss-20b, the smallest at 14 GB, needs --mem-fraction-static of at least 0.92 for its weights alone; at 0.95, with the same 10,240-token KV cache, it does run fully resident and decodes at 179.4 tok/s. Paged at that setting, it keeps 31 of its 32 experts on the GPU and decodes at 176.8 tok/s, 1.5 % slower. 3. Why it works Three facts make paging experts viable, and each one decides a part of the design in section 4. 3.1 A token reads a few experts, and keeps reusing them Qwen3-30B-A3B has 128 experts in each of its 48 MoE layers; in GPTQ-Int4 they take 13.9 GiB, the whole usable VRAM of a 16 GB card. Each token, though, is routed to 8 of the 128 per layer: it reads 0.87 GiB of those 13.9 GiB. And consecutive tokens keep returning to the same experts. If routing were uniform, a routed expert would miss the slots with probability 1 − K/E; measured routing misses far less. We call uniform miss rate ÷ measured miss rate the concentration factor (measured at the K of section 2 with pre-copy off, over the traced request of section 3.2; Figure 4 shows how much of it pre-copy takes off the critical path): model, K of E miss per routed expert uniform 1 − K/E concentration Qwen3-30B GPTQ, 91 of 128 0.80 % 28.9 % 36x Qwen3-30B FP8, 44 of 128 9.9 % 65.6 % 6.6x Qwen3-Next-80B NVFP4, 99 of 512 (top-10) 12.4 % 80.7 % 6.5x The concentration is largest where the cache is large relative to E: a small cache holds the popular head, and the tail is broad. Figure 4: Measured routing misses the GPU far less often than uniform routing would, at every K. On SGLang main, a pre-copy of each layer’s predicted experts during the previous layer moves part of the remaining misses off the critical path; only the orange ones are still waited for. Which expert
‹ Back to Blog ‹ Back to Blog On this page 1. The idea: GPU memory as
‹ Back to Blog ‹ Back to Blog On this page 1. The idea: GPU memory as a cache of experts 2. Performance results 3. Why it works 3.1 A token reads a few experts, and keeps reusing them 3.2 A decode step is a byte problem 3.3 The link is 16x slower than VRAM, so
这条信息对 FDE 的直接价值在于提醒交付人员持续关注模型、智能体与企业流程之间的变化。面对类似项目,应先确认客户的真实业务目标、数据边界、权限条件和验收指标,再选择工具并用最小场景验证结果,避免只追逐功能更新。