NVIDIA / NVIDIA/cudf

[FEA] Allow cudf::thread_pool to restrict the number of threads available.

Open
#15,575 0 comments 0 reactions 0 assignees View on GitHub
feature request libcudf
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

I have a benchmarking use case where it would be nice to be able to use a single thread pool across multiple benchmarks for ease of viewing in nsys. Imagine a benchmark where one of your testing axes is the number of threads used to split up the work. Say, 2, 4 and 8 threads. The way you would do this today is you would create a new `thread_pool` in each instance of the benchmark with the appropriate number of threads. The problem with this is that each thread gets it's own line of data in nsys. So you end up with 14 total threads that you have to expand and hunt down. This gets worse if you have other axes. You can very quickly get up into 64 or more threads, which is a bit of a headache to sort through.

Instead, it would be nice if we could create a thread pool and temporarily restrict the number of threads it would use for newly submitted jobs. So what your benchmark could do is create a single global thread pool (say, 8 threads above). And then just set the thread count restriction in each benchmark. So you would have a nice clean timeline with a tractable number of threads in nsys.

Alternately, a way to sub-allocate out of an existing pool (temporarily funding one thread_pool with the threads from another) would work as well.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.