[FEA] Lazy initialization of a non-empty thread pool resource
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with cpp/include/raft/core/resource/cuda_stream_pool.hpp and read raft::resource::is_stream_pool_initialized and set_cuda_stream_pool, then trace how raft::resources stores the pool. Define the lazy-initialization behavior for a const raft::resources& and verify that an existing pool reports whether it has at least n streams without requiring a handle copy.
Written by the indexing model from the issue text.
Description
Currently, raft::resources by default initializes an empty thread pool, so the user normally has to check if the pool is present using something like raft::resource::is_stream_pool_initialized and then use set_cuda_stream_pool function if necessary. The latter replaces the resource (that is, modifies the state of the raft::resources handle).
After https://github.com/rapidsai/raft/pull/3005 , this requires a non-const reference to the raft::resources handle, so setting the stream pool within a library function accepting const raft::resources& means copying the raft::resources handle (see https://github.com/rapidsai/cuvs/pull/2103).
To avoid this extra copy, I propose we add something like bool stream_pool_has_streams(const raft::resources& res, int n), which lazily initializes the pool with the size n; if the pool is already initialized, returns whether it has n or more threads.
- Dominant language
- Cuda
- Stars
- 1.1k
- Forks
- 260
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 21
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/raft
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
[BUG] Half-precision gemm fails with CUBLAS_STATUS_NOT_SUPPORTED when A or B is not 16-byte alignedOpenbug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
[BUG] A column with one infinity sums to NaN in `raft::stats::sum`Possibly taken @galleonli claimed this 4 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
[FEA] Return centers generated by raft::random::make_blobsPossibly taken @NIne-WIngEd claimed this 36 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 53/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nicobailon/pi-subagents#3425 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jelmer/buildlog-consultant#364 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day