Expose CuPy memory pool to C/C++ space?
See original GitHub issueI found the following snippet (L15-L40) in cupy.cuda.thrust
:
https://github.com/cupy/cupy/blob/4586fedac8254dcd71d97617f2f95f98254dbbcc/cupy/cuda/thrust.pyx#L15-L40
I think this is an important low-level API for external C/C++/Cython code (such as Thrust and CUB) to use CuPy’s memory pool. Is it possible to move them to, say, cupy/cuda/memory.pxd
so that it can be reused?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Memory Management — CuPy 11.4.0 documentation
CuPy uses memory pool for memory allocations by default. The memory pool significantly improves the performance by mitigating the overhead of memory allocation ......
Read more >Cupy freeing unified memory - Stack Overflow
When I create a variable that will be allocated to the unified memory and want to free it, it is labelled as being...
Read more >An Annotation Tool for Profiling Code in Python and C/C++
We use CuPy, a NumPy-like library targeting GPUs, to operate on the data ... RMM pool allocator which will create a large upfront...
Read more >NBEP 7: CUDA External Memory Management Plugins
CuPy includes a memory pool implementation for both device and pinned memory. ... These will be exposed through the public API, in the...
Read more >arXiv:2008.00325v3 [cs.LG] 29 Mar 2021
high-dimensional data in a low-dimensional space. This is ... memory pool for each process to avoid device synchroniza-.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s right. Currently all CUB routines integrated with CuPy use CuPy memory pool. This is just for future extensions and code reusability.
Closing this issue as CuPy’s (Cython-based) memory pool would not be as performant as C/C++ based ones, so it is of limited interest to native C/C++ applications. (For Python applications, it should be fairly simple to access this pool.)
However, this issue aside, I do think #3212 is a good housecleaning PR. Memory management should simply not appear in
cupy/cuda/thrust.pyx
…Just my two cents.