question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose CuPy memory pool to C/C++ space?

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
leofangcommented, Nov 26, 2019

That’s right. Currently all CUB routines integrated with CuPy use CuPy memory pool. This is just for future extensions and code reusability.

0reactions
leofangcommented, Apr 20, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found