Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.11, require NumPy 1.23+ #15111

Merged
merged 31 commits into from
Feb 29, 2024

Conversation

jameslamb
Copy link
Member

@jameslamb jameslamb commented Feb 21, 2024

Description

Contributes to rapidsai/build-planning#3

This PR adds support for Python 3.11.

It also bumps uses of NumPy to numpy>=1.23, see rapidsai/build-planning#3 (comment).

Notes for Reviewers

This is part of ongoing work to add Python 3.11 support across RAPIDS.

The Python 3.11 CI workflows introduced in rapidsai/shared-workflows#176 are optional... they are not yet required to run successfully for PRs to be merged.

This PR can be merged once all jobs are running successfully (including the non-required jobs for Python 3.11). The CI logs should be verified that the jobs are building and testing with Python 3.11.

See rapidsai/shared-workflows#176 for more details.

(created with rapids-reviser)

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@jameslamb jameslamb added the 5 - DO NOT MERGE Hold off on merging; see PR for details label Feb 21, 2024
.github/workflows/pr.yaml Outdated Show resolved Hide resolved
@jameslamb jameslamb changed the title test shared-workflows matrix refactoring test Python 3.11 jobs Feb 22, 2024
@jameslamb jameslamb changed the title test Python 3.11 jobs Add support for Python 3.11 Feb 23, 2024
@github-actions github-actions bot added Python Affects Python cuDF API. conda labels Feb 26, 2024
README.md Outdated Show resolved Hide resolved
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@jameslamb jameslamb marked this pull request as ready for review February 27, 2024 14:59
@jameslamb jameslamb requested review from a team as code owners February 27, 2024 14:59
@jameslamb jameslamb removed the 5 - DO NOT MERGE Hold off on merging; see PR for details label Feb 27, 2024
@jameslamb jameslamb added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 27, 2024
dependencies.yaml Outdated Show resolved Hide resolved
Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have pushed a few changes to this PR to align conda & wheel builds to both build against NumPy 1.23 and require it as a minimum version at runtime

Highlighted relevant changes below

Happy to discuss further as needed

@@ -65,6 +65,7 @@ requirements:
- scikit-build-core >=0.7.0
- setuptools
- dlpack >=0.5,<0.6.0a0
- numpy 1.23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As NumPy is used at build time, this now adds it to requirements/host

@@ -83,7 +84,7 @@ requirements:
- pandas >=2.0,<2.2.2dev0
- cupy >=12.0.0
- numba >=0.57
- numpy >=1.21
- {{ pin_compatible('numpy', max_pin='x') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to using pin_compatible with NumPy to ensure the minimum version allowed at runtime matches what we built with and any NumPy version (pre-2.0.0) is allowed

Comment on lines +267 to +271
- output_types: pyproject
packages:
# Hard pin the patch version used during the build.
# Sync with conda build constraint & wheel run constraint.
- numpy==1.23.*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same NumPy pin the conda packages use to build. It is now used here to align the wheel packages

run_common:
common:
- output_types: [conda, requirements, pyproject]
packages:
- fsspec>=0.6.0
- *numpy
- numpy>=1.23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both conda & wheel packages now have the same lower bound on NumPy

dependencies.yaml Outdated Show resolved Hide resolved
@@ -625,7 +633,7 @@ dependencies:
- output_types: pyproject
packages:
- msgpack
- &tokenizers tokenizers==0.13.1
- &tokenizers tokenizers==0.15.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've bumped tokenizers to 0.15.2 so we can get Python 3.11 binaries.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incompatible with transformers==4.24.0 :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped transformers to 4.38.1.

tensor = torch.tensor(index)
got = cudf.Index(tensor)
assert_eq(got, index)
# TODO: This test fails with PyTorch 2. Is it still expected to be valid?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a change 2f0a8a8 to unblock CI, and also rolled it out to a separate PR #15188. See my notes there for discussion and next steps. https://github.com/rapidsai/cudf/pull/15188/files#r1506969204

I would like to merge this test change as-is, to keep the main goal of Python 3.11 support moving. We can handle any further discussion of the issue in https://github.com/rapidsai/cudf/pull/15188/files#r1506969204.

@bdice
Copy link
Contributor

bdice commented Feb 29, 2024

CI failed due to the dask tokenizing bug that was fixed in #15187. I will merge the upstream to rerun CI now.

@bdice
Copy link
Contributor

bdice commented Feb 29, 2024

/merge

@rapids-bot rapids-bot bot merged commit e96ff74 into rapidsai:branch-24.04 Feb 29, 2024
76 checks passed
@jakirkham
Copy link
Member

Hooray! 🥳

Thanks everyone 👏

Glad to have this complete

@jameslamb jameslamb deleted the test-matrix-refactor branch March 1, 2024 14:58
rapids-bot bot pushed a commit that referenced this pull request Mar 5, 2024
This PR contains a few minor improvements for `__cuda_array_interface__` and its tests. Found while working on #15111.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #15188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants