From 508bdea0dac581d5a33ceb609766c419ef51bbbb Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 23 Aug 2024 19:15:07 -0700 Subject: [PATCH] Rebuild for & Support NumPy 2 (#16300) Part of issue: https://github.com/rapidsai/build-planning/issues/38 Start building `cudf` with `numpy` version `2.0`. This remains compatible with `numpy` version `1.x` and `2.x`. Allows us to test building with `numpy` version `2.0` (and make sure we catch any issues that show up). Also relaxes the `numpy` `1.x` pin. Pulls in the RDFG changes that are rolling out for broader RAPIDS NumPy 2 support. Authors: - https://github.com/jakirkham - Sebastian Berg (https://github.com/seberg) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) - Ray Douglass (https://github.com/raydouglass) - James Lamb (https://github.com/jameslamb) URL: https://github.com/rapidsai/cudf/pull/16300 --- ci/cudf_pandas_scripts/run_tests.sh | 2 +- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-125_arch-x86_64.yaml | 2 +- conda/recipes/cudf/meta.yaml | 6 ++---- conda/recipes/pylibcudf/meta.yaml | 6 ++---- dependencies.yaml | 8 +++----- python/cudf/pyproject.toml | 4 ++-- python/cudf_kafka/pyproject.toml | 2 +- python/dask_cudf/pyproject.toml | 2 +- python/pylibcudf/pyproject.toml | 2 +- 10 files changed, 15 insertions(+), 21 deletions(-) diff --git a/ci/cudf_pandas_scripts/run_tests.sh b/ci/cudf_pandas_scripts/run_tests.sh index 90ea1afbe6a..39056d58d56 100755 --- a/ci/cudf_pandas_scripts/run_tests.sh +++ b/ci/cudf_pandas_scripts/run_tests.sh @@ -75,7 +75,7 @@ IFS=',' read -r -a versions <<< "$output" for version in "${versions[@]}"; do echo "Installing pandas version: ${version}" - python -m pip install "pandas==${version}" + python -m pip install "numpy>=1.23,<2.0a0" "pandas==${version}" python -m pytest -p cudf.pandas \ --cov-config=./python/cudf/.coveragerc \ --cov=cudf \ diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 018162bd848..5cf7508ba51 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -57,7 +57,7 @@ dependencies: - notebook - numba>=0.57 - numpy -- numpy>=1.23,<2.0a0 +- numpy>=1.23,<3.0a0 - numpydoc - nvcc_linux-64=11.8 - nvcomp==3.0.6 diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml index c60ffa7aaa5..28b927254f7 100644 --- a/conda/environments/all_cuda-125_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -56,7 +56,7 @@ dependencies: - notebook - numba>=0.57 - numpy -- numpy>=1.23,<2.0a0 +- numpy>=1.23,<3.0a0 - numpydoc - nvcomp==3.0.6 - nvtx>=0.2.1 diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 7e86147732e..b2dad767da4 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -64,8 +64,7 @@ requirements: - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.10.0 - dlpack >=0.8,<1.0 - # TODO: Change to `2.0` for NumPy 2 - - numpy 1.23 + - numpy 2.0 - pyarrow ==16.1.0.* - libcudf ={{ version }} - pylibcudf ={{ version }} @@ -84,8 +83,7 @@ requirements: - pandas >=2.0,<2.2.3dev0 - cupy >=12.0.0 - numba >=0.57 - # TODO: Update `numpy` in `host` when dropping `<2.0a0` - - numpy >=1.23,<2.0a0 + - numpy >=1.23,<3.0a0 - {{ pin_compatible('pyarrow', max_pin='x.x') }} - libcudf ={{ version }} - pylibcudf ={{ version }} diff --git a/conda/recipes/pylibcudf/meta.yaml b/conda/recipes/pylibcudf/meta.yaml index f405fd10f5d..fef78467027 100644 --- a/conda/recipes/pylibcudf/meta.yaml +++ b/conda/recipes/pylibcudf/meta.yaml @@ -64,8 +64,7 @@ requirements: - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.10.0 - dlpack >=0.8,<1.0 - # TODO: Change to `2.0` for NumPy 2 - - numpy 1.23 + - numpy 2.0 - pyarrow ==16.1.0.* - libcudf ={{ version }} - rmm ={{ minor_version }} @@ -81,8 +80,7 @@ requirements: - python - typing_extensions >=4.0.0 - pandas >=2.0,<2.2.3dev0 - # TODO: Update `numpy` in `host` when dropping `<2.0a0` - - numpy >=1.23,<2.0a0 + - numpy >=1.23,<3.0a0 - {{ pin_compatible('pyarrow', max_pin='x.x') }} - {{ pin_compatible('rmm', max_pin='x.x') }} - fsspec >=0.6.0 diff --git a/dependencies.yaml b/dependencies.yaml index 553d01735b2..194577817db 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -394,10 +394,9 @@ dependencies: - &pyarrow_build pyarrow==16.1.0.* - output_types: pyproject packages: - # Hard pin the patch version used during the build. + # Hard pin the version used during the build. # Sync with conda build constraint & wheel run constraint. - # TODO: Change to `2.0.*` for NumPy 2 - - numpy==1.23.* + - numpy==2.0.* build_python_libcudf: common: - output_types: [conda, requirements, pyproject] @@ -605,8 +604,7 @@ dependencies: - output_types: [conda, requirements, pyproject] packages: - fsspec>=0.6.0 - # TODO: Update `numpy` in `build_python_common` when dropping `<2.0a0` - - numpy>=1.23,<2.0a0 + - numpy>=1.23,<3.0a0 - pandas>=2.0,<2.2.3dev0 run_pylibcudf: common: diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index cb9fa30afab..e7bac17f8ba 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "fsspec>=0.6.0", "libcudf==24.10.*,>=0.0.0a0", "numba>=0.57", - "numpy>=1.23,<2.0a0", + "numpy>=1.23,<3.0a0", "nvtx>=0.2.1", "packaging", "pandas>=2.0,<2.2.3dev0", @@ -130,7 +130,7 @@ requires = [ "libcudf==24.10.*,>=0.0.0a0", "librmm==24.10.*,>=0.0.0a0", "ninja", - "numpy==1.23.*", + "numpy==2.0.*", "pyarrow==16.1.0.*", "pylibcudf==24.10.*,>=0.0.0a0", "rmm==24.10.*,>=0.0.0a0", diff --git a/python/cudf_kafka/pyproject.toml b/python/cudf_kafka/pyproject.toml index 63c5b07c5f3..2d0222a3fe9 100644 --- a/python/cudf_kafka/pyproject.toml +++ b/python/cudf_kafka/pyproject.toml @@ -106,6 +106,6 @@ requires = [ "cmake>=3.26.4,!=3.30.0", "cython>=3.0.3", "ninja", - "numpy==1.23.*", + "numpy==2.0.*", "pyarrow==16.1.0.*", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. diff --git a/python/dask_cudf/pyproject.toml b/python/dask_cudf/pyproject.toml index 872ecd35c28..d5da7030a75 100644 --- a/python/dask_cudf/pyproject.toml +++ b/python/dask_cudf/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "cudf==24.10.*,>=0.0.0a0", "cupy-cuda11x>=12.0.0", "fsspec>=0.6.0", - "numpy>=1.23,<2.0a0", + "numpy>=1.23,<3.0a0", "pandas>=2.0,<2.2.3dev0", "rapids-dask-dependency==24.10.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. diff --git a/python/pylibcudf/pyproject.toml b/python/pylibcudf/pyproject.toml index 63d76e9fd4e..5f5594b462b 100644 --- a/python/pylibcudf/pyproject.toml +++ b/python/pylibcudf/pyproject.toml @@ -105,7 +105,7 @@ requires = [ "libcudf==24.10.*,>=0.0.0a0", "librmm==24.10.*,>=0.0.0a0", "ninja", - "numpy==1.23.*", + "numpy==2.0.*", "pyarrow==16.1.0.*", "rmm==24.10.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.