From 996f0385d5c80ce9bcf4f99d1fdb412354c93643 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 28 Nov 2024 00:47:22 +0000 Subject: [PATCH] Use an object library for Python --- python/cuvs/CMakeLists.txt | 3 +++ python/cuvs/cuvs/common/CMakeLists.txt | 2 +- python/cuvs/cuvs/distance/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/brute_force/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/cagra/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/filters/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/ivf_flat/CMakeLists.txt | 2 +- python/cuvs/cuvs/neighbors/ivf_pq/CMakeLists.txt | 2 +- python/cuvs/pyproject.toml | 6 +++--- 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/python/cuvs/CMakeLists.txt b/python/cuvs/CMakeLists.txt index feb3bd58c..33070020c 100644 --- a/python/cuvs/CMakeLists.txt +++ b/python/cuvs/CMakeLists.txt @@ -110,6 +110,9 @@ endif() rapids_cython_init() +add_library(rmm_logger OBJECT) +target_link_libraries(rmm_logger PRIVATE rmm::rmm_logger_impl) + add_subdirectory(cuvs/common) add_subdirectory(cuvs/distance) add_subdirectory(cuvs/neighbors) diff --git a/python/cuvs/cuvs/common/CMakeLists.txt b/python/cuvs/cuvs/common/CMakeLists.txt index 929c0dd59..ee0776fb5 100644 --- a/python/cuvs/cuvs/common/CMakeLists.txt +++ b/python/cuvs/cuvs/common/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/distance/CMakeLists.txt b/python/cuvs/cuvs/distance/CMakeLists.txt index 3ecbf78f7..08af49536 100644 --- a/python/cuvs/cuvs/distance/CMakeLists.txt +++ b/python/cuvs/cuvs/distance/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/CMakeLists.txt b/python/cuvs/cuvs/neighbors/CMakeLists.txt index 2c362fd7f..77049d797 100644 --- a/python/cuvs/cuvs/neighbors/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/CMakeLists.txt @@ -31,5 +31,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/brute_force/CMakeLists.txt b/python/cuvs/cuvs/neighbors/brute_force/CMakeLists.txt index d6abf06a9..44ec5a75f 100644 --- a/python/cuvs/cuvs/neighbors/brute_force/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/brute_force/CMakeLists.txt @@ -25,5 +25,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/cagra/CMakeLists.txt b/python/cuvs/cuvs/neighbors/cagra/CMakeLists.txt index 9555685d9..b2ad5d276 100644 --- a/python/cuvs/cuvs/neighbors/cagra/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/cagra/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/filters/CMakeLists.txt b/python/cuvs/cuvs/neighbors/filters/CMakeLists.txt index 4e6f62597..1c8e42e0b 100644 --- a/python/cuvs/cuvs/neighbors/filters/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/filters/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt b/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt index fd7bb6fd8..5b0b39cb2 100644 --- a/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/hnsw/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/ivf_flat/CMakeLists.txt b/python/cuvs/cuvs/neighbors/ivf_flat/CMakeLists.txt index 4eb2e707e..0d627dcf1 100644 --- a/python/cuvs/cuvs/neighbors/ivf_flat/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/ivf_flat/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/cuvs/neighbors/ivf_pq/CMakeLists.txt b/python/cuvs/cuvs/neighbors/ivf_pq/CMakeLists.txt index f224a94e2..8e528b6ad 100644 --- a/python/cuvs/cuvs/neighbors/ivf_pq/CMakeLists.txt +++ b/python/cuvs/cuvs/neighbors/ivf_pq/CMakeLists.txt @@ -24,5 +24,5 @@ rapids_cython_create_modules( ) foreach(tgt IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) - target_link_libraries(${tgt} PRIVATE rmm::rmm_logger_impl) + target_link_libraries(${tgt} PRIVATE rmm_logger) endforeach() diff --git a/python/cuvs/pyproject.toml b/python/cuvs/pyproject.toml index 155e454a8..17faf1065 100644 --- a/python/cuvs/pyproject.toml +++ b/python/cuvs/pyproject.toml @@ -31,7 +31,7 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.10" dependencies = [ - "cuda-python", + "cuda-python>=12.0,<13.0a0,<=12.6.0", "numpy>=1.23,<3.0a0", "nvidia-cublas", "nvidia-curand", @@ -49,7 +49,7 @@ classifiers = [ [project.optional-dependencies] test = [ - "cupy-cuda11x>=12.0.0", + "cupy-cuda12x>=12.0.0", "pytest-cov", "pytest==7.*", "scikit-learn", @@ -125,7 +125,7 @@ regex = "(?P.*)" [tool.rapids-build-backend] requires = [ "cmake>=3.26.4,!=3.30.0", - "cuda-python", + "cuda-python>=12.0,<13.0a0,<=12.6.0", "cython>=3.0.0", "ninja", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.