NVIDIA / NVIDIA/cuda-python

Further modernization of the build backend to reduce `setup.py` usage

Open
#605 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

CI/CD cuda.bindings cuda.core enhancement
Dominant language
Cython
Stars
3.4k
Forks
329
Avg merge
1d 23h
Merged PRs (30d)
116

Description

Creating an issue to capture the internal discussions.

Currently both cuda.bindings and cuda.core use setuptools as the build backend and have a mixture of pyproject.toml static declarations and setup.py dynamic logics. We have two choices here:

  • Keep setuptools but further reduce the amount of code in setup.py:
  • Switch to use scikit-build-core:
    • This has the benefit of reusing CUDA discovery mechanism (FindCUDAToolkit) and other nice build system features provided by CMake (see the relevant discussion in #46).
    • The potential downside is to maintain a custom CMakeLists.txt which is arguably a burden for non-C++ (=C & Python) oriented developers. Our Cython extensions are very simple to build.
      • However, this might become necessary once we start integrating some features from cudax::, e.g. #528.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the current pyproject.toml and setup.py configurations for cuda.bindings and cuda.core, then read the linked discussion in #46. Assess whether recent setuptools can declare the Cython extensions or whether scikit-build-core and a CMakeLists.txt are needed, including the future cudax:: considerations in #528. Done means the project agrees on a build-backend direction and its scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, python
Domain
build-system
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.