SGLang Runs a 167GB DeepSeek Model on a 16GB Consumer GPU
SGLang's new Paged Experts feature treats GPU memory as a cache for MoE experts, letting a 167GB DeepSeek model run on a 16GB consumer card.
Takeaways
- Paged Experts runs MoE models far larger than GPU VRAM by caching active experts and paging others from RAM or NVMe.
- DeepSeek-V4-Flash (167GB) decodes at 13 tok/s on a single 16GB RTX 5070 Ti with 62GB RAM plus NVMe.
- Qwen3-Next-80B NVFP4 (48GB) runs at 116 tok/s on the same 16GB card, or 16 tok/s on an 8GB laptop GPU.
- Merged into SGLang main and v1.0.0, enabled with a single
--enable-paged-expertsflag. - Works because routing has 6.5x to 36x concentration: only 0.8% of routed experts miss a well-sized cache.
- Paged layers are bit-identical to unpaged ones; GSM8K accuracy matches baseline across all tested models.
SGLang, an open-source engine for serving large language models, has added Paged Experts, a runtime that treats GPU memory as an expert cache. Frequently used experts remain in VRAM, while other weights reside in host RAM or on an NVMe drive. In the team’s single-GPU demo, a 167 GB DeepSeek-V4-Flash checkpoint ran on an RTX 5070 Ti with 16 GB of VRAM and generated 13 output tokens per second.
Paged Experts is merged into SGLang main and included in v1.0.0, with the runtime enabled through --enable-paged-experts. The implementation is open source and currently targets one GPU. It lets developers trade generation speed for model capacity, context length, and concurrency while routing decisions and expert computation remain on the GPU.
Sparse Routes, Small Working Set
Mixture-of-Experts models contain many expert networks, but their routers activate only a small subset for each token. Qwen3-30B-A3B has 128 experts in each of its 48 MoE layers, and its GPTQ-Int4 experts occupy 13.9 GiB. Each token activates eight experts per layer, so it reads about 0.87 GiB of that expert data.
Expert selection also has strong temporal locality: consecutive tokens tend to reuse the same experts. With 91 of 128 experts resident on the GPU, only 0.8 percent of selected experts miss the cache when a token reaches a layer. SGLang calls the improvement over uniform routing the concentration factor. The measured factor is 36-fold for Qwen3-30B GPTQ and about 6.5-fold for Qwen3-Next-80B NVFP4.
That locality allows a relatively small VRAM cache to serve most expert reads. PCIe transfers occur only when a selected expert is absent, so performance depends on the miss rate rather than the checkpoint’s total size.
A GPU-Managed Expert Cache
Paged Experts maps each expert to a fixed-size page because the fused MoE kernels consume selected experts as complete blocks. The router continues to choose among all E experts, and a placement table maps those expert IDs onto K GPU slots.
Each MoE layer can use three storage tiers:
- GPU slots: K resident experts occupy VRAM, with least-recently-used replacement selecting eviction candidates.
- Pinned host memory: expert weights are stored in page-locked RAM and pre-formatted for the fused kernel, including format-specific layouts such as Marlin.
- NVMe storage: a file holds the complete expert set when host RAM is insufficient. SGLang uses
O_DIRECTto bypass the operating system’s page cache, reads an expert into a host staging row, and copies it into a GPU slot.
Before a layer executes, a small decide kernel checks whether the router’s selections are resident. A copy kernel transfers cache misses over PCIe, then the existing fused MoE kernel runs against slot IDs. Both management kernels execute on the GPU inside the decode step’s CUDA graph, a captured schedule that reduces launch overhead.
The placement layer leaves routing and arithmetic unchanged. SGLang reports bit-identical results between paged and unpaged execution for bf16, FP8, and INT8 experts, while continuing to use the existing fused compute kernels.
Benchmarks on 16 GB
The team measured single-request decoding on an RTX 5070 Ti with 16 GB of VRAM, 62 GB of DDR5-6000 system memory, and a PCIe 5.0 NVMe drive.
| Model | Checkpoint size | Backing tier | Resident K/E | Decode rate |
|---|---|---|---|---|
| Qwen3-30B-A3B GPTQ-Int4 | 17 GB | Host RAM | 91/128 | 241.5 tok/s |
| gpt-oss-20b MXFP4 | 14 GB | Host RAM | 28/32 | 173.5 tok/s |
| Qwen3-Next-80B-A3B NVFP4 | 48 GB | Host RAM | 99/512 | 116.2 tok/s |
| Qwen3-30B-A3B FP8 | 31 GB | Host RAM | 44/128 | 113.0 tok/s |
| DeepSeek-V4-Flash | 167 GB | NVMe | 8/256 | 13.0 tok/s |
| Qwen3.8-Flash-Next-FP8 | 186 GB | NVMe | 10/512 | 14.9 tok/s |
An 8 GB RTX 4070 Laptop GPU generated 16.2 tokens per second with Qwen3-Next-80B and the disk tier enabled.
The reported GSM8K accuracy scores were 0.938 for Qwen3-30B GPTQ, 0.954 for Qwen3-Next, and 0.98 for DeepSeek-V4-Flash with thinking disabled. These results matched the team’s unpaged comparisons.
CPU Offload Pays for Every Byte
Conventional SGLang CPU offload, enabled with --cpu-offload-gb, transfers offloaded weights across PCIe during every decoding step. On the test system, VRAM delivered 843 GB/s while PCIe 5.0 delivered 52.8 GB/s, a 16-fold bandwidth gap. Moving 6 percent of a dense model’s weights over that link can therefore double the step time.
MoE paging transfers only selected experts that miss the cache. The measured 36-fold concentration factor for Qwen3-30B GPTQ keeps those transfers uncommon even when a substantial share of the expert weights sits outside VRAM.
The team’s break-even model says paging outperforms CPU-side expert computation when the concentration factor exceeds the ratio of CPU memory bandwidth to PCIe copy bandwidth. That condition holds for single-stream decoding on the tested PCIe 5.0 x16 and dual-channel DDR5 system.
Spend VRAM on Context or Concurrency
The KV cache stores attention state for prior tokens and grows with context length and concurrent requests. Paged Experts can reduce resident expert capacity to reserve more VRAM for that cache, even when the complete checkpoint already fits on the GPU.
| Serving setup | Resident experts | Decode rate |
|---|---|---|
| 10,240-token KV cache | 91/128 | 241.5 tok/s |
| 40,960-token full context | 62/128 | 218.3 tok/s |
| Four 16,384-token requests | 44/128 | 183.1 tok/s |
Reducing the resident set from 91 to 44 experts lowered decode throughput by about 24 percent while making room for four concurrent 16,384-token requests.
Five Choices That Preserve Throughput
- GPU-side graph capture: the
decideandcopykernels run inside the decode step’s CUDA graph, so the CPU does not wait for routing results. Reducing a paged layer’s graph from 21 nodes to 10 improved Qwen3-30B GPTQ decode speed by 10.3 percent. - Predictive pre-copy: SGLang predicts a layer’s expert selections during the preceding layer and begins copying them early. This reduced decode latency by 2.4 to 12.4 percent, depending on the model.
- Wave-based prefill: when a step selects more experts than the available K slots, SGLang processes groups of at most K experts. It accumulates weighted partial outputs once at the end, keeping results independent of wave order.
- Read-only NVMe storage: the disk file remains the source of truth while host staging rows retain fetched copies. Each miss becomes a one-way read and copy, which improved DeepSeek-V4 decode performance by 24.9 percent.
- Adaptive replacement: a fixed set of hot experts lost as much as 53 percentage points of cache hit rate after topic shifts. Least-recently-used replacement adapts the resident set as routing patterns change.
Prefill Exposes the Trade-offs
During prefill, which processes the input prompt before token generation begins, a few hundred tokens can route to nearly every expert in every layer. A disk-backed prefill may therefore read most of the checkpoint from NVMe. DeepSeek-V4-Flash recorded a time to first token of about 8.9 seconds for a roughly 1,500-token prompt, with performance limited by the drive’s 11 GB/s read rate. CPU offload produced lower time to first token for short prompts in this benchmark.
Current compatibility limits
- Execution is limited to one GPU, with tensor parallelism and expert parallelism currently unsupported.
- Speculative decoding is not yet supported.
- The NVMe tier requires an x86-64 host.
- Checkpoints must use Safetensors with one tensor per expert.
- The disk tier expects one prefill chunk per prompt because chunked prefill would reread the full expert set for every chunk.
Launch With One Flag
After installing SGLang v1.0.0 or building the current main branch, add --enable-paged-experts to a standard server command:
python -m sglang.launch_server \
--model-path Qwen/Qwen3-30B-A3B-GPTQ-Int4 \
--enable-paged-experts
At startup, SGLang chooses K from the VRAM remaining after fixed allocations, including the KV cache. Model-specific recipes and the additional NVMe options for large checkpoints are available in the Paged Experts docs.