[FEA]Expose a pooled pinned host memory resource in the C API
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Cuda
- Stelle
- 902
- Fork
- 267
- Merge medio
- 2g 21h
- PR unite (30g)
- 57
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/cuvs
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] CAGRA multi-CTA and multi-kernel search over-allocate the hashmap they useForse già presa @mc8max l’ha presa 12 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NVIDIA/cuvs#2856 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] cuVS Bench Faiss CAGRA b_ratio reads the wrong JSON keyForse già presa @arcusbuilds l’ha presa 55 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
doc
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Upgrade faiss to v1.16.0Forse già presa @aamijar l’ha presa 8 giorni fa. Apertafaiss improvement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
aws-documentation-mcp-server: empty spanning headers shift table column labelsForse già presa @pradeep-ramola l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opensearch-project/sql#5990 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
GustavoBaranda/chatflow-agent#238 ·
I maintainer di solito rispondono entro 1 giorno