rapidsai / build-planning

Tracking for RAPIDS-wide build tasks
https://github.com/rapidsai
0 stars 3 forks source link

Add support for Python 3.12 #40

Open bdice opened 4 months ago

bdice commented 4 months ago

Overview

Python 3.12 was released in October 2023. This issue tracks the work to add support for Python 3.12 to RAPIDS.

In #3, RAPIDS added support for Python 3.11, which was released in RAPIDS 24.04. The work to add Python 3.11 was heavily automated, and that could be done again for Python 3.12 to reduce the load on RAPIDS maintainers.

When should we drop Python 3.9?

Typically RAPIDS has kept the matrix of supported Python minor versions to 2 or 3 versions at a time. When adding Python 3.12, we should probably drop Python 3.9 as well.

SPEC 0 recommended dropping support for Python 3.9 in 2023Q4. Meanwhile, NEP 29 recommended dropping support for Python 3.9 as of Apr 05, 2024. Both of these deadlines have passed and several large Python libraries are now moving towards dropping Python 3.9, so it is probably reasonable to drop Python 3.9 around the same time that we add Python 3.12.

Tasks

Each section should be fully completed before moving to the next section.

CI images

CI workflows

Branch Strategy:

The above tasks are handled by: https://github.com/rapidsai/shared-workflows/pull/213

RAPIDS repositories

This list is intentionally in RAPIDS dependency order... they'll need to be completed in roughly that order.

### Updates for libraries
- [x] pin Python version to 3.11 in `devcontainers` until all repos are migrated (https://github.com/rapidsai/devcontainers/pull/388)
- [ ] update `pypi-wheel-scripts` and manually build/publish `cubinlinker` and `ptxcompiler` wheels (https://github.com/rapidsai/pypi-wheel-scripts/pull/17)
- [x] rapids-cmake (https://github.com/rapidsai/rapids-cmake/pull/688)
- [x] rmm (https://github.com/rapidsai/rmm/pull/1666)
- [x] kvikio (https://github.com/rapidsai/kvikio/pull/458)
- [x] pynvjitlink (already supported Python 3.12: https://github.com/rapidsai/pynvjitlink/pull/104#issuecomment-2330079484)
- [x] dask-cuda (https://github.com/rapidsai/dask-cuda/pull/1380)
- [x] cudf (https://github.com/rapidsai/cudf/pull/16745)
- [x] ucx-py (https://github.com/rapidsai/ucx-py/pull/1067)
- [ ] ucxx (https://github.com/rapidsai/ucxx/pull/276)
- [ ] raft (https://github.com/rapidsai/raft/pull/2428)
- [x] wholegraph (https://github.com/rapidsai/wholegraph/pull/214)
- [ ] cugraph (https://github.com/rapidsai/cugraph/pull/4647)
- [x] cugraph-gnn (https://github.com/rapidsai/cugraph-gnn/pull/41)
- [x] cugraph-pg (pushed Python 3.12 changes to https://github.com/rapidsai/cugraph-pg/pull/25 ... not waiting for that to be merged, as that repo's not being actively maintained yet)
- [ ] cuml (https://github.com/rapidsai/cuml/pull/6060)
- [ ] cuvs (https://github.com/rapidsai/cuvs/pull/312)
- [ ] cuspatial (https://github.com/rapidsai/cuspatial/pull/1453)
- [ ] cuxfilter (https://github.com/rapidsai/cuxfilter/pull/625)
- [x] cucim (https://github.com/rapidsai/cucim/pull/773)
- [ ] private repos
- [ ] integration

For each repo,

  1. Update .github/workflows/*.yaml to point to the python-3.12 branch of shared-workflows
  2. Update dependencies.yaml to add support for Python 3.12.
  3. Review any pyproject.toml files for necessary changes (classifiers, etc.)
  4. Update docs (README, etc) that reference a single Python version to point to the latest (3.12).
  5. Once CI passes, merge the PR.

Most of this is easy to automate with rapids-reviser, and we can copy from this previous migrator for Python 3.11: https://github.com/rapidsai/rapids-reviser/pull/11. We still need to manually review the PRs for missing pieces.

Once all repos are migrated to the python-3.12 branch, the migration is complete. We merge python-3.12 into the development branch on shared-workflows and then open follow-up PRs to each repo to reset the branches to that development branch. This "reset" is simple and should be automated with rapids-reviser.

### Post-migration
- [ ] Update the `ci-imgs` repo's `latest` configuration to use Python 3.12. https://github.com/rapidsai/ci-imgs/blob/main/latest.yaml
- [ ] Update the `docker` repo's [matrix.yaml](https://github.com/rapidsai/docker/blob/branch-24.06/matrix.yaml) and [matrix-test.yaml](https://github.com/rapidsai/docker/blob/branch-24.06/matrix-test.yaml)
- [ ] Update the build matrix in `pypi-wheel-scripts` so that Python 3.12 wheels are checked: https://github.com/rapidsai/pypi-wheel-scripts/blob/fa1e8744c8ec961a5b5e38ae172ae9c8c51b4280/release/check-wheels.sh#L41-L45
- [ ] Update [rapidsai/dask-build-environment](https://github.com/rapidsai/dask-build-environment)
- [ ] update release selector in `docs` ([like this example](https://github.com/rapidsai/docs/pull/534))
- [ ] update all the repos to point at `branch-24.10` on `shared-workflows` again
- [ ] revert `devcontainers` Python version pin (e.g. https://github.com/rapidsai/devcontainers/pull/388)

Notes:

The :latest image from ci-imgs is frequently used by CI jobs for building docs and testing notebooks. Be aware that issues may arise in those jobs.

bdice commented 4 months ago

Strategically, it may make sense to wait until we publish RAPIDS C++ wheels (https://github.com/rapidsai/build-planning/issues/33). That will reduce the build time impact of adding another Python version -- and we already plan to keep the total amount of testing constant. I think it may be reasonable to target early RAPIDS 24.08 for adding Python 3.12 support.

vyasr commented 4 months ago

I think that's a good idea, may as well minimize the impact. Although I should note that we were limiting our Python versions to the same degree even pre-wheels (i.e. when we only had conda builds, so half as many total artifacts to output) so I doubt that the C++ wheels effort materially changes the calculus on how many Python versions we will support at a time.

bdice commented 3 months ago

Here is a proposal for the CI matrix I would recommend for Python 3.12: https://github.com/rapidsai/shared-workflows/pull/213

bdice commented 1 month ago

I have opened a separate issue to track dropping Python 3.9: #88

jakirkham commented 1 month ago

According to PEP 719, Python 3.13.0 is due out October 1st

This comes out before the RAPIDS 24.10 release, which is currently due October 10th

So it would be ideal to have Python 3.12 supported in RAPIDS by then

jameslamb commented 1 week ago

I'm working on a rapids-reviser PR to roll out most of the changes. I'm planning to modify the existing example at https://github.com/rapidsai/rapids-reviser/tree/main/examples/add-python-3.11.

I've also added task lists to the issue description with what I think is a comprehensive list of repos to be updated. Will double-check that with some GitHub searches.