From 56647c0a7801172fb10de97f3f68215ceeaadd89 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Wed, 23 Feb 2022 15:40:43 -0500 Subject: [PATCH] Using Pyraft and automatically cloning when raft pin changes (#4593) This PR depends on https://github.com/rapidsai/raft/pull/520 Authors: - Corey J. Nolet (https://github.com/cjnolet) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - Dante Gama Dessavre (https://github.com/dantegd) URL: https://github.com/rapidsai/cuml/pull/4593 --- ci/gpu/build.sh | 1 + conda/environments/cuml_dev_cuda11.0.yml | 1 + conda/environments/cuml_dev_cuda11.2.yml | 1 + conda/environments/cuml_dev_cuda11.4.yml | 1 + conda/environments/cuml_dev_cuda11.5.yml | 1 + conda/recipes/cuml/meta.yaml | 2 ++ cpp/cmake/thirdparty/get_raft.cmake | 19 ++++++++++++++---- python/cuml/__init__.py | 4 ---- python/cuml/cluster/agglomerative.pyx | 4 ++-- python/cuml/cluster/dbscan.pyx | 4 ++-- python/cuml/cluster/hdbscan.pyx | 8 +++++--- python/cuml/cluster/kmeans.pyx | 4 ++-- python/cuml/cluster/kmeans_mg.pyx | 4 ++-- python/cuml/common/base.pyx | 6 +++--- python/cuml/common/handle.pyx | 4 ++-- python/cuml/dask/cluster/dbscan.py | 6 +++--- python/cuml/dask/cluster/kmeans.py | 6 +++--- python/cuml/dask/common/base.py | 4 ++-- python/cuml/dask/decomposition/base.py | 6 +++--- .../dask/linear_model/linear_regression.py | 4 ++-- python/cuml/dask/linear_model/ridge.py | 4 ++-- .../dask/neighbors/kneighbors_classifier.py | 4 ++-- .../dask/neighbors/kneighbors_regressor.py | 4 ++-- .../cuml/dask/neighbors/nearest_neighbors.py | 6 +++--- python/cuml/dask/solvers/cd.py | 4 ++-- python/cuml/datasets/arima.pyx | 6 +++--- python/cuml/datasets/regression.pyx | 6 +++--- python/cuml/decomposition/base_mg.pyx | 4 ++-- python/cuml/decomposition/pca.pyx | 6 +++--- python/cuml/decomposition/pca_mg.pyx | 4 ++-- python/cuml/decomposition/tsvd.pyx | 4 ++-- python/cuml/decomposition/tsvd_mg.pyx | 4 ++-- python/cuml/ensemble/randomforest_common.pyx | 4 ++-- python/cuml/ensemble/randomforest_shared.pxd | 6 +++--- .../cuml/ensemble/randomforestclassifier.pyx | 4 ++-- .../cuml/ensemble/randomforestregressor.pyx | 4 ++-- .../cuml/experimental/linear_model/lars.pyx | 4 ++-- python/cuml/explainer/base.pyx | 6 +++--- python/cuml/explainer/common.py | 5 +++-- python/cuml/explainer/kernel_shap.pyx | 8 ++++---- python/cuml/explainer/permutation_shap.pyx | 6 +++--- python/cuml/fil/fil.pyx | 4 ++-- python/cuml/linear_model/base.pyx | 4 ++-- python/cuml/linear_model/base_mg.pyx | 4 ++-- .../cuml/linear_model/linear_regression.pyx | 2 +- .../linear_model/linear_regression_mg.pyx | 4 ++-- python/cuml/linear_model/ridge.pyx | 2 +- python/cuml/linear_model/ridge_mg.pyx | 4 ++-- python/cuml/manifold/t_sne.pyx | 4 ++-- python/cuml/manifold/umap.pyx | 4 ++-- python/cuml/metrics/accuracy.pyx | 6 +++--- .../metrics/cluster/adjusted_rand_index.pyx | 6 +++--- .../metrics/cluster/completeness_score.pyx | 6 +++--- python/cuml/metrics/cluster/entropy.pyx | 6 +++--- .../metrics/cluster/homogeneity_score.pyx | 6 +++--- .../metrics/cluster/mutual_info_score.pyx | 6 +++--- .../cuml/metrics/cluster/silhouette_score.pyx | 6 +++--- python/cuml/metrics/kl_divergence.pyx | 6 +++--- python/cuml/metrics/pairwise_distances.pyx | 6 +++--- python/cuml/metrics/regression.pxd | 4 ++-- python/cuml/metrics/regression.pyx | 4 ++-- python/cuml/metrics/trustworthiness.pyx | 6 +++--- .../cuml/neighbors/kneighbors_classifier.pyx | 4 ++-- .../neighbors/kneighbors_classifier_mg.pyx | 4 ++-- .../cuml/neighbors/kneighbors_regressor.pyx | 4 ++-- .../neighbors/kneighbors_regressor_mg.pyx | 4 ++-- python/cuml/neighbors/nearest_neighbors.pyx | 4 ++-- .../cuml/neighbors/nearest_neighbors_mg.pyx | 4 ++-- .../random_projection/random_projection.pyx | 4 ++-- python/cuml/solvers/cd.pyx | 4 ++-- python/cuml/solvers/cd_mg.pyx | 4 ++-- python/cuml/solvers/qn.pyx | 2 +- python/cuml/solvers/sgd.pyx | 4 ++-- python/cuml/svm/linear.pyx | 4 ++-- python/cuml/svm/svc.pyx | 4 ++-- python/cuml/svm/svm_base.pyx | 2 +- python/cuml/svm/svr.pyx | 2 +- .../test/explainer/test_explainer_base.py | 11 +++++----- .../test/explainer/test_explainer_common.py | 8 +++++--- python/cuml/test/test_base.py | 5 ++++- python/cuml/test/test_raft.py | 20 ------------------- python/cuml/test/utils.py | 4 +++- python/cuml/tsa/arima.pyx | 4 ++-- python/cuml/tsa/auto_arima.pyx | 6 +++--- python/cuml/tsa/holtwinters.pyx | 4 ++-- python/cuml/tsa/seasonality.pyx | 4 ++-- python/cuml/tsa/stationarity.pyx | 6 +++--- python/setup.py | 13 ------------ 88 files changed, 212 insertions(+), 220 deletions(-) delete mode 100644 python/cuml/test/test_raft.py diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index e55d66e25e..c7369f7643 100755 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -61,6 +61,7 @@ gpuci_mamba_retry install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvid "libraft-headers=${MINOR_VERSION}" \ "libraft-distance=${MINOR_VERSION}" \ "libraft-nn=${MINOR_VERSION}" \ + "pyraft=${MINOR_VERSION}" \ "dask-cudf=${MINOR_VERSION}" \ "dask-cuda=${MINOR_VERSION}" \ "ucx-py=${UCX_PY_VERSION}" \ diff --git a/conda/environments/cuml_dev_cuda11.0.yml b/conda/environments/cuml_dev_cuda11.0.yml index 4085865422..f6b35a48da 100644 --- a/conda/environments/cuml_dev_cuda11.0.yml +++ b/conda/environments/cuml_dev_cuda11.0.yml @@ -16,6 +16,7 @@ dependencies: - libraft-headers=22.04.* - libraft-distance=22.04.* - libraft-nn=22.04.* +- pyraft=22.04.* - dask-cudf=22.04.* - dask-cuda=22.04.* - ucx-py=0.25.* diff --git a/conda/environments/cuml_dev_cuda11.2.yml b/conda/environments/cuml_dev_cuda11.2.yml index 7e455c2b2e..5ff50599ec 100644 --- a/conda/environments/cuml_dev_cuda11.2.yml +++ b/conda/environments/cuml_dev_cuda11.2.yml @@ -16,6 +16,7 @@ dependencies: - libraft-headers=22.04.* - libraft-distance=22.04.* - libraft-nn=22.04.* +- pyraft=22.04.* - dask-cudf=22.04.* - dask-cuda=22.04.* - ucx-py=0.25.* diff --git a/conda/environments/cuml_dev_cuda11.4.yml b/conda/environments/cuml_dev_cuda11.4.yml index ad7486edb0..610a3fb649 100644 --- a/conda/environments/cuml_dev_cuda11.4.yml +++ b/conda/environments/cuml_dev_cuda11.4.yml @@ -16,6 +16,7 @@ dependencies: - libraft-headers=22.04.* - libraft-distance=22.04.* - libraft-nn=22.04.* +- pyraft=22.04.* - dask-cudf=22.04.* - dask-cuda=22.04.* - ucx-py=0.25.* diff --git a/conda/environments/cuml_dev_cuda11.5.yml b/conda/environments/cuml_dev_cuda11.5.yml index 799a8e76df..210c3af2fd 100644 --- a/conda/environments/cuml_dev_cuda11.5.yml +++ b/conda/environments/cuml_dev_cuda11.5.yml @@ -16,6 +16,7 @@ dependencies: - libraft-headers=22.04.* - libraft-distance=22.04.* - libraft-nn=22.04.* +- pyraft=22.04.* - dask-cudf=22.04.* - dask-cuda=22.04.* - ucx-py=0.25.* diff --git a/conda/recipes/cuml/meta.yaml b/conda/recipes/cuml/meta.yaml index 91ca7cad55..0d74f8b73e 100644 --- a/conda/recipes/cuml/meta.yaml +++ b/conda/recipes/cuml/meta.yaml @@ -34,6 +34,7 @@ requirements: - cudf {{ minor_version }} - libcuml={{ version }} - libcumlprims {{ minor_version }} + - pyraft {{ minor_version }} - cudatoolkit {{ cuda_version }}.* - ucx-py {{ ucx_py_version }} - ucx-proc=*=gpu @@ -44,6 +45,7 @@ requirements: - dask-cudf {{ minor_version }} - libcuml={{ version }} - libcumlprims {{ minor_version }} + - pyraft {{ minor_version }} - cupy>=7.8.0,<11.0.0a0 - treelite=2.3.0 - nccl>=2.9.9 diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 63f795d519..d9eb6f8f9f 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -14,12 +14,20 @@ # limitations under the License. #============================================================================= +set(CUML_MIN_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00") +set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") + function(find_and_configure_raft) - set(oneValueArgs VERSION FORK PINNED_TAG USE_RAFT_NN USE_FAISS_STATIC) + set(oneValueArgs VERSION FORK PINNED_TAG USE_RAFT_NN USE_FAISS_STATIC CLONE_ON_PIN) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + if(PKG_CLONE_ON_PIN AND NOT PKG_PINNED_TAG STREQUAL "branch-${CUML_BRANCH_VERSION_raft}") + message("Pinned tag found: ${PKG_PINNED_TAG}. Cloning raft locally.") + set(CPM_DOWNLOAD_raft ON) + endif() + string(APPEND RAFT_COMPONENTS "distance") if(PKG_USE_RAFT_NN) string(APPEND RAFT_COMPONENTS " nn") @@ -48,10 +56,8 @@ function(find_and_configure_raft) message(VERBOSE "CUML: Using RAFT located in ${raft_DIR}") endif() -endfunction() -set(CUML_MIN_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00") -set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") +endfunction() # Change pinned tag here to test a commit in CI # To use a different RAFT locally, set the CMake variable @@ -59,6 +65,11 @@ set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft} FORK rapidsai PINNED_TAG branch-${CUML_BRANCH_VERSION_raft} + + # When PINNED_TAG above doesn't match cuml, + # force local raft clone in build directory + # even if it's already installed. + CLONE_ON_PIN ON USE_RAFT_NN ${CUML_USE_RAFT_NN} USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC} ) diff --git a/python/cuml/__init__.py b/python/cuml/__init__.py index 4c5553b3e4..1a3fd4cc54 100644 --- a/python/cuml/__init__.py +++ b/python/cuml/__init__.py @@ -91,10 +91,6 @@ from cuml.common.pointer_utils import device_of_gpu_matrix from cuml.common.memory_utils import set_global_output_type, using_output_type -# RAFT - -from cuml.raft import raft_include_test - # Import verion. Remove at end of file from ._version import get_versions diff --git a/python/cuml/cluster/agglomerative.pyx b/python/cuml/cluster/agglomerative.pyx index ea07a92650..7f6fa21d79 100644 --- a/python/cuml/cluster/agglomerative.pyx +++ b/python/cuml/cluster/agglomerative.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import numpy as np from cuml.common.array import CumlArray from cuml.common.base import Base from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.mixins import ClusterMixin diff --git a/python/cuml/cluster/dbscan.pyx b/python/cuml/cluster/dbscan.pyx index fa92a77bb7..ad80e682f6 100644 --- a/python/cuml/cluster/dbscan.pyx +++ b/python/cuml/cluster/dbscan.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ from libc.stdlib cimport calloc, malloc, free from cuml.common.array import CumlArray from cuml.common.base import Base from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common import using_output_type from cuml.common.array_descriptor import CumlArrayDescriptor diff --git a/python/cuml/cluster/hdbscan.pyx b/python/cuml/cluster/hdbscan.pyx index 395e1f5e94..506f340c3f 100644 --- a/python/cuml/cluster/hdbscan.pyx +++ b/python/cuml/cluster/hdbscan.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ import cupy as cp from cuml.common.array import CumlArray from cuml.common.base import Base from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t + +from raft.common.handle import Handle from cuml.common import input_to_cuml_array from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.mixins import ClusterMixin @@ -192,7 +194,7 @@ def condense_hierarchy(dendrogram, condensed_tree : hdbscan.plots.CondensedTree object """ - handle = cuml.raft.common.handle.Handle() + handle = Handle() cdef handle_t *handle_ = handle.getHandle() n_leaves = dendrogram.shape[0]+1 diff --git a/python/cuml/cluster/kmeans.pyx b/python/cuml/cluster/kmeans.pyx index 1cacea929a..132a95ff53 100644 --- a/python/cuml/cluster/kmeans.pyx +++ b/python/cuml/cluster/kmeans.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ from cuml.common.mixins import ClusterMixin from cuml.common.mixins import CMajorInputTagMixin from cuml.common import input_to_cuml_array from cuml.cluster.kmeans_utils cimport * -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cdef extern from "cuml/cluster/kmeans.hpp" namespace "ML::kmeans": diff --git a/python/cuml/cluster/kmeans_mg.pyx b/python/cuml/cluster/kmeans_mg.pyx index 58d69ac155..4a37ace353 100644 --- a/python/cuml/cluster/kmeans_mg.pyx +++ b/python/cuml/cluster/kmeans_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ from libc.stdlib cimport calloc, malloc, free from cuml.common.array import CumlArray from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.cluster import KMeans diff --git a/python/cuml/common/base.pyx b/python/cuml/common/base.pyx index 6e81a00fed..9cf6fdb2a4 100644 --- a/python/cuml/common/base.pyx +++ b/python/cuml/common/base.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import cuml.common import cuml.common.cuda import cuml.common.logger as logger import cuml.internals -import cuml.raft.common.handle +import raft.common.handle import cuml.common.input_utils from cuml.common.doc_utils import generate_docstring @@ -164,7 +164,7 @@ class Base(TagsMixin, Constructor. All children must call init method of this base class. """ - self.handle = cuml.raft.common.handle.Handle() if handle is None \ + self.handle = raft.common.handle.Handle() if handle is None \ else handle # Internally, self.verbose follows the spdlog/c++ standard of diff --git a/python/cuml/common/handle.pyx b/python/cuml/common/handle.pyx index 805079f80c..6670f540e2 100644 --- a/python/cuml/common/handle.pyx +++ b/python/cuml/common/handle.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,6 @@ # distutils: language = c++ -from cuml.raft.common.handle import Handle as raftHandle +from raft.common.handle import Handle as raftHandle Handle = raftHandle diff --git a/python/cuml/dask/cluster/dbscan.py b/python/cuml/dask/cluster/dbscan.py index aca05f5c6b..f49156f55d 100644 --- a/python/cuml/dask/cluster/dbscan.py +++ b/python/cuml/dask/cluster/dbscan.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ from cuml.dask.common.base import DelayedTransformMixin from cuml.dask.common.base import mnmg_import -from cuml.raft.dask.common.comms import Comms -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import Comms +from raft.dask.common.comms import get_raft_comm_state from cuml.dask.common.utils import wait_and_raise_from_futures diff --git a/python/cuml/dask/cluster/kmeans.py b/python/cuml/dask/cluster/kmeans.py index 690d24b6da..e26b85875f 100644 --- a/python/cuml/dask/cluster/kmeans.py +++ b/python/cuml/dask/cluster/kmeans.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ from cuml.dask.common.input_utils import concatenate from cuml.dask.common.input_utils import DistributedDataHandler -from cuml.raft.dask.common.comms import Comms -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import Comms +from raft.dask.common.comms import get_raft_comm_state from cuml.dask.common.utils import wait_and_raise_from_futures diff --git a/python/cuml/dask/common/base.py b/python/cuml/dask/common/base.py index 17a9d1a765..ec20069b49 100644 --- a/python/cuml/dask/common/base.py +++ b/python/cuml/dask/common/base.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ from cuml import Base from cuml.common.array import CumlArray from cuml.dask.common.utils import wait_and_raise_from_futures -from cuml.raft.dask.common.comms import Comms +from raft.dask.common.comms import Comms from cuml.dask.common.input_utils import DistributedDataHandler from cuml.dask.common import parts_to_ranks from cuml.internals import BaseMetaClass diff --git a/python/cuml/dask/decomposition/base.py b/python/cuml/dask/decomposition/base.py index 060467eb7f..39d851825d 100644 --- a/python/cuml/dask/decomposition/base.py +++ b/python/cuml/dask/decomposition/base.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ # from cuml.dask.common import raise_exception_from_futures -from cuml.raft.dask.common.comms import get_raft_comm_state -from cuml.raft.dask.common.comms import Comms +from raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import Comms from cuml.dask.common.input_utils import to_output from cuml.dask.common import parts_to_ranks diff --git a/python/cuml/dask/linear_model/linear_regression.py b/python/cuml/dask/linear_model/linear_regression.py index 7cc6d44f09..5ec9700855 100644 --- a/python/cuml/dask/linear_model/linear_regression.py +++ b/python/cuml/dask/linear_model/linear_regression.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ from cuml.dask.common.base import DelayedPredictionMixin from cuml.dask.common.base import mnmg_import from cuml.dask.common.base import SyncFitMixinLinearModel -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import get_raft_comm_state class LinearRegression(BaseEstimator, diff --git a/python/cuml/dask/linear_model/ridge.py b/python/cuml/dask/linear_model/ridge.py index 7a213cdc45..b24912c64c 100644 --- a/python/cuml/dask/linear_model/ridge.py +++ b/python/cuml/dask/linear_model/ridge.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ from cuml.dask.common.base import DelayedPredictionMixin from cuml.dask.common.base import mnmg_import from cuml.dask.common.base import SyncFitMixinLinearModel -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import get_raft_comm_state class Ridge(BaseEstimator, diff --git a/python/cuml/dask/neighbors/kneighbors_classifier.py b/python/cuml/dask/neighbors/kneighbors_classifier.py index 867f8e57e7..1ef28de92b 100644 --- a/python/cuml/dask/neighbors/kneighbors_classifier.py +++ b/python/cuml/dask/neighbors/kneighbors_classifier.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ from cuml.dask.common import flatten_grouped_results from cuml.dask.common.utils import raise_mg_import_exception from cuml.dask.common.utils import wait_and_raise_from_futures -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import get_raft_comm_state from cuml.dask.neighbors import NearestNeighbors from dask.dataframe import Series as DaskSeries import dask.array as da diff --git a/python/cuml/dask/neighbors/kneighbors_regressor.py b/python/cuml/dask/neighbors/kneighbors_regressor.py index 98683312b0..7fb9d49f7b 100644 --- a/python/cuml/dask/neighbors/kneighbors_regressor.py +++ b/python/cuml/dask/neighbors/kneighbors_regressor.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ from cuml.dask.common import flatten_grouped_results from cuml.dask.common.utils import raise_mg_import_exception from cuml.dask.common.utils import wait_and_raise_from_futures -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import get_raft_comm_state from cuml.dask.neighbors import NearestNeighbors import dask.array as da from uuid import uuid1 diff --git a/python/cuml/dask/neighbors/nearest_neighbors.py b/python/cuml/dask/neighbors/nearest_neighbors.py index 608e39e606..dff7aae2e4 100644 --- a/python/cuml/dask/neighbors/nearest_neighbors.py +++ b/python/cuml/dask/neighbors/nearest_neighbors.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ from cuml.dask.common import raise_mg_import_exception from cuml.dask.common.base import BaseEstimator -from cuml.raft.dask.common.comms import get_raft_comm_state -from cuml.raft.dask.common.comms import Comms +from raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import Comms from cuml.dask.common.input_utils import to_output from cuml.dask.common.input_utils import DistributedDataHandler diff --git a/python/cuml/dask/solvers/cd.py b/python/cuml/dask/solvers/cd.py index 93704734e5..92e05996de 100644 --- a/python/cuml/dask/solvers/cd.py +++ b/python/cuml/dask/solvers/cd.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ from cuml.dask.common.base import DelayedPredictionMixin from cuml.dask.common.base import mnmg_import from cuml.dask.common.base import SyncFitMixinLinearModel -from cuml.raft.dask.common.comms import get_raft_comm_state +from raft.dask.common.comms import get_raft_comm_state class CD(BaseEstimator, diff --git a/python/cuml/datasets/arima.pyx b/python/cuml/datasets/arima.pyx index d938b1ae3f..4842aa420e 100644 --- a/python/cuml/datasets/arima.pyx +++ b/python/cuml/datasets/arima.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import numpy as np from cuml.common.array import CumlArray as cumlArray import cuml.internals -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle from cuml.tsa.arima cimport ARIMAOrder from libc.stdint cimport uint64_t, uintptr_t diff --git a/python/cuml/datasets/regression.pyx b/python/cuml/datasets/regression.pyx index 7d8d0b40da..5b650a839f 100644 --- a/python/cuml/datasets/regression.pyx +++ b/python/cuml/datasets/regression.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ import numpy as np import cuml.internals from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle from libcpp cimport bool from libc.stdint cimport uint64_t, uintptr_t diff --git a/python/cuml/decomposition/base_mg.pyx b/python/cuml/decomposition/base_mg.pyx index 620b190fbb..fa6c64ca75 100644 --- a/python/cuml/decomposition/base_mg.pyx +++ b/python/cuml/decomposition/base_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ from cuml.common.array import CumlArray import cuml.common.opg_data_utils_mg as opg import cuml.internals from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.decomposition.utils cimport * from cuml.common import input_to_cuml_array from cuml.common.opg_data_utils_mg cimport * diff --git a/python/cuml/decomposition/pca.pyx b/python/cuml/decomposition/pca.pyx index 4a599e29bf..ea2f26cf9d 100644 --- a/python/cuml/decomposition/pca.pyx +++ b/python/cuml/decomposition/pca.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,8 +36,8 @@ import cuml.internals from cuml.common.array import CumlArray from cuml.common.base import Base from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle import cuml.common.logger as logger from cuml.decomposition.utils cimport * from cuml.common.input_utils import input_to_cuml_array diff --git a/python/cuml/decomposition/pca_mg.pyx b/python/cuml/decomposition/pca_mg.pyx index 6365477355..3e4ea71db4 100644 --- a/python/cuml/decomposition/pca_mg.pyx +++ b/python/cuml/decomposition/pca_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import cuml.common.opg_data_utils_mg as opg import cuml.internals from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.decomposition.utils cimport paramsSolver from cuml.common.opg_data_utils_mg cimport * diff --git a/python/cuml/decomposition/tsvd.pyx b/python/cuml/decomposition/tsvd.pyx index 2e79c61c9a..6118901082 100644 --- a/python/cuml/decomposition/tsvd.pyx +++ b/python/cuml/decomposition/tsvd.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ from libc.stdint cimport uintptr_t from cuml.common.array import CumlArray from cuml.common.base import Base from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.decomposition.utils cimport * from cuml.common import input_to_cuml_array from cuml.common.array_descriptor import CumlArrayDescriptor diff --git a/python/cuml/decomposition/tsvd_mg.pyx b/python/cuml/decomposition/tsvd_mg.pyx index adfdc174f5..b8babbd6a4 100644 --- a/python/cuml/decomposition/tsvd_mg.pyx +++ b/python/cuml/decomposition/tsvd_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ from cython.operator cimport dereference as deref import cuml.internals from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.decomposition.utils cimport * import cuml.common.opg_data_utils_mg as opg from cuml.common.opg_data_utils_mg cimport * diff --git a/python/cuml/ensemble/randomforest_common.pyx b/python/cuml/ensemble/randomforest_common.pyx index 1ff6b7d8a7..cc379c11e4 100644 --- a/python/cuml/ensemble/randomforest_common.pyx +++ b/python/cuml/ensemble/randomforest_common.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ from inspect import signature import numpy as np from cuml import ForestInference from cuml.fil.fil import TreeliteModel -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle from cuml.common.base import Base from cuml.common.array import CumlArray from cuml.common.exceptions import NotFittedError diff --git a/python/cuml/ensemble/randomforest_shared.pxd b/python/cuml/ensemble/randomforest_shared.pxd index 638b1d7a10..c3d1160fec 100644 --- a/python/cuml/ensemble/randomforest_shared.pxd +++ b/python/cuml/ensemble/randomforest_shared.pxd @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,10 +25,10 @@ from libc.stdlib cimport calloc, malloc, free from libcpp.vector cimport vector from libcpp.string cimport string -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle from cuml import ForestInference from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cimport cuml.common.cuda cdef extern from "treelite/c_api.h": diff --git a/python/cuml/ensemble/randomforestclassifier.pyx b/python/cuml/ensemble/randomforestclassifier.pyx index 9a24be2995..e174e18a35 100644 --- a/python/cuml/ensemble/randomforestclassifier.pyx +++ b/python/cuml/ensemble/randomforestclassifier.pyx @@ -29,7 +29,7 @@ from cuml.common.mixins import ClassifierMixin import cuml.internals from cuml.common.doc_utils import generate_docstring from cuml.common.doc_utils import insert_into_docstring -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle from cuml.common import input_to_cuml_array from cuml.ensemble.randomforest_common import BaseRandomForestModel @@ -47,7 +47,7 @@ from libc.stdlib cimport calloc, malloc, free from numba import cuda -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cimport cuml.common.cuda cimport cython diff --git a/python/cuml/ensemble/randomforestregressor.pyx b/python/cuml/ensemble/randomforestregressor.pyx index 078d33b49c..a951b8482f 100644 --- a/python/cuml/ensemble/randomforestregressor.pyx +++ b/python/cuml/ensemble/randomforestregressor.pyx @@ -30,7 +30,7 @@ import cuml.internals from cuml.common.mixins import RegressorMixin from cuml.common.doc_utils import generate_docstring from cuml.common.doc_utils import insert_into_docstring -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle from cuml.common import input_to_cuml_array from cuml.ensemble.randomforest_common import BaseRandomForestModel @@ -48,7 +48,7 @@ from libc.stdlib cimport calloc, malloc, free from numba import cuda -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cimport cuml.common.cuda cimport cython diff --git a/python/cuml/experimental/linear_model/lars.pyx b/python/cuml/experimental/linear_model/lars.pyx index 273dc866c3..8497a65f02 100644 --- a/python/cuml/experimental/linear_model/lars.pyx +++ b/python/cuml/experimental/linear_model/lars.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ from cuml.common.base import Base from cuml.common.mixins import RegressorMixin from cuml.common.doc_utils import generate_docstring from cuml.common.exceptions import NotFittedError -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cdef extern from "cuml/solvers/lars.hpp" namespace "ML::Solver::Lars": diff --git a/python/cuml/explainer/base.pyx b/python/cuml/explainer/base.pyx index 87f4d58ff2..f4ebbb9d69 100644 --- a/python/cuml/explainer/base.pyx +++ b/python/cuml/explainer/base.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ from cuml.explainer.common import get_tag_from_model_func from cuml.explainer.common import model_func_call from cuml.explainer.common import output_list_shap_values -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libcpp cimport bool from libc.stdint cimport uintptr_t @@ -89,7 +89,7 @@ class SHAPBase(): (as CuPy arrays), otherwise it will use NumPy arrays to call `model`. Set to True to force the explainer to use GPU data, set to False to force the Explainer to use NumPy data. - handle : cuml.raft.common.handle + handle : raft.common.handle Specifies the handle that holds internal CUDA state for computations in this model. Most importantly, this specifies the CUDA stream that will be used for the model's computations, so users can diff --git a/python/cuml/explainer/common.py b/python/cuml/explainer/common.py index 7cceb42564..730719dfd2 100644 --- a/python/cuml/explainer/common.py +++ b/python/cuml/explainer/common.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import cuml import cupy as cp +from raft.common.handle import Handle from cuml.common.input_utils import input_to_cupy_array @@ -69,7 +70,7 @@ def get_handle_from_cuml_model_func(func, create_new=False): if owner.handle is not None: return owner.handle - handle = cuml.raft.common.handle.Handle() if create_new else None + handle = Handle() if create_new else None return handle diff --git a/python/cuml/explainer/kernel_shap.pyx b/python/cuml/explainer/kernel_shap.pyx index eb312775e8..e6afb4e2c0 100644 --- a/python/cuml/explainer/kernel_shap.pyx +++ b/python/cuml/explainer/kernel_shap.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,13 +27,13 @@ from cuml.explainer.common import model_func_call from cuml.explainer.common import output_list_shap_values from cuml.linear_model import Lasso from cuml.linear_model import LinearRegression -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle from functools import lru_cache from itertools import combinations from numbers import Number from random import randint -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libc.stdint cimport uintptr_t from libc.stdint cimport uint64_t @@ -134,7 +134,7 @@ class KernelExplainer(SHAPBase): (as CuPy arrays), otherwise it will use NumPy arrays to call `model`. Set to True to force the explainer to use GPU data, set to False to force the Explainer to use NumPy data. - handle : cuml.raft.common.handle (default = None) + handle : raft.common.handle (default = None) Specifies the handle that holds internal CUDA state for computations in this model, a new one is created if it is None. Most importantly, this specifies the CUDA stream that will be used for diff --git a/python/cuml/explainer/permutation_shap.pyx b/python/cuml/explainer/permutation_shap.pyx index ba1296bcfe..ae52b4afa9 100644 --- a/python/cuml/explainer/permutation_shap.pyx +++ b/python/cuml/explainer/permutation_shap.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ from cuml.explainer.common import model_func_call from numba import cuda from pandas import DataFrame as pd_df -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libcpp cimport bool from libc.stdint cimport uintptr_t @@ -139,7 +139,7 @@ class PermutationExplainer(SHAPBase): (as CuPy arrays), otherwise it will use NumPy arrays to call `model`. Set to True to force the explainer to use GPU data, set to False to force the Explainer to use NumPy data. - handle : cuml.raft.common.handle (default = None) + handle : raft.common.handle (default = None) Specifies the handle that holds internal CUDA state for computations in this model, a new one is created if it is None. Most importantly, this specifies the CUDA stream that will be used for diff --git a/python/cuml/fil/fil.pyx b/python/cuml/fil/fil.pyx index d0e6bcad8d..205261c076 100644 --- a/python/cuml/fil/fil.pyx +++ b/python/cuml/fil/fil.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ from libc.stdlib cimport calloc, malloc, free import cuml.internals from cuml.common.array import CumlArray from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array, logger from cuml.common.mixins import CMajorInputTagMixin from cuml.common.doc_utils import _parameters_docstrings diff --git a/python/cuml/linear_model/base.pyx b/python/cuml/linear_model/base.pyx index 3a6a797ac2..130fdac78f 100644 --- a/python/cuml/linear_model/base.pyx +++ b/python/cuml/linear_model/base.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.base import Base from cuml.common.mixins import RegressorMixin from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array cdef extern from "cuml/linear_model/glm.hpp" namespace "ML::GLM": diff --git a/python/cuml/linear_model/base_mg.pyx b/python/cuml/linear_model/base_mg.pyx index 0eb38051db..1959f50e06 100644 --- a/python/cuml/linear_model/base_mg.pyx +++ b/python/cuml/linear_model/base_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2020, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ from cython.operator cimport dereference as deref import cuml.internals from cuml.common.base import Base from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from cuml.common.input_utils import input_to_cuml_array from cuml.decomposition.utils cimport * diff --git a/python/cuml/linear_model/linear_regression.pyx b/python/cuml/linear_model/linear_regression.pyx index 62812e186e..8a3facb1f6 100644 --- a/python/cuml/linear_model/linear_regression.pyx +++ b/python/cuml/linear_model/linear_regression.pyx @@ -35,7 +35,7 @@ from cuml.common.base import Base from cuml.common.mixins import RegressorMixin from cuml.common.doc_utils import generate_docstring from cuml.linear_model.base import LinearPredictMixin -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common.mixins import FMajorInputTagMixin diff --git a/python/cuml/linear_model/linear_regression_mg.pyx b/python/cuml/linear_model/linear_regression_mg.pyx index bddafc3eb5..d918a80913 100644 --- a/python/cuml/linear_model/linear_regression_mg.pyx +++ b/python/cuml/linear_model/linear_regression_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2020, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ from cython.operator cimport dereference as deref import cuml.internals from cuml.common.base import Base from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from cuml.common import input_to_cuml_array from cuml.decomposition.utils cimport * diff --git a/python/cuml/linear_model/ridge.pyx b/python/cuml/linear_model/ridge.pyx index 4cdec14077..62e87917e1 100644 --- a/python/cuml/linear_model/ridge.pyx +++ b/python/cuml/linear_model/ridge.pyx @@ -33,7 +33,7 @@ from cuml.common.mixins import RegressorMixin from cuml.common.array import CumlArray from cuml.common.doc_utils import generate_docstring from cuml.linear_model.base import LinearPredictMixin -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common.mixins import FMajorInputTagMixin diff --git a/python/cuml/linear_model/ridge_mg.pyx b/python/cuml/linear_model/ridge_mg.pyx index fa7f85c30d..d533270736 100644 --- a/python/cuml/linear_model/ridge_mg.pyx +++ b/python/cuml/linear_model/ridge_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2020, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ from cython.operator cimport dereference as deref import cuml.internals from cuml.common.base import Base from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from cuml.common import input_to_cuml_array from cuml.decomposition.utils cimport * diff --git a/python/cuml/manifold/t_sne.pyx b/python/cuml/manifold/t_sne.pyx index d7d46b1834..cd9f3ed24f 100644 --- a/python/cuml/manifold/t_sne.pyx +++ b/python/cuml/manifold/t_sne.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ import cupy import cuml.internals from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t import cuml.common.logger as logger from cuml.common.array import CumlArray diff --git a/python/cuml/manifold/umap.pyx b/python/cuml/manifold/umap.pyx index 6a6dc4c08d..27b770aa7b 100644 --- a/python/cuml/manifold/umap.pyx +++ b/python/cuml/manifold/umap.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ from cupyx.scipy.sparse import csr_matrix as cp_csr_matrix,\ import cuml.internals from cuml.common import using_output_type from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.doc_utils import generate_docstring from cuml.common import logger from cuml.common.input_utils import input_to_cuml_array diff --git a/python/cuml/metrics/accuracy.pyx b/python/cuml/metrics/accuracy.pyx index f002e888d0..d6f50e1aa9 100644 --- a/python/cuml/metrics/accuracy.pyx +++ b/python/cuml/metrics/accuracy.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ import cudf import cuml.internals from cuml.common.input_utils import input_to_cuml_array -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle cimport cuml.common.cuda cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/cluster/adjusted_rand_index.pyx b/python/cuml/metrics/cluster/adjusted_rand_index.pyx index 4c656846c8..3291e5b90c 100644 --- a/python/cuml/metrics/cluster/adjusted_rand_index.pyx +++ b/python/cuml/metrics/cluster/adjusted_rand_index.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,9 +22,9 @@ import warnings from libc.stdint cimport uintptr_t import cuml.internals -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle cimport cuml.common.cuda cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/cluster/completeness_score.pyx b/python/cuml/metrics/cluster/completeness_score.pyx index c6cfaa39d0..d7a557badb 100644 --- a/python/cuml/metrics/cluster/completeness_score.pyx +++ b/python/cuml/metrics/cluster/completeness_score.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ # distutils: language = c++ import cuml.internals -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libc.stdint cimport uintptr_t from cuml.metrics.cluster.utils import prepare_cluster_metric_inputs -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/cluster/entropy.pyx b/python/cuml/metrics/cluster/entropy.pyx index a1c6360122..0c37c94c71 100644 --- a/python/cuml/metrics/cluster/entropy.pyx +++ b/python/cuml/metrics/cluster/entropy.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,10 +24,10 @@ import cupy as cp from libc.stdint cimport uintptr_t import cuml.internals -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import CumlArray from cuml.common.input_utils import input_to_cupy_array -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle cimport cuml.common.cuda cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/cluster/homogeneity_score.pyx b/python/cuml/metrics/cluster/homogeneity_score.pyx index 16b3d7b39f..517537d9d2 100644 --- a/python/cuml/metrics/cluster/homogeneity_score.pyx +++ b/python/cuml/metrics/cluster/homogeneity_score.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ # distutils: language = c++ import cuml.internals -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libc.stdint cimport uintptr_t from cuml.metrics.cluster.utils import prepare_cluster_metric_inputs -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/cluster/mutual_info_score.pyx b/python/cuml/metrics/cluster/mutual_info_score.pyx index 7b54b192b9..a576ec9eba 100644 --- a/python/cuml/metrics/cluster/mutual_info_score.pyx +++ b/python/cuml/metrics/cluster/mutual_info_score.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,11 +17,11 @@ # distutils: language = c++ import cuml.internals -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libc.stdint cimport uintptr_t from cuml.metrics.cluster.utils import prepare_cluster_metric_inputs -from cuml.raft.common.handle import Handle +from raft.common.handle import Handle cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/cluster/silhouette_score.pyx b/python/cuml/metrics/cluster/silhouette_score.pyx index 0a0ac26f45..20efa8c8d7 100644 --- a/python/cuml/metrics/cluster/silhouette_score.pyx +++ b/python/cuml/metrics/cluster/silhouette_score.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ from libc.stdint cimport uintptr_t from cuml.common import input_to_cuml_array from cuml.metrics.pairwise_distances import _determine_metric -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle from cuml.metrics.distance_type cimport DistanceType from cuml.prims.label.classlabels import make_monotonic, check_labels diff --git a/python/cuml/metrics/kl_divergence.pyx b/python/cuml/metrics/kl_divergence.pyx index adf8b2c512..be256f9b84 100644 --- a/python/cuml/metrics/kl_divergence.pyx +++ b/python/cuml/metrics/kl_divergence.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import cuml.internals from cuml.common.input_utils import determine_array_type from cuml.common import (input_to_cuml_array, CumlArray, logger) from libc.stdint cimport uintptr_t -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": double c_kl_divergence "ML::Metrics::kl_divergence"( diff --git a/python/cuml/metrics/pairwise_distances.pyx b/python/cuml/metrics/pairwise_distances.pyx index 3eb4f916c3..4e7a8d1cc3 100644 --- a/python/cuml/metrics/pairwise_distances.pyx +++ b/python/cuml/metrics/pairwise_distances.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import warnings from libcpp cimport bool from libc.stdint cimport uintptr_t -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle import cupy as cp import numpy as np import scipy diff --git a/python/cuml/metrics/regression.pxd b/python/cuml/metrics/regression.pxd index 315911e104..2e44d88d52 100644 --- a/python/cuml/metrics/regression.pxd +++ b/python/cuml/metrics/regression.pxd @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # limitations under the License. # -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cdef extern from "cuml/metrics/metrics.hpp" namespace "ML::Metrics": diff --git a/python/cuml/metrics/regression.pyx b/python/cuml/metrics/regression.pyx index 33cd327b20..1570005758 100644 --- a/python/cuml/metrics/regression.pyx +++ b/python/cuml/metrics/regression.pyx @@ -23,8 +23,8 @@ from libc.stdint cimport uintptr_t import cuml.internals from cuml.common.array import CumlArray -from cuml.raft.common.handle import Handle -from cuml.raft.common.handle cimport handle_t +from raft.common.handle import Handle +from raft.common.handle cimport handle_t from cuml.metrics cimport regression from cuml.common.input_utils import input_to_cuml_array diff --git a/python/cuml/metrics/trustworthiness.pyx b/python/cuml/metrics/trustworthiness.pyx index cf7a5e16db..e4db5486bb 100644 --- a/python/cuml/metrics/trustworthiness.pyx +++ b/python/cuml/metrics/trustworthiness.pyx @@ -25,8 +25,8 @@ from numba import cuda from libc.stdint cimport uintptr_t import cuml.internals from cuml.common.input_utils import input_to_cuml_array -from cuml.raft.common.handle import Handle -from cuml.raft.common.handle cimport handle_t +from raft.common.handle import Handle +from raft.common.handle cimport handle_t cdef extern from "raft/distance/distance_type.hpp" namespace "raft::distance": @@ -89,7 +89,7 @@ def trustworthiness(X, X_embedded, handle=None, n_neighbors=5, if n_neighbors > X.shape[0]: raise ValueError("n_neighbors must be <= the number of rows.") - handle = cuml.raft.common.handle.Handle() if handle is None else handle + handle = Handle() if handle is None else handle cdef uintptr_t d_X_ptr cdef uintptr_t d_X_embedded_ptr diff --git a/python/cuml/neighbors/kneighbors_classifier.pyx b/python/cuml/neighbors/kneighbors_classifier.pyx index 47ac087ea0..817f41b8d8 100644 --- a/python/cuml/neighbors/kneighbors_classifier.pyx +++ b/python/cuml/neighbors/kneighbors_classifier.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import cudf from cython.operator cimport dereference as deref -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libcpp.vector cimport vector from libcpp cimport bool diff --git a/python/cuml/neighbors/kneighbors_classifier_mg.pyx b/python/cuml/neighbors/kneighbors_classifier_mg.pyx index b0dfe7a0eb..faf6ae3d0e 100644 --- a/python/cuml/neighbors/kneighbors_classifier_mg.pyx +++ b/python/cuml/neighbors/kneighbors_classifier_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ from cuml.internals import api_base_return_generic_skipall from cuml.neighbors.nearest_neighbors_mg import NearestNeighborsMG -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from cuml.common import input_to_cuml_array diff --git a/python/cuml/neighbors/kneighbors_regressor.pyx b/python/cuml/neighbors/kneighbors_regressor.pyx index b33a9ea79f..0d1e91c191 100644 --- a/python/cuml/neighbors/kneighbors_regressor.pyx +++ b/python/cuml/neighbors/kneighbors_regressor.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ from cython.operator cimport dereference as deref from libcpp.vector cimport vector -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from libcpp cimport bool from libcpp.memory cimport shared_ptr diff --git a/python/cuml/neighbors/kneighbors_regressor_mg.pyx b/python/cuml/neighbors/kneighbors_regressor_mg.pyx index 517fda7cbd..8bdfb71cc7 100644 --- a/python/cuml/neighbors/kneighbors_regressor_mg.pyx +++ b/python/cuml/neighbors/kneighbors_regressor_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ from cuml.internals import api_base_return_generic_skipall from cuml.neighbors.nearest_neighbors_mg import NearestNeighborsMG -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from libcpp cimport bool diff --git a/python/cuml/neighbors/nearest_neighbors.pyx b/python/cuml/neighbors/nearest_neighbors.pyx index 0790d2cc87..a115951e40 100644 --- a/python/cuml/neighbors/nearest_neighbors.pyx +++ b/python/cuml/neighbors/nearest_neighbors.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ from cuml.common.sparse_utils import is_dense from cuml.metrics.distance_type cimport DistanceType from cuml.neighbors.ann cimport * -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cython.operator cimport dereference as deref diff --git a/python/cuml/neighbors/nearest_neighbors_mg.pyx b/python/cuml/neighbors/nearest_neighbors_mg.pyx index 15df3a4b12..4d0de34007 100644 --- a/python/cuml/neighbors/nearest_neighbors_mg.pyx +++ b/python/cuml/neighbors/nearest_neighbors_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import cuml.common.logger as logger from cuml.neighbors import NearestNeighbors -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from cuml.common.opg_data_utils_mg import _build_part_inputs diff --git a/python/cuml/random_projection/random_projection.pyx b/python/cuml/random_projection/random_projection.pyx index 2887cc0ace..c4c91203b0 100644 --- a/python/cuml/random_projection/random_projection.pyx +++ b/python/cuml/random_projection/random_projection.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2018-2021, NVIDIA CORPORATION. +# Copyright (c) 2018-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ from libcpp cimport bool import cuml.internals from cuml.common.array import CumlArray from cuml.common.base import Base -from cuml.raft.common.handle cimport * +from raft.common.handle cimport * from cuml.common import input_to_cuml_array from cuml.common.mixins import FMajorInputTagMixin diff --git a/python/cuml/solvers/cd.pyx b/python/cuml/solvers/cd.pyx index 86d34dbd21..2019dbcf9c 100644 --- a/python/cuml/solvers/cd.pyx +++ b/python/cuml/solvers/cd.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2021, NVIDIA CORPORATION. +# Copyright (c) 2018-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ from cuml.common import CumlArray from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.base import Base from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.input_utils import input_to_cuml_array from cuml.common.mixins import FMajorInputTagMixin diff --git a/python/cuml/solvers/cd_mg.pyx b/python/cuml/solvers/cd_mg.pyx index b8621b94c4..37530863af 100644 --- a/python/cuml/solvers/cd_mg.pyx +++ b/python/cuml/solvers/cd_mg.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ from cython.operator cimport dereference as deref import cuml.internals from cuml.common.base import Base from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.opg_data_utils_mg cimport * from cuml.common.input_utils import input_to_cuml_array from cuml.decomposition.utils cimport * diff --git a/python/cuml/solvers/qn.pyx b/python/cuml/solvers/qn.pyx index 20114191eb..a72ac7c7f7 100644 --- a/python/cuml/solvers/qn.pyx +++ b/python/cuml/solvers/qn.pyx @@ -28,7 +28,7 @@ from cuml.common.base import Base from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.array_sparse import SparseCumlArray from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common.mixins import FMajorInputTagMixin from cuml.common.sparse_utils import is_sparse diff --git a/python/cuml/solvers/sgd.pyx b/python/cuml/solvers/sgd.pyx index d063834e57..30a767fe71 100644 --- a/python/cuml/solvers/sgd.pyx +++ b/python/cuml/solvers/sgd.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2021, NVIDIA CORPORATION. +# Copyright (c) 2018-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ from cuml.common.base import Base from cuml.common.array import CumlArray from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.doc_utils import generate_docstring -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common.mixins import FMajorInputTagMixin diff --git a/python/cuml/svm/linear.pyx b/python/cuml/svm/linear.pyx index ec598545e2..a2ebc2f72d 100644 --- a/python/cuml/svm/linear.pyx +++ b/python/cuml/svm/linear.pyx @@ -29,8 +29,8 @@ from cuml.internals.base_helpers import BaseMetaClass from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.array import CumlArray from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.interruptible import cuda_interruptible +from raft.common.handle cimport handle_t +from raft.common.interruptible import cuda_interruptible from cuml.common import input_to_cuml_array from libc.stdint cimport uintptr_t from libcpp cimport bool as cppbool diff --git a/python/cuml/svm/svc.pyx b/python/cuml/svm/svc.pyx index a19a406a2d..d5eafcbba9 100644 --- a/python/cuml/svm/svc.pyx +++ b/python/cuml/svm/svc.pyx @@ -34,8 +34,8 @@ from cuml.common.mixins import ClassifierMixin from cuml.common.doc_utils import generate_docstring from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.logger import warn -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.interruptible import cuda_interruptible +from raft.common.handle cimport handle_t +from raft.common.interruptible import cuda_interruptible from cuml.common import input_to_cuml_array, input_to_host_array, with_cupy_rmm from cuml.common.input_utils import input_to_cupy_array from cuml.preprocessing import LabelEncoder diff --git a/python/cuml/svm/svm_base.pyx b/python/cuml/svm/svm_base.pyx index 46c65cfc20..a830c11942 100644 --- a/python/cuml/svm/svm_base.pyx +++ b/python/cuml/svm/svm_base.pyx @@ -30,7 +30,7 @@ from cuml.common.array import CumlArray from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.base import Base from cuml.common.exceptions import NotFittedError -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from cuml.common import using_output_type from cuml.common.logger import warn diff --git a/python/cuml/svm/svr.pyx b/python/cuml/svm/svr.pyx index e853cc679a..09dbc721eb 100644 --- a/python/cuml/svm/svr.pyx +++ b/python/cuml/svm/svr.pyx @@ -30,7 +30,7 @@ from cuml.common.base import Base from cuml.common.mixins import RegressorMixin from cuml.common.doc_utils import generate_docstring from cuml.metrics import r2_score -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common import input_to_cuml_array from libcpp cimport bool, nullptr from cuml.svm.svm_base import SVMBase diff --git a/python/cuml/test/explainer/test_explainer_base.py b/python/cuml/test/explainer/test_explainer_base.py index 7b2b922906..671c80345a 100644 --- a/python/cuml/test/explainer/test_explainer_base.py +++ b/python/cuml/test/explainer/test_explainer_base.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,11 +15,12 @@ # import cudf -import cuml import cupy as cp import numpy as np import pytest +from raft.common.handle import Handle + from cuml.explainer.base import SHAPBase from cuml import LinearRegression as cuLR @@ -37,7 +38,7 @@ def test_init_explainer_base_init_cuml_model(handle, model = cuLR().fit(bg, y) if handle: - handle = cuml.raft.common.handle.Handle() + handle = Handle() else: handle = None @@ -85,7 +86,7 @@ def test_init_explainer_base_init_abritrary_model(handle, bg = np.arange(10).reshape(5, 2).astype(np.float32) if handle: - handle = cuml.raft.common.handle.Handle() + handle = Handle() else: handle = None @@ -125,7 +126,7 @@ def test_init_explainer_base_init_abritrary_model(handle, if handle is not None: assert explainer.handle == handle else: - isinstance(explainer.handle, cuml.raft.common.handle.Handle) + isinstance(explainer.handle, Handle) def test_init_explainer_base_wrong_dtype(): diff --git a/python/cuml/test/explainer/test_explainer_common.py b/python/cuml/test/explainer/test_explainer_common.py index 5624ef50ee..e61b5eaeee 100644 --- a/python/cuml/test/explainer/test_explainer_common.py +++ b/python/cuml/test/explainer/test_explainer_common.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,6 +32,8 @@ from cuml.datasets import make_regression from sklearn.linear_model import LinearRegression as skreg +from raft.common.handle import Handle + models_config = ClassEnumerator(module=cuml) models = models_config.get_models() @@ -147,7 +149,7 @@ def test_get_handle_from_cuml_model_func(model): handle = get_handle_from_cuml_model_func(mod.get_param_names, create_new=True) - assert isinstance(handle, cuml.raft.common.handle.Handle) + assert isinstance(handle, Handle) @pytest.mark.parametrize("create_new", [True, False]) @@ -155,7 +157,7 @@ def test_get_handle_from_dummy_func(create_new): handle = get_handle_from_cuml_model_func(dummy_func, create_new=create_new) - res = isinstance(handle, cuml.raft.common.handle.Handle) + res = isinstance(handle, Handle) assert res == create_new diff --git a/python/cuml/test/test_base.py b/python/cuml/test/test_base.py index 4bb5c14514..814a50bcf7 100644 --- a/python/cuml/test/test_base.py +++ b/python/cuml/test/test_base.py @@ -18,6 +18,9 @@ import cuml import pytest import numpydoc.docscrape + +from raft.common.cuda import Stream + from cuml.test.utils import (get_classes_from_package, small_classification_dataset) from cuml._thirdparty.sklearn.utils.skl_dependencies import BaseEstimator \ @@ -40,7 +43,7 @@ def test_base_class_usage(): def test_base_class_usage_with_handle(): - stream = cuml.raft.common.cuda.Stream() + stream = Stream() handle = cuml.Handle(stream=stream) base = cuml.Base(handle=handle) base.handle.sync() diff --git a/python/cuml/test/test_raft.py b/python/cuml/test/test_raft.py deleted file mode 100644 index 7651cc1e09..0000000000 --- a/python/cuml/test/test_raft.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2020, 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import cuml.raft - - -def test_raft(): - assert cuml.raft.raft_include_test() diff --git a/python/cuml/test/utils.py b/python/cuml/test/utils.py index d0f7c8c06c..bf1ce21701 100644 --- a/python/cuml/test/utils.py +++ b/python/cuml/test/utils.py @@ -22,6 +22,8 @@ from numbers import Number from numba.cuda.cudadrv.devicearray import DeviceNDArray +from raft.common.cuda import Stream + from sklearn import datasets from sklearn.datasets import make_classification, make_regression from sklearn.model_selection import train_test_split @@ -171,7 +173,7 @@ def sqnorm(x): def get_handle(use_handle, n_streams=0): if not use_handle: return None, None - s = cuml.raft.common.cuda.Stream() + s = Stream() h = cuml.Handle(stream=s, n_streams=n_streams) return h, s diff --git a/python/cuml/tsa/arima.pyx b/python/cuml/tsa/arima.pyx index 80e7845415..72646d2437 100644 --- a/python/cuml/tsa/arima.pyx +++ b/python/cuml/tsa/arima.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import cuml.internals from cuml.common.array import CumlArray from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.base import Base -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.tsa.batched_lbfgs import batched_fmin_lbfgs_b import cuml.common.logger as logger from cuml.common import has_scipy diff --git a/python/cuml/tsa/auto_arima.pyx b/python/cuml/tsa/auto_arima.pyx index 8c007cd4f9..6977497deb 100644 --- a/python/cuml/tsa/auto_arima.pyx +++ b/python/cuml/tsa/auto_arima.pyx @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,8 +33,8 @@ from cuml.common.array_descriptor import CumlArrayDescriptor from cuml.common.array import CumlArray from cuml.common.base import Base from cuml.internals import _deprecate_pos_args -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle from cuml.common import input_to_cuml_array from cuml.common import using_output_type from cuml.tsa.arima import ARIMA diff --git a/python/cuml/tsa/holtwinters.pyx b/python/cuml/tsa/holtwinters.pyx index 23383bba28..c8c7211cd3 100644 --- a/python/cuml/tsa/holtwinters.pyx +++ b/python/cuml/tsa/holtwinters.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ from cuml.common import using_output_type from cuml.common.base import Base from cuml.common.array import CumlArray from cuml.common.array_descriptor import CumlArrayDescriptor -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t cdef extern from "cuml/tsa/holtwinters_params.h" namespace "ML": enum SeasonalType: diff --git a/python/cuml/tsa/seasonality.pyx b/python/cuml/tsa/seasonality.pyx index 0a06531b67..5f627b0bc2 100644 --- a/python/cuml/tsa/seasonality.pyx +++ b/python/cuml/tsa/seasonality.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ import numpy as np import cuml.internals from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t +from raft.common.handle cimport handle_t from cuml.common.input_utils import input_to_host_array, input_to_cuml_array # TODO: #2234 and #2235 diff --git a/python/cuml/tsa/stationarity.pyx b/python/cuml/tsa/stationarity.pyx index f9d662800b..0d087cb51e 100644 --- a/python/cuml/tsa/stationarity.pyx +++ b/python/cuml/tsa/stationarity.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ from libcpp cimport bool as boolcpp import cuml.internals from cuml.common.array import CumlArray -from cuml.raft.common.handle cimport handle_t -from cuml.raft.common.handle import Handle +from raft.common.handle cimport handle_t +from raft.common.handle import Handle from cuml.common.input_utils import input_to_cuml_array diff --git a/python/setup.py b/python/setup.py index 17408ae29e..b595fa72b9 100644 --- a/python/setup.py +++ b/python/setup.py @@ -34,7 +34,6 @@ from setuputils import clean_folder from setuputils import get_environment_option from setuputils import get_cli_option -from setuputils import use_raft_package import versioneer from cython_build_ext import cython_build_ext @@ -46,7 +45,6 @@ cuda_home = get_environment_option("CUDA_HOME") libcuml_path = get_environment_option('CUML_BUILD_PATH') -raft_path = get_environment_option('RAFT_PATH') clean_artifacts = get_cli_option('clean') @@ -82,8 +80,6 @@ shutil.rmtree(setup_file_path + '/cuml.egg-info', ignore_errors=True) shutil.rmtree(setup_file_path + '/__pycache__', ignore_errors=True) - os.remove(setup_file_path + '/cuml/raft') - clean_folder(setup_file_path + '/cuml') shutil.rmtree(setup_file_path + '/build') @@ -100,12 +96,6 @@ if len(sys.argv) == 1: sys.exit(0) -############################################################################## -# - Cloning RAFT and dependencies if needed ---------------------------------- - -# Use RAFT repository in cuml.raft - -raft_include_dir = use_raft_package(raft_path, libcuml_path) if "--multigpu" in sys.argv: warnings.warn("Flag --multigpu is deprecated. By default cuML is" @@ -157,7 +147,6 @@ def finalize_options(self): '../cpp/src', '../cpp/include', '../cpp/src_prims', - raft_include_dir, cuda_include_dir, numpy.get_include(), '../cpp/build/faiss/src/faiss', @@ -253,8 +242,6 @@ def finalize_options(self): if (self.singlegpu): cython_exc_list = glob.glob('cuml/*/*_mg.pyx') cython_exc_list = cython_exc_list + glob.glob('cuml/*/*_mg.pxd') - cython_exc_list.append('cuml/raft/dask/common/nccl.pyx') - cython_exc_list.append('cuml/raft/dask/common/comms_utils.pyx') print('--singlegpu: excluding the following Cython components:') pprint(cython_exc_list)