Skip to content

Commit 11dc1d7

Browse files
test rapids build backend (#639)
* test rapids * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove free-threading * refactor release note * fix docs * clean up build from source * update release note --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 39f2ebf commit 11dc1d7

13 files changed

Lines changed: 85 additions & 76 deletions

.github/workflows/publish.yml

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -58,46 +58,6 @@ jobs:
5858
echo "version=$VERSION" >> $GITHUB_OUTPUT
5959
echo "Detected version: $VERSION"
6060
61-
- name: Set package name, extras, and CUDA archs for CUDA ${{ matrix.cuda_major }}
62-
run: |
63-
python3 - ${{ matrix.cuda_major }} "${{ matrix.cuda_archs }}" <<'SCRIPT'
64-
import sys, pathlib
65-
66-
cuda = sys.argv[1]
67-
cuda_archs = sys.argv[2]
68-
other = "13" if cuda == "12" else "12"
69-
path = pathlib.Path("pyproject.toml")
70-
text = path.read_text()
71-
72-
# Rename package
73-
text = text.replace(
74-
'name = "rapids-singlecell"',
75-
f'name = "rapids-singlecell-cu{cuda}"',
76-
)
77-
# Rename matching extra to "rapids", remove the other
78-
text = text.replace(f'rapids-cu{cuda} =', 'rapids =')
79-
# Remove the other CUDA extra line entirely
80-
lines = text.splitlines(keepends=True)
81-
text = "".join(l for l in lines if f'rapids-cu{other}' not in l)
82-
83-
# Set CUDA architectures (replace "native" with CI target archs)
84-
text = text.replace(
85-
'CMAKE_CUDA_ARCHITECTURES = "native"',
86-
f'CMAKE_CUDA_ARCHITECTURES = "{cuda_archs}"',
87-
)
88-
89-
path.write_text(text)
90-
91-
# Verify
92-
for line in path.read_text().splitlines():
93-
if "name" in line or "rapids" in line.lower() or "CUDA_ARCH" in line:
94-
print(line)
95-
SCRIPT
96-
97-
- name: Sanity check pyproject.toml
98-
run: |
99-
grep -E "name|rapids|CUDA_ARCH" pyproject.toml
100-
10161
- name: Build CUDA manylinux image
10262
run: |
10363
docker build -t "${{ matrix.cibw_image }}" -f "${{ matrix.dockerfile }}" docker
@@ -106,17 +66,19 @@ jobs:
10666
uses: pypa/cibuildwheel@v3.1.4
10767
env:
10868
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.version.outputs.version }}
69+
CIBW_BUILD: 'cp312-*'
10970
CIBW_SKIP: '*-musllinux*'
11071
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.os == 'linux-intel' && matrix.cibw_image || '' }}
11172
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.os == 'linux-arm' && matrix.cibw_image || '' }}
11273
CIBW_ENVIRONMENT_PASS_LINUX: SETUPTOOLS_SCM_PRETEND_VERSION
74+
CIBW_CONFIG_SETTINGS: "cmake.define.CMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_archs }}"
11375
CIBW_ENVIRONMENT: >
11476
CUDA_PATH=/usr/local/cuda
11577
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
11678
PATH=/usr/local/cuda/bin:$PATH
79+
RAPIDS_DISABLE_CUDA=false
11780
CIBW_BEFORE_BUILD: >
11881
python -m pip install -U pip
119-
scikit-build-core cmake ninja nanobind
12082
CIBW_TEST_SKIP: "*"
12183
CIBW_TEST_COMMAND: ""
12284
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair --exclude libcublas.so.${{ matrix.cuda_major }} --exclude libcublasLt.so.${{ matrix.cuda_major }} --exclude libcudart.so.${{ matrix.cuda_major }} -w {dest_dir} {wheel}"
@@ -132,8 +94,10 @@ jobs:
13294
runs-on: ubuntu-latest
13395
steps:
13496
- uses: actions/checkout@v5
97+
with:
98+
fetch-depth: 0
13599
- name: Build sdist
136-
run: pipx run build --sdist
100+
run: RAPIDS_DISABLE_CUDA=true pipx run build --sdist
137101
- uses: actions/upload-artifact@v4
138102
with:
139103
name: cibw-sdist

ci/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ channels:
55
- conda-forge
66
dependencies:
77
- rapids=26.04
8-
- python=3.13
8+
- python=3.14
99
- cuda-version=12.9
1010
- cudnn

ci/environment_alpha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
- conda-forge
66
dependencies:
77
- rapids=26.04
8-
- python=3.13
8+
- python=3.14
99
- cuda-version=12.9
1010
- zarr=3.0.6
1111
- cudnn

conda/rsc_rapids_26.04_cuda12.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ channels:
66
- bioconda
77
dependencies:
88
- rapids=26.04
9-
- python=3.13
9+
- python=3.14
1010
- cuda-version=12.9
1111
- cudnn
1212
- cutensor

conda/rsc_rapids_26.04_cuda13.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ channels:
66
- bioconda
77
dependencies:
88
- rapids=26.04
9-
- python=3.13
9+
- python=3.14
1010
- cuda-version=13.1
1111
- cudnn
1212
- cutensor

dependencies.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
files:
2+
pyproject:
3+
output: pyproject
4+
pyproject_dir: .
5+
extras:
6+
table: project.optional-dependencies
7+
key: rapids
8+
includes:
9+
- rapids
10+
11+
dependencies:
12+
rapids:
13+
specific:
14+
- output_types: pyproject
15+
matrices:
16+
- matrix:
17+
cuda: "12.*"
18+
packages:
19+
- cupy-cuda12x
20+
- cudf-cu12>=25.10
21+
- cuml-cu12>=25.10
22+
- cugraph-cu12>=25.10
23+
- cuvs-cu12>=25.10
24+
- matrix:
25+
cuda: "13.*"
26+
packages:
27+
- cupy-cuda13x
28+
- cudf-cu13>=25.10
29+
- cuml-cu13>=25.10
30+
- cugraph-cu13>=25.10
31+
- cuvs-cu13>=25.10
32+
- matrix:
33+
packages: []

docs/contributing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ The `add_nb_cuda_module` helper automatically handles:
156156

157157
The project uses [hatch](https://hatch.pypa.io/) to manage test environments. The test matrix is defined in `hatch.toml` with two axes:
158158

159-
- **`cuda`**: `12` or `13` — selects the matching RAPIDS/CuPy packages
159+
- **`cuda`**: `12` or `13` — selects the matching RAPIDS and CuPy packages
160160
- **`deps`**: `stable`, `dev`, or `rapids_prerelease` — controls Python version and dependency sources
161161

162162
| `deps` | Python | Description |
163163
|---|---|---|
164164
| `stable` | 3.12 | Released versions of all dependencies |
165-
| `dev` | 3.13 | Upstream `main` branches of anndata and scanpy |
166-
| `rapids_prerelease` | 3.13 | RAPIDS nightly wheels |
165+
| `dev` | 3.14 | Upstream `main` branches of anndata and scanpy |
166+
| `rapids_prerelease` | 3.14 | RAPIDS nightly wheels |
167167

168168
To run the test suite against a specific matrix combination:
169169

@@ -230,7 +230,7 @@ The project publishes three separate packages:
230230
### Wheel builds
231231

232232
Wheels are built via [cibuildwheel](https://cibuildwheel.pypa.io/) in GitHub Actions using custom manylinux Docker images with CUDA toolkit pre-installed.
233-
The CI renames the package and adjusts optional dependencies per CUDA version using an inline Python script in `publish.yml`.
233+
The RAPIDS build backend applies the CUDA package suffix and generates the `rapids` extra from `dependencies.yaml`.
234234

235235
Each wheel contains:
236236
- Compiled `.abi3.so` modules (stable ABI, one wheel per platform for all Python 3.12+ versions)

docs/installation.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ conda env create -f conda/rsc_rapids_26.04_cuda13.yml
1010
# or
1111
mamba env create -f conda/rsc_rapids_26.04_cuda13.yml
1212
```
13-
*Python 3.13, CUDA 13.1*
13+
*Python 3.14, CUDA 13.1*
1414
````
1515
````{tab-item} CUDA 12
1616
```bash
1717
conda env create -f conda/rsc_rapids_26.04_cuda12.yml
1818
# or
1919
mamba env create -f conda/rsc_rapids_26.04_cuda12.yml
2020
```
21-
*Python 3.13, CUDA 12.9*
21+
*Python 3.14, CUDA 12.9*
2222
````
2323
`````
2424

@@ -82,6 +82,7 @@ This is the recommended approach for **conda/mamba users** who already have RAPI
8282
### Prebuilt wheels with RAPIDS dependencies
8383

8484
To also install the RAPIDS stack via pip, use the `rapids` extra.
85+
This is the only RAPIDS dependency extra; select CUDA 12 or CUDA 13 with the package name (`rapids-singlecell-cu12` or `rapids-singlecell-cu13`), not with a CUDA-specific extra.
8586
This requires the `--extra-index-url` flag for the NVIDIA PyPI index:
8687

8788
`````{tab-set}
@@ -107,14 +108,17 @@ pip install rapids-singlecell
107108
```
108109

109110
The CUDA kernels will be compiled during installation for your local GPU architecture.
110-
You can select RAPIDS dependencies with the `rapids-cu12` or `rapids-cu13` extras:
111+
Install the RAPIDS stack separately before building from source, or use the single `rapids` extra:
111112

112113
```bash
113-
pip install 'rapids-singlecell[rapids-cu12]' --extra-index-url=https://pypi.nvidia.com
114+
pip install 'rapids-singlecell[rapids]' --extra-index-url=https://pypi.nvidia.com
114115
```
115116

117+
The `rapids` extra is the only RAPIDS dependency extra; there are no CUDA-specific extras such as `rapids-cu12` or `rapids-cu13`.
118+
116119
```{note}
117120
Building from source requires the CUDA toolkit (nvcc) and CMake >= 3.24 to be available in your environment.
121+
The nvcc/CUDAToolkit found during the build should match the RAPIDS/CuPy CUDA major runtime version in or linked to the environment.
118122
```
119123

120124
### Install from GitHub

docs/release-notes/0.15.0.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
11
### 0.15.0 {small}`the-future`
2-
3-
```{rubric} Features
4-
```
5-
* Add Harmony2 support with stabilized diversity penalty, dynamic per-cluster-per-batch ridge regularization, and automatic batch pruning {cite:p}`Patikas2026` {pr}`625` {smaller}`S Dicks`
6-
7-
```{rubric} Misc
8-
```
9-
* Refactor ``tl.rank_genes_groups`` internals to use categorical integer codes instead of boolean mask matrices {pr}`570` {smaller}`S Dicks`

docs/release-notes/0.15.0rc6.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### 0.15.0rc6 {small}`2026-04-27`
2+
3+
```{rubric} Features
4+
```
5+
* Add Harmony2 support with stabilized diversity penalty, dynamic per-cluster-per-batch ridge regularization, and automatic batch pruning {cite:p}`Patikas2026` {pr}`625` {smaller}`S Dicks`
6+
7+
```{rubric} Misc
8+
```
9+
* Switch wheel packaging to ``rapids-build-backend`` so CUDA-suffixed wheel names and RAPIDS dependency extras are generated from a single dependency specification {pr}`639` {smaller}`S Dicks`
10+
* Align RAPIDS 26.04 conda and CI environments with Python 3.14 {pr}`639` {smaller}`S Dicks`
11+
* Refactor ``tl.rank_genes_groups`` internals to use categorical integer codes instead of boolean mask matrices {pr}`570` {smaller}`S Dicks`

0 commit comments

Comments
 (0)