[FEA]Expose a pooled pinned host memory resource in the C API
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Cuda
- スター
- 902
- フォーク
- 267
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 57
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/cuvs のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
[BUG] CAGRA multi-CTA and multi-kernel search over-allocate the hashmap they use対応中かも @mc8max が 12 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
[BUG] cuVS Bench Faiss CAGRA b_ratio reads the wrong JSON key対応中かも @arcusbuilds が 55 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
doc
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Upgrade faiss to v1.16.0対応中かも @aamijar が 8 日前に担当しました。 オープンfaiss improvement
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
aws-documentation-mcp-server: empty spanning headers shift table column labels対応中かも @pradeep-ramola が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensearch-project/sql#5990 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
GustavoBaranda/chatflow-agent#238 ·
メンテナーはふだん 1 日以内に返信