Retrieved article excerpt
Open article · Retrieved 2026-10-30T20:25:28.345885+00:00
## Repository navigation
# [Qwen4Exp] PLE disk offload - #59958
#59958
Merged
[arpera](https://github.com/arpera) merged 21 commits into
[vllm-project:main](https://github.com/vllm-project/vllm/tree/main)vllm-project/vllm:mainfrom
[stecasta:feat/qwen4-exp-ple-host-gather-nvfp4](https://github.com/stecasta/vllm/tree/feat/qwen4-exp-ple-host-gather-nvfp4)stecasta/vllm:feat/qwen4-exp-ple-host-gather-nvfp4Copy head branch name to clipboard
Oct 30, 2026
Merged
## [[Qwen4Exp] PLE disk offload](https://github.com/vllm-project/vllm/pull/59958#top)#59958 [arpera](https://github.com/arpera) merged 21 commits into [vllm-project:main](https://github.com/vllm-project/vllm/tree/main)vllm-project/vllm:mainfrom [stecasta:feat/qwen4-exp-ple-host-gather-nvfp4](https://github.com/stecasta/vllm/tree/feat/qwen4-exp-ple-host-gather-nvfp4)stecasta/vllm:feat/qwen4-exp-ple-host-gather-nvfp4Copy head branch name to clipboard
## Conversation
[@stecasta](https://github.com/stecasta)
### @stecasta **[stecasta](https://github.com/stecasta)** commented [Oct 4, 2026](https://github.com/vllm-project/vllm/pull/59958#issue-5700494817) • edited Loading Uh oh! There was an error while loading. [Please reload this page](https://github.com/vllm-project/vllm/pull/59958).
Copy link
Copy Markdown
Contributor
## Overview
Adds `--engram-config '{"disk_offload": true}'` for Qwen4Exp. The PLE n-gram table stays in the checkpoint files, and each step reads only its rows on the host. On DGX Spark (GB10), Qwen3.8-Flash-Next NVFP4 loads with 27.0 GiB less memory. Decode is within 3.5% of the resident table, and GSM8K is unchanged.
This carries forward [@Trosfy](https://github.com/Trosfy)'s design from [#58815](https://github.com/vllm-project/vllm/pull/58815) (their commits are kept, co-authored). It is rebased onto the NVFP4 PLE tables from [#56273](https://github.com/vllm-project/vllm/pull/56273) and renamed `disk_offload` to pair with `cpu_offload`.
## Claims
- **Memory:** no table in GPU or pinned host memory, and no copy in an offload directory. Recently read rows sit in the OS page cache, which the kernel can reclaim. The page cache does fill up over a long session (ids are hashed, so there is no locality), but the kernel reclaims it on demand without hurting decode; the cost of a cold table is in TTFT (below). Use it with the checkpoint on local NVMe: on network storage a cold prefill is 2 to 4.5x slower. On unified-memory Spark, `cpu_offload` does not help, because pinned memory comes out of the same pool as the weights and the KV cache.
- **Formats:** BF16, FP8 and NVFP4. Rows are read in checkpoint format and decoded on the GPU with the existing PLE kernel.
- **CUDA graphs:** the forward reads fixed device buffers, so graphs replay unchanged.
- **Cost:** decode within 3.5% at c=1/4/8, and about 11% higher TTFT.
## Validation
Qwen3.8-Flash-Next-NVFP4 (`local-inference-lab@6c01ac3`), one GB10, both arms in one job on the same node. MTP n=3, FP8 KV (6 GiB), prefix caching off.
| | Resident | `disk_offload` | Delta |
| --- | --- | --- | --- |
| Weights loaded | 99.09 GiB | 72.09 GiB | -27.0 GiB |
| Host `MemAvailable` after startup | 4.6 GiB | 32.0 GiB | +27.4 GiB |
| Decode tok/s/user, c=1 | 33.63 | 32.45 | -3.5% |
| Decode tok/s, c=4 | 72.57 | 73.33 | +1.0% |
| Decode tok/s, c=8 | 94.04 | 91.99 | -2.2% |
| MTP acceptance length, c=1 | 2.33 | 2.31 | flat |
| TTFT, 8K prompt (median of 15) | 2540 ms | 2820 ms | +11.0% |
| GSM8K | 247/256 | 246/256 | -1 |
- Decode: aiperf, SPEED-Bench coding prompts, 1024 output tokens, active decode time only. One run per arm, so noise is a few percent.
- TTFT: exact-length random token ids with `max_tokens=1`. With the page cache dropped, the first 8K request took 3018 ms.
- The image was `vllm/vllm-openai:nightly-5555a2d8f7`, with every file touched by this PR and [[Quantization] Support packed NVFP4 Qwen4Exp PLE embeddings #56273](https://github.com/vllm-project/vllm/pull/56273) overlaid from this branch.
- CI: the H200 and CPU Qwen4 Exp lanes run the new tests. The Spark numbers were measured outside CI because there is no GB10 lane. On GB10 the new tests pass for all three formats.
### Cold cache and memory pressure
Same PR head (`396e7e0102`) and serve command, checkpoint on the node's local NVMe (ext4), one GB10. Page-cache residency is measured with `mincore` over the PLE shards; the memory cap is a cgroup `memory.max` on the container (GPU allocations are not charged to it). Short runs (3 to 6 rounds), so decode differences under ~10% are within noise.
| | Table in page cache | Decode c=1 | TTFT, 8K prompt | Disk read per 8K prefill |
| --- | --- | --- | --- | --- |
| Resident table | n/a | 40.1 tok/s | 2597 ms | 0 |
| `disk_offload`, warm (prompt rows cached for TTFT) | 8 to 25% | 35.8 tok/s | 2832 ms | 0 |
| `disk_offload`, page cache dropped before every request | 0% | 36.3 tok/s | 3110 ms | 1.04 GB |
| `disk_offload`, cgroup cap leaving 2 GiB for page cache | held at 4.7% | 37.6 tok/s | 3174 ms | 1.0 GB |
| `disk_offload`, checkpoint on NFS, cold | 0% | 34.5 tok/s | 6547 ms | 1.04 GB |
- Decode reads 5 to 17 MB/s from disk in every state, so it does not depend on the cache; c=4 aggregate stays at 81 to 90 tok/s cold and capped.
- A cold 8K prefill reads about 1 GB (300 to 330 MB/s on NVMe): +20% TTFT vs the resident table. Each PLE row is 80 B of NVFP4 weights plus 10 B of scales in separate tensors, so a lookup touches two 4 KiB pages; bytes read from disk were 3.6x the bytes requested.
- Without memory pressure the cached part of the table grows linearly, about 0.36% of the table per 1K generated tokens (11.8% after 33K tokens, no plateau). When memory is needed, the kernel reclaims it with no decode loss (residency held at 4.7% under the 2 GiB cap).
Commands
```
vllm serve local-inference-lab/Qwen3.8-Flash-Next-NVFP4 --language-model-only \
--max-model-len 32768 --max-num-seqs 8 --max-num-batched-tokens 4096 \
--kv-cache-dtype fp8 --kv-cache-memory-bytes 6G --gpu-memory-utilization 0.87 \
--no-enable-prefix-caching \
--speculative-config '{"method": "mtp", "num_speculative_tokens": 3}' \
--compilation-config '{"max_cudagraph_capture_size": 32}' \
--engram-config '{"disk_offload": true}' # resident: '{"cpu_offload": false}'
pytest tests/models/qwen4_exp/test_ple.py tests/models/qwen4_exp/test_config.py
pytest tests/test_config.py -k engram
```
## Details
- **Load:** the default loader hands over zero-copy safetensors mmap views. Their file and offset are found in `/proc/self/maps`, the files are opened read-only, and the views are released. Loading fails if the shards do not cover the table, if a dtype does not match, or if a view is not file-backed (for example `.bin` or `fastsafetensors`).
- **Per step:** `Qwen4ExpModelState.prepare_inputs` computes and deduplicates the n-gram ids, reads each row with `preadv` (after a `WILLNEED` read-ahead hint), and copies the rows to the staging buffers.
- **Parallelism:** every TP rank stages full rows, so no ETP reduction is needed. Elastic EP is rejected.
- **Alternatives:** [[Qwen4Exp] Checkpoint-mapped PLE storage for unified-memory GPUs (DGX Spark) #58439](https://github.com/vllm-project/vllm/pull/58439) reads the checkpoint mapping from the GPU through host page tables. [[Feature] Disk-backed PLE n-gram tables (`VLLM_PLE_DISK_OFFLOAD_DIR`) #54070](https://github.com/vllm-project/vllm/pull/54070) writes a second copy of the table to disk. This PR reads rows on the host from the files the loader already opened.
This PR does not batch the per-row reads for long prefills (that is the TTFT cost), change the checkpoint layout (rows and scales in one tensor would halve the pages per lookup), or support weight reload.
AI assistance (Claude) was used. I reviewed every line and ran the tests and measurements above.
---
Pull Request Checklist
- I used vLLM's `/pr-checklist` skill. (Mandatory for agents, optional for humans).
- AI assistance was used during the creation of this PR.
- **Design Fit:** Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
- **Testing and Validation:** Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
- **Code Quality and Style:** Keeps code and comments clear and concise, and updates relevant documentation and examples.
- **Pull Request Contents:** Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
**BEFORE SUBMITTING, PLEASE READ <https://docs.vllm.ai/en/latest/contributing>** (anything written below this line will be removed by GitHub Actions)
[@mergify](https://github.com/apps/mergify)
### **[mergify](https://github.com/apps/mergify) Bot** commented [Oct 4, 2026](https://github.com/vllm-project/vllm/pull/59958#issuecomment-5981391405)
Copy link
Copy Markdown
Contributor
| |
| --- |
| Documentation preview: <https://vllm--59958.org.readthedocs.build/en/59958/> |
[@mergify](https://github.com/apps/mergify)
[mergify](https://github.com/apps/mergify)
Bot
added
[documentation](https://github.com/vllm-project/vllm/issues?q=state%3Aopen%20label%3Adocumentation)
Improvements or additions to documentation
[ci/build](https://github.com/vllm-project/vllm/issues?q=state%3Aopen%20label%3Aci%2Fbuild)
[qwen](https://github.com/vllm-project/vllm/issues?q=state%3Aopen%20label%3Aqwen)
Related to Qwen models
labels
[Oct 4, 2026](https://github.com/vllm-project/vllm/pull/59958#event-32448730509)
[@stecasta](https://github.com/stecasta)
[stecasta](https://github.com/stecasta)
mentioned this pull request
[Oct 4, 2026](https://github.com/vllm-project/vllm/pull/59958#ref-pullrequest-5590719483)
[[Qwen4Exp] Gather PLE rows on the host from the checkpoint files (`host_file_gather`)
#58815](https://github.com/vllm-project/vllm/pull/58815)
Open
4 of 5 tasks
[@stecasta](https://github.com/stecasta)
[stecasta](https://github.com/stecasta)
marked this pull request as ready for review
[October 5, 2026 10:11](https://github.com/vllm-project/vllm/pull/59958#event-32497641888)
[@stecasta](https://github.com/stecasta)
[stecasta](https://github.com/stecasta)
requested review from
[AndreasKaratzas](https://github.com/AndreasKaratzas),
[DarkLight1337](https://github.com/DarkLight1337),
[Harry-Chen](https://github.com/Harry-Chen),
[WoosukKwon](https://github.com/WoosukKwon),
[gau-nernst](https://github.com/gau-nernst),
[houseroad](https://github.com/houseroad),
[khluu](https://github.com/khluu),
[mgoin](https://github.com/mgoin),
[robertgshaw2-redhat](https://github.com/robertgshaw2-redhat),
[tlrmchlsmth](https://github.com/tlrmchlsmth),
[yewentao256](https://github.com/yewentao256),
[youkaichao](https://github.com/youkaichao) and
[ywang96](https://github.com/ywang96)
as [code owners](https://github.com/vllm-project/vllm/blob/b1401e0aa7eb7803c38e4d2d306cb2a16c8828a2/.github/CODEOWNERS#L106)
[October 5, 2026 10:11](https://github.com/vllm-project/vllm/pull/59958#event-32497643867)
[claude[bot]](https://github.com/apps/claude)
**[claude](https://github.com/apps/claude)
Bot**
reviewed
[Oct 5, 2026](https://github.com/vllm-project/vllm/pull/59958#pullrequestreview-5412939850)
[View reviewed changes](https://github.com/vllm-project/vllm/pull/59958/files)
### @claude **[claude](https://github.com/apps/claude) Bot** left a comment
Copy link
Copy Markdown
There was a problem hiding this comment.
### Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. [Learn more](https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment).
## Claude Code Review
This pull request is from a fork — automated review is disabled. A repository maintainer can comment `@claude review` to run a one-time review.
[@stecasta](https://gi