Repository navigation
[HiSparse] Allow backing the host KV pool with hugetlbfs - #58852
Draft
LucasWilkinson wants to merge 1 commit into
Draft
LucasWilkinson wants to merge 1 commit into
LucasWilkinson wants to merge 1 commit into
Conversation
Contributor
|
Documentation preview: https://vllm--58852.org.readthedocs.build/en/58852/ |
46 of 67 tasks
5 of 6 tasks
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
LucasWilkinson
force-pushed
the
hisparse-hugetlbfs-host-pool
branch
from
October 15, 2026 14:44
5d51604 to
09582e0
Compare
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
6 tasks done
Add a host_pool_dir option on HiSparseConnector. When set, both the shared TP pool and private per-rank pools are file-backed mmaps in that directory, so a hugetlbfs mount (e.g. a K8s HugePages-1Gi emptyDir) cuts the number of pages cudaHostRegister and NIXL/RDMA registration must pin by up to 262144x. SharedOffloadRegion gains a shm_dir argument, rounds the mapping to the filesystem page size, and skips the tmpfs free-space check on hugetlbfs, where mmap reserves the huge pages and fails with ENOMEM instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
LucasWilkinson
force-pushed
the
hisparse-hugetlbfs-host-pool
branch
from
October 25, 2026 22:55
09582e0 to
f49c7a5
Compare
6 tasks done
Etelis
pushed a commit
to Etelis/vllm
that referenced
this pull request
Oct 27, 2026
Add host_pool_dir for shared and private file-backed HiSparse pools. Based on vllm-project#58852. Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Etelis
added a commit
to Etelis/vllm
that referenced
this pull request
Oct 27, 2026
Build on the host_pool_dir interface from vllm-project#58852. Request transparent huge pages before population, align shared prefault shards, and retain RAM and capacity checks for ordinary file-backed pools. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Etelis
added a commit
to Etelis/vllm
that referenced
this pull request
Oct 27, 2026
Build on the host_pool_dir interface from vllm-project#58852. Request transparent huge pages before population, align shared prefault shards, and retain RAM and capacity checks for ordinary file-backed pools. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Large HiSparse host pools (384–480 GiB) are pinned twice on 4 KiB pages: by
cudaHostRegisterand by NIXL/RDMA registration. In the shared TP pool, every rank also registers the whole pool. At 450 GiB that's about 118M pages per pass, and we've seen it wedge K8s nodes during startup.This PR adds an opt-in
host_pool_dirkey onHiSparseConnector. When it's set, the host pool is a file-backed mmap in that directory, typically a hugetlbfs mount. With 1 GiB pages, 450 GiB becomes 450 pages, so pinning and MR translation tables become trivial.{"kv_connector": "HiSparseConnector", "kv_role": "kv_both", "kv_connector_extra_config": {"host_pool_gib": 384, "host_pool_dir": "/dev/hugepages-1Gi"}}On K8s:
emptyDir: {medium: HugePages-1Gi}plusresources.limits.hugepages-1Gi: <pool size>. The node must reserve 1 GiB huge pages.Changes:
SharedOffloadRegiongets ashm_dirargument, defaulting to/dev/shm, so existing behavior doesn't change. The mapping is rounded to the filesystem page size (statvfs().f_bsize); callers still see exactlytotal_size_bytes. On hugetlbfs the tmpfs free-space check is skipped, because hugetlbfsstatfsreports 0 free without asize=limit.mmapreserves the huge pages instead, and anENOMEMis turned into a clear error. A hugetlbfs region always uses one backing file, because huge-page files can't be stitched together at arbitrary offsets the waynum_segmentsdoes.shm_dirthrough. Each rank's prefault shard is rounded to the huge page size, so ranks don't fault the same huge page. It skips the psutil RAM check, because reserved huge pages don't count towardMemAvailable.host_pool_diris set, allocates an unlinked, pre-faulted file mapping in that directory instead oftorch.empty.Not a duplicate: #45693 (draft, needs rebase) adds hugetlbfs support to the OffloadingConnector
TieringOffloadingSpec. This PR targets the HiSparse host pool, which that PR doesn't touch. The two overlap only inSharedOffloadRegion, and the change there is kept minimal so they can be reconciled.Status: mockup / draft. Not yet validated on a real hugetlbfs mount (see test plan).
Test Plan / Results
pytest tests/v1/kv_offload/cpu tests/v1/worker/test_utils.py: 238 passed, 1 skipped.pytest tests/v1/core/test_kv_cache_planning.py tests/v1/core/test_kv_cache_utils.py -k "hisparse or host_pool": 14 passed.host_pool_dir.cudaHostRegisterin 3.6 s, and a D2H copy ran at 54 GB/s with correct data. This used tmpfs-backed files, because the dev box has no reserved huge pages and no root.AI assistance (Claude Code) was used to write this change; it will be reviewed end-to-end before being marked ready.
🤖 Generated with Claude Code