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.

Move CUDA Low Level API to other namespace

See original GitHub issue

The cupy.cuda namespace is confusing.

  1. cupy.cuda is not in NumPy
  2. Mixing Low Level API and CuPy original wrapper

Especially solving the second problem simplifies CuPy development. (The first problem is a bit difficult because it requires design discussion.)

The implementation of some features on CuPy does not provide CUDA’s Low Level API. Therefore, I think it is better to start with partial separation first.

With this change, CuPy may be able to provide Cython CUDA API in the future #130.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
okutacommented, Jul 13, 2020

The cupy.cuda namespace is confusing.

  1. cupy.cuda is not in NumPy
  2. Mixing Low Level API and CuPy original wrapper

These were the problems I wanted to solve. However, I gave up moving the whole cupy.cuda because cupy.cuda has a dependency on cupy.core.ndarray. A circular reference exists when cupy.cuda is moved to another namespace (e.g., cupy_XXXX).

Therefore, I introduced cupy_backends.cuda.api and backends.cuda.libs. I moved low-level CUDA API wrappers. The problem of the Stream was avoided by introducing a flag.

cupy_backends.cuda is a useful namespace. Wouldn’t it be a good idea to cut out features that could be used in other libraries? #3584 is an example implementation of this.

I think it’s good to put the following items in cupy_backends.cuda.

  • An object with a life cycle. It hides the create-destroy method call. For example, Stream/Event/Memory etc.
  • Thin Pythonic wrappers. Like this. For example, compiler/profiler etc.

I’d like to get your opinion. I’m going to make a different issue because it’s not on the same topic as the original.

1reaction
okutacommented, Jun 6, 2020

I agree with you.

We are currently experiencing a dependency from a Stream issue. A Stream dependency now exists. I will send a PR that resolve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CUDA C++ Programming Guide - NVIDIA Documentation Center
The driver API provides an additional level of control by exposing lower-level concepts such as CUDA contexts - the analogue of host processes...
Read more >
CUDA API interoperability · Issue #4797 · numba ... - GitHub
Then all the different CUDA Python projects could depend on this package, ... Move CUDA Low Level API to other namespace cupy/cupy#3385.
Read more >
NVIDIA CUDA Programming Guide
The CUDA driver API is a lower-level C API that provides functions to load kernels as modules of CUDA binary or assembly code, ......
Read more >
CUDA C Programming Guide
Appendix Driver API introduces the low-level driver API. ‣ Appendix CUDA Environment Variables lists all the CUDA environment variables.
Read more >
Memory Management — CuPy 11.4.0 documentation
There are two different memory pools in CuPy: Device memory pool (GPU device ... See Low-level CUDA support for the details of memory...
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