NVIDIA/cuda-python

CUDA Python: Performance meets Productivity

What it solves

It provides a unified way to access NVIDIA's CUDA platform from Python, removing the need for developers to write low-level C code to manage GPU resources and execute parallel algorithms. It aims to flatten the learning curve for CUDA development and increase developer productivity by allowing end-to-end GPU programming entirely within Python.

How it works

The project is structured as a metapackage containing several specialized subpackages:

  • cuda.core: Provides idiomatic, Pythonic access to the CUDA Driver, Runtime, and JIT compiler toolchain.
  • cuda.bindings: Offers low-level Python bindings to the CUDA C APIs (including Driver, Runtime, NVRTC, and NVML).
  • cuda.compute: Provides access to parallel algorithms like sort, scan, and reduce that can be called from the host.
  • cuda.tile: A domain-specific language (DSL) for writing NumPy-like code directly in CUDA kernels.
  • numba-cuda-mlir and numba.cuda: Tools for JIT compilation and developing SIMT kernels in Python.
  • nvmath-python: Provides access to NVIDIA's CPU and GPU math libraries.
  • nvshmem4py: An interface for high-performance partitioned global address space (PGAS) programming.
  • Profiling Tools: Includes Nsight Python and CUPTI Python for performance analysis and kernel profiling.

Who it’s for

Developers who want to leverage NVIDIA GPUs for accelerated computing using Python, ranging from those who need high-level idiomatic abstractions to those who require low-level control over CUDA C APIs.

Highlights

  • Comprehensive Ecosystem: Covers everything from low-level bindings to high-level DSLs for kernel writing.
  • Pythonic Interface: Reduces the burden of maintaining custom CUDA abstractions.
  • Full API Coverage: Provides complete access to CUDA host APIs via cuda.bindings.
  • Integrated Profiling: Includes built-in interfaces for performance analysis via Nsight and CUPTI.

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Project