|
1 | 1 | # CUDA-Python
|
2 | 2 |
|
3 |
| -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. |
| 3 | +CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It consists of multiple components: |
4 | 4 |
|
5 |
| -## Installing |
| 5 | +* [cuda.core](https://nvidia.github.io/cuda-python/cuda-core/latest): Pythonic access to CUDA Runtime and other core functionalities |
| 6 | +* [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs |
| 7 | +* [cuda.cooperative](https://nvidia.github.io/cccl/cuda_cooperative/): Pythonic exposure of CUB cooperative algorithms |
| 8 | +* [cuda.parallel](https://nvidia.github.io/cccl/cuda_parallel/): Pythonic exposure of Thrust parallel algorithms |
6 | 9 |
|
7 |
| -CUDA Python can be installed from: |
| 10 | +For access to NVIDIA Math Libraries, please refer to [nvmath-python](https://docs.nvidia.com/cuda/nvmath-python/latest). |
8 | 11 |
|
9 |
| -* PYPI |
10 |
| -* Conda (nvidia channel) |
11 |
| -* Source builds |
| 12 | +CUDA Python is currently undergoing an overhaul to improve existing and bring up new components. All of the previously available functionalities from the cuda-python package will continue to be available, please refer to the [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest) documentation for installation guide and further detail. |
12 | 13 |
|
13 |
| -There'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. |
| 14 | +## CUDA-Python as a metapackage |
14 | 15 |
|
15 |
| -## Runtime Dependencies |
| 16 | +CUDA-Python is structured to become a metapackage that contains a collection of subpackages. Each subpackage is versioned independently, allowing installation of each component as needed. |
16 | 17 |
|
17 |
| -CUDA Python is supported on all platforms that CUDA is supported. Specific dependencies are as follows: |
| 18 | +### Subpackage: `cuda.core` |
18 | 19 |
|
19 |
| -* Driver: Linux (450.80.02 or later) Windows (456.38 or later) |
20 |
| -* CUDA Toolkit 12.0 to 12.6 |
| 20 | +The `cuda.core` package offers idiomatic, pythonic access to CUDA Runtime and other functionalities. |
21 | 21 |
|
22 |
| -Only 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. |
| 22 | +The goals are to |
23 | 23 |
|
24 |
| -### Supported Python Versions |
| 24 | +1. Provide **idiomatic (“pythonic”)** access to CUDA Driver/Runtime |
| 25 | +2. Focus on **developer productivity** by ensuring end-to-end CUDA development can be performed quickly and entirely in Python |
| 26 | +3. **Avoid homegrown** Python abstractions for CUDA for new Python GPU libraries starting from scratch |
| 27 | +4. **Ease** developer **burden of maintaining** and catching up with latest CUDA features |
| 28 | +5. **Flatten the learning curve** for current and future generations of CUDA developers |
25 | 29 |
|
26 |
| -CUDA Python follows [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html) for supported Python version guarantee. |
| 30 | +### Subpackage: `cuda.bindings` |
27 | 31 |
|
28 |
| -Before dropping support, an issue will be raised to look for feedback. |
| 32 | +The `cuda.bindings` package is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. |
29 | 33 |
|
30 |
| -Source builds work for multiple Python versions, however pre-build PyPI and Conda packages are only provided for a subset: |
| 34 | +The list of available interfaces are: |
31 | 35 |
|
32 |
| -* Python 3.9 to 3.12 |
33 |
| - |
34 |
| -## Testing |
35 |
| - |
36 |
| -### Requirements |
37 |
| - |
38 |
| -Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt). |
39 |
| - |
40 |
| -### Unit-tests |
41 |
| - |
42 |
| -You can run the included tests with: |
43 |
| - |
44 |
| -``` |
45 |
| -python -m pytest tests/ |
46 |
| -``` |
47 |
| - |
48 |
| -### Benchmark |
49 |
| - |
50 |
| -You can run benchmark only tests with: |
51 |
| - |
52 |
| -``` |
53 |
| -python -m pytest --benchmark-only benchmarks/ |
54 |
| -``` |
55 |
| - |
56 |
| -### Samples |
57 |
| - |
58 |
| -You can run the included tests with: |
59 |
| - |
60 |
| -``` |
61 |
| -python -m pytest examples/ |
62 |
| -``` |
63 |
| - |
64 |
| -## Examples |
65 |
| - |
66 |
| -CUDA Samples rewriten using CUDA Python are found in `examples`. |
67 |
| - |
68 |
| -Custom extra included examples: |
69 |
| - |
70 |
| -- `examples/extra/jit_program_test.py`: Demonstrates the use of the API to compile and |
71 |
| - launch a kernel on the device. Includes device memory allocation / |
72 |
| - deallocation, transfers between host and device, creation and usage of |
73 |
| - streams, and context management. |
74 |
| -- `examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management |
75 |
| - plugin, showing that this CUDA Python Driver API can coexist with other |
76 |
| - wrappers of the driver API. |
| 36 | +* CUDA Driver |
| 37 | +* CUDA Runtime |
| 38 | +* NVRTC |
| 39 | +* nvJitLink |
0 commit comments