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

Remove NumPy <2 pin #6031

Merged
merged 12 commits into from
Aug 28, 2024
10 changes: 7 additions & 3 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ rapids-logger "pytest cuml single GPU"
-k 'test_sparse_pca_inputs' \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuml-sparse-pca.xml"

rapids-logger "pytest cuml-dask"
./ci/run_cuml_dask_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuml-dask.xml"
# Temporarily disabled for CUDA 12.x wheels.
# Reference issue: https://github.com/rapidsai/cuml/issues/6050
if [[ "${RAPIDS_PY_CUDA_SUFFIX}" == "cu11" ]]; then
rapids-logger "pytest cuml-dask"
./ci/run_cuml_dask_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuml-dask.xml"
fi

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
3 changes: 2 additions & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ dependencies:
- ninja
- nltk
- numba>=0.57
- numpy>=1.23,<3.0a0
- numpydoc
- nvcc_linux-64=11.8
- packaging
- pip
- pydata-sphinx-theme!=0.14.2
- pylibraft==24.10.*,>=0.0.0a0
- pynndescent==0.5.8
- pynndescent
- pytest-benchmark
- pytest-cases
- pytest-cov
Expand Down
3 changes: 2 additions & 1 deletion conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ dependencies:
- ninja
- nltk
- numba>=0.57
- numpy>=1.23,<3.0a0
- numpydoc
- packaging
- pip
- pydata-sphinx-theme!=0.14.2
- pylibraft==24.10.*,>=0.0.0a0
- pynndescent==0.5.8
- pynndescent
- pytest-benchmark
- pytest-cases
- pytest-cov
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cuml-cpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ requirements:
- rapids-build-backend>=0.3.0,<0.4.0.dev0
run:
- python x.x
- numpy>=1.23,<2.0a0
- numpy>=1.23,<3.0a0
- pandas
- scikit-learn=1.2
- hdbscan>=0.8.38,<0.8.39
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ requirements:
- joblib >=0.11
- libcuml ={{ version }}
- libcumlprims ={{ minor_version }}
- numpy >=1.23,<3.0a0
- pylibraft ={{ minor_version }}
- python x.x
- raft-dask ={{ minor_version }}
Expand Down
3 changes: 2 additions & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ dependencies:
- dask-cuda==24.10.*,>=0.0.0a0
- joblib>=0.11
- numba>=0.57
- numpy>=1.23,<3.0a0
Copy link
Member

Choose a reason for hiding this comment

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

It seems we have a NumPy dependency

However it isn't getting declared as one. So explicitly added NumPy as a dependency

# TODO: Is scipy really a hard dependency, or should
# we make it optional (i.e. an extra for pip
# installation/run_constrained for conda)?
Expand Down Expand Up @@ -509,7 +510,7 @@ dependencies:
- *scikit_learn
- statsmodels
- umap-learn==0.5.3
- pynndescent==0.5.8
- pynndescent
Copy link
Member

Choose a reason for hiding this comment

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

@dantegd , is it alright if we relax this pin?

Copy link
Member

Choose a reason for hiding this comment

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

Given passing tests, it should be fine to relax now

- output_types: conda
packages:
- pip
Expand Down
6 changes: 1 addition & 5 deletions python/cuml/cuml/neighbors/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -34,7 +34,3 @@ rapids_cython_create_modules(
MODULE_PREFIX neighbors_
ASSOCIATED_TARGETS cuml
)

foreach(target IN LISTS targets_using_numpy)
target_include_directories(${target} PRIVATE "${Python_NumPy_INCLUDE_DIRS}")
endforeach()
Comment on lines -37 to -40
Copy link
Member

Choose a reason for hiding this comment

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

Trying dropping this. AFAICT the Cython modules above don't cimport numpy. So they wouldn't need this

Not sure whether it would cause the tests to hang. At a minimum, it is unused; so, it is worth cleaning up

Copy link
Member

Choose a reason for hiding this comment

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

Yeah not sure what happened there. I traced back in the blame to where this was added. Looks like @vyasr recommended removing it back at the source: #4818 (comment)

But there wasn't any additional discussion on that PR (maybe it happened somewhere else), and the change was merged in.

I agree with you that it seems to be unused.

Copy link
Member

Choose a reason for hiding this comment

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

Originally was looking for clues on fixing the hanging test ( #6031 (comment) ). Tried this just in case it helped, but it didn't matter

Read through the history here yesterday. It seems like NumPy was a build dependency a while back (though still wasn't clear then whether it was being used). Think since then every update has assumed NumPy was a build dependency. However as we don't require it during the build, it isn't actually satisfied.

Further we would have needed find_package(Python REQUIRED COMPONENTS Development NumPy) to find NumPy and set $Python_NumPy_INCLUDE_DIRS, but we don't do that either.

Think this hasn't presented much of an issue as we don't actually set targets_using_numpy.

In any event, this time seems as good as any for cleaning this up

3 changes: 2 additions & 1 deletion python/cuml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ dependencies = [
"dask-cudf==24.10.*,>=0.0.0a0",
"joblib>=0.11",
"numba>=0.57",
"numpy>=1.23,<3.0a0",
"nvidia-cublas",
"nvidia-cufft",
"nvidia-curand",
Expand Down Expand Up @@ -115,7 +116,7 @@ test = [
"hypothesis>=6.0,<7",
"nltk",
"numpydoc",
"pynndescent==0.5.8",
"pynndescent",
"pytest-benchmark",
"pytest-cases",
"pytest-cov",
Expand Down
Loading