Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NVIDIA/cuda-python
CUDA Python Low-level Bindings
https://github.com/NVIDIA/cuda-python
Last synced: 3 months ago
JSON representation
CUDA Python Low-level Bindings
- Host: GitHub
- URL: https://github.com/NVIDIA/cuda-python
- Owner: NVIDIA
- License: other
- Created: 2021-06-28T22:14:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T01:04:32.000Z (3 months ago)
- Last Synced: 2024-10-26T08:32:13.485Z (3 months ago)
- Language: Python
- Homepage: https://nvidia.github.io/cuda-python/
- Size: 18.4 MB
- Stars: 874
- Watchers: 35
- Forks: 71
- Open Issues: 75
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cuda-triton-hpc - NVIDIA/cuda-python - python?style=social"/> : CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. CUDA Python Low-level Bindings. [nvidia.github.io/cuda-python/](https://nvidia.github.io/cuda-python/latest/) (Frameworks)
README
# CUDA-Python
CUDA Python is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. Checkout the [Overview](https://nvidia.github.io/cuda-python/overview.html) for the workflow and performance results.
## Installing
CUDA Python can be installed from:
* PYPI
* Conda (nvidia channel)
* Source buildsThere're differences in each of these options that are described further in [Installation](https://nvidia.github.io/cuda-python/install.html) documentation. Each package will guarantee minor version compatibility.
## Runtime Dependencies
CUDA Python is supported on all platforms that CUDA is supported. Specific dependencies are as follows:
* Driver: Linux (450.80.02 or later) Windows (456.38 or later)
* CUDA Toolkit 12.0 to 12.6Only the NVRTC redistributable component is required from the CUDA Toolkit. [CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/index.html) Installation Guides can be used for guidance. Note that the NVRTC component in the Toolkit can be obtained via PYPI, Conda or Local Installer.
### Supported Python Versions
CUDA Python follows [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html) for supported Python version guarantee.
Before dropping support, an issue will be raised to look for feedback.
Source builds work for multiple Python versions, however pre-build PyPI and Conda packages are only provided for a subset:
* Python 3.9 to 3.12
## Testing
### Requirements
Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt).
### Unit-tests
You can run the included tests with:
```
python -m pytest tests/
```### Benchmark
You can run benchmark only tests with:
```
python -m pytest --benchmark-only benchmarks/
```### Samples
You can run the included tests with:
```
python -m pytest examples/
```## Examples
CUDA Samples rewriten using CUDA Python are found in `examples`.
Custom extra included examples:
- `examples/extra/jit_program_test.py`: Demonstrates the use of the API to compile and
launch a kernel on the device. Includes device memory allocation /
deallocation, transfers between host and device, creation and usage of
streams, and context management.
- `examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management
plugin, showing that this CUDA Python Driver API can coexist with other
wrappers of the driver API.