[FEA]Expose a pooled pinned host memory resource in the C API
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
Hướng nghiên cứu
Start from the existing host allocation pair cuvsRMMHostAlloc / cuvsRMMHostFree in the C API and from the device-side cuvsRMMPoolMemoryResourceEnable, which is the pattern to copy for the new Enable/Disable functions. Then read the regenerated Rust bindings in cuvs-sys (bindings.rs). Done means the two new functions exist, the alloc/free calls route through a mutex-protected process-wide pinned pool when enabled, and the default path is unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
In C++, pinned host memory can be pooled by composing RMM resources
(pool_memory_resource over pinned_host_memory_resource). The C API has no equivalent. It only
offers cuvsRMMHostAlloc / cuvsRMMHostFree, which bypass any pool and perform one cudaMallocHost /
cudaFreeHost per call. Callers that reach cuVS through the C API, including the language bindings
(Rust, Python, Go, Java), cannot get a pinned host pool, and must register memory themselves or write
their own allocator.
The device side already exposes a pooled resource through cuvsRMMPoolMemoryResourceEnable. This
proposes the host-side counterpart.
Describe the solution you'd like
Add a process-wide pinned host pool to the C API:
cuvsError_t cuvsRMMPinnedHostPoolEnable(size_t pool_size_bytes);
cuvsError_t cuvsRMMPinnedHostPoolDisable();
cuvsRMMPinnedHostPoolEnable(pool_size_bytes)creates onepool_memory_resourceover
pinned_host_memory_resource, with initial size == maximum size, so the pinning cost is paid once, up
front.- While the pool is enabled,
cuvsRMMHostAlloc/cuvsRMMHostFreeuse it. If the pool is exhausted,
cuvsRMMHostAllocreturns an error and does not fall back silently, so the caller decides what to do. - The pool is held process-wide (mutex-protected) rather than
thread_local. A pool is stateful, so a
per-thread pool would multiply the pinned memory by the number of threads, and memory freed on a
different thread than the one that allocated it would be returned to the wrong pool. - With the pool disabled (the default), behaviour is unchanged: one
cudaMallocHostper call.
Regenerated Rust bindings in cuvs-sys (bindings.rs).
Because the pool is opt-in, these costs only apply to callers that enable it:
- Pinning cost.
Enablepins the whole pool up front, which we measured at about 0.3 s per GiB, so the
pool should be sized to the peak amount in use at once.
Describe alternatives you've considered
- Change
cuvsRMMHostAllocinternally, with no new function. The caller then cannot choose the pool
size, and existing callers would start holding pinned memory for the life of the process. We prefer an
explicit opt-in function. - Expose the C++ API only. C API users and the bindings still cannot reach it.
Additional context
We have a working patch (C API + Rust bindings) and will open a new PR.
- Ngôn ngữ chính
- Cuda
- Star
- 902
- Fork
- 267
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/cuvs
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] CAGRA multi-CTA and multi-kernel search over-allocate the hashmap they useCó thể đã có người làm @mc8max đã nhận 12 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NVIDIA/cuvs#2856 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] cuVS Bench Faiss CAGRA b_ratio reads the wrong JSON keyCó thể đã có người làm @arcusbuilds đã nhận 55 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade faiss to v1.16.0Có thể đã có người làm @aamijar đã nhận 8 ngày trước. Đang mởfaiss improvement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vllm-project/vllm#70030 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted small extra
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
t: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Retry an empty final answer when Gemini reports MALFORMED_RESPONSE (gemini-4-hydrogen)Có thể đã có người làm @waleedkadous đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
iaser-ai/ansari#444 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày