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

Consolidate pre-compiled specializations into single libraft binary #1333

Merged
merged 144 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from 139 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
57cfa20
Replace faiss bfKnn
benfred Jan 27, 2023
984c641
Merge branch 'branch-23.02' into bfknn
benfred Jan 27, 2023
805abc7
fix merge
benfred Jan 27, 2023
3e21478
Merge branch 'branch-23.02' into bfknn
cjnolet Jan 27, 2023
74bd44f
Fix bug with col_tiles < K
benfred Jan 27, 2023
c69054d
Merge branch 'bfknn' of github.com:benfred/raft into bfknn
benfred Jan 27, 2023
1d9581b
Include metric_arg in bfknn
benfred Jan 30, 2023
b4cf88c
speedup compile times
benfred Jan 30, 2023
98ffb70
Merge branch 'branch-23.02' into bfknn
benfred Jan 31, 2023
5442d31
Suggestions from code review
benfred Jan 31, 2023
0f5d206
fixes
benfred Jan 31, 2023
cb2b750
Merge branch 'branch-23.04' into bfknn
benfred Feb 3, 2023
e870eb3
use pairwise_distance specialization to speed up compile times
benfred Feb 7, 2023
cd84397
Merge branch 'branch-23.04' into bfknn
benfred Feb 7, 2023
8445aed
Use distance specializations
benfred Feb 7, 2023
e87633a
Merge branch 'branch-23.04' into bfknn
cjnolet Feb 9, 2023
52bf729
Merge branch 'branch-23.04' into bfknn
benfred Feb 11, 2023
d97ddb8
Merge branch 'branch-23.04' into bfknn
cjnolet Feb 11, 2023
5905b2d
use specializations in RBC code
benfred Feb 14, 2023
d905266
Merge branch 'branch-23.04' into bfknn
benfred Feb 14, 2023
8eaba84
use pw specializations in rbc
benfred Feb 14, 2023
fe728e9
use matrix::select_k in bfknn call
benfred Feb 14, 2023
96e05e1
expose bf detail specialization
benfred Feb 15, 2023
59060b2
Revert "use pw specializations in rbc"
benfred Feb 15, 2023
c734bac
Add tests for other metrics
benfred Feb 15, 2023
c65e4bb
Fix parameter order
benfred Feb 16, 2023
3830e53
Fix Lp distance
benfred Feb 17, 2023
3f0b9a7
Revert "use matrix::select_k in bfknn call"
benfred Feb 17, 2023
3900570
re-enable failing tests
benfred Feb 17, 2023
8e71915
fix cosine/innerproduct in bfknn
benfred Feb 17, 2023
f806bf6
Test JensenShannon distance
benfred Feb 17, 2023
3315dca
support k up to 2048 in faiss select
benfred Feb 18, 2023
1b6eda2
Merge remote-tracking branch 'origin/branch-23.04' into bfknn
benfred Feb 18, 2023
a83bef3
cmake format
benfred Feb 18, 2023
3b811a1
support k up to 2048 in faiss select
benfred Feb 18, 2023
9a19456
Merge branch 'branch-23.04' into faiss_largek
cjnolet Feb 18, 2023
c39dc65
style
benfred Feb 18, 2023
c60e17f
Merge branch 'faiss_largek' of github.com:benfred/raft into faiss_largek
benfred Feb 18, 2023
2752294
code review suggestions
benfred Feb 18, 2023
84f7a42
Merge remote-tracking branch 'bf/faiss_largek' into bfknn
benfred Feb 18, 2023
901b898
Merge branch 'branch-23.04' into bfknn
cjnolet Feb 20, 2023
1548a78
Remove ENABLE_NN_DEPENDENCIES option
benfred Feb 21, 2023
3fdc712
Merge branch 'branch-23.04' into bfknn
benfred Feb 21, 2023
642f87d
Adding brute-force knn api to pylibraft
cjnolet Feb 21, 2023
1ac42af
Merge branch 'branch-23.04' into fea-2304-bfknn
cjnolet Feb 21, 2023
31c9cf2
temporarily re-add faiss build targets
benfred Feb 21, 2023
f7fd6a7
couple more files to re-add faiss
benfred Feb 21, 2023
37d66d2
re-add faiss_mr
benfred Feb 22, 2023
a61c92f
explicitly include faiss_mr
benfred Feb 23, 2023
dbd31b2
Allow col_major input to bfknn
benfred Feb 24, 2023
fddecc3
fix faiss queryempty test
benfred Feb 24, 2023
4687144
exclude LP from fused
benfred Feb 27, 2023
bd3ff51
Merge branch 'branch-23.04' into bfknn
benfred Feb 27, 2023
06c8674
use metric processor for cosine/correlation
benfred Feb 27, 2023
b44d15c
exclude cosine
benfred Feb 28, 2023
5a582cd
Merge branch 'branch-23.04' into bfknn
benfred Mar 1, 2023
eb0271a
avoid l2expanded distance
benfred Mar 1, 2023
616455c
Merge branch 'bfknn' of github.com:benfred/raft into bfknn
benfred Mar 1, 2023
4c41c63
Expanded L2 Changes
benfred Mar 6, 2023
cdf1962
correct for small instabilities in l2sqrtexpanded distance
benfred Mar 7, 2023
6a1e2d8
warp divergence
benfred Mar 7, 2023
1e2817c
clamp to 0
benfred Mar 7, 2023
4b56fac
threshold
benfred Mar 7, 2023
4b41e2c
Transpose for fusedl2knn as well
benfred Mar 8, 2023
455c952
fix
benfred Mar 8, 2023
df46b65
Fix stream handling on col-major inputs
benfred Mar 8, 2023
97a3c01
Merge branch 'bfknn' of github.com:benfred/raft into bfknn
benfred Mar 8, 2023
105bc96
Merge branch 'branch-23.04' into bfknn
benfred Mar 9, 2023
2828c3b
Merge branch 'branch-23.04' into bfknn
benfred Mar 9, 2023
6e45267
Merge branch 'branch-23.04' into bfknn
benfred Mar 11, 2023
f426510
Merge branch 'branch-23.04' into fea-2304-bfknn
benfred Mar 11, 2023
754ab9a
Merge remote-tracking branch 'ben/bfknn' into fea-2304-bfknn
cjnolet Mar 11, 2023
a35ec7b
Including specializations in bfknn runtime API
cjnolet Mar 11, 2023
63cf2ac
Start of PoC to remove NN lib
cjnolet Mar 11, 2023
2a7ff38
Removing faiss fully
cjnolet Mar 11, 2023
1280fb5
Removing pinned subpackage libraft-nn
cjnolet Mar 11, 2023
7f22d7f
Updating readme
cjnolet Mar 11, 2023
655e4db
libraft-distance -> libraft and raft::distance -> raft::compiled
cjnolet Mar 11, 2023
b6bd58e
Updating docs
cjnolet Mar 11, 2023
bc6938d
Fixing ci/* scripts
cjnolet Mar 11, 2023
0893d69
Removing raft::distance from remaining pylibraft cmakelists
cjnolet Mar 11, 2023
7c4f6c1
Unhooking brute_force from the ubild for now
cjnolet Mar 11, 2023
babd187
Changing all the compile conditionals in bench and test
cjnolet Mar 12, 2023
a936fe3
Exporting cutlass through raft-exports instead of just the compiled lib
cjnolet Mar 12, 2023
d9e8f62
Removing some more old and unsed cmake options
cjnolet Mar 12, 2023
8fa985c
Fixing typo
cjnolet Mar 12, 2023
7b4596b
Fixing build.sh
cjnolet Mar 12, 2023
420ca7c
Merge branch 'branch-23.04' into fea-2304-remove-nn-lib
cjnolet Mar 12, 2023
0127f99
Had one more to change
cjnolet Mar 12, 2023
ac74285
Merge branch 'fea-2304-remove-nn-lib' of github.com:cjnolet/raft into…
cjnolet Mar 12, 2023
d8e3191
Fixing build.sh
cjnolet Mar 12, 2023
5b4013f
Removing unneeded import
cjnolet Mar 12, 2023
28ebeef
fix build for missing symbols
benfred Mar 13, 2023
9917324
Merge branch 'branch-23.04' into bfknn
cjnolet Mar 13, 2023
65d7725
code review feedback
benfred Mar 14, 2023
e41ff88
matrix::fill and linalg::map_offset
benfred Mar 14, 2023
5eb7d22
build fix
benfred Mar 14, 2023
e36d089
fix
benfred Mar 14, 2023
50e366f
Merge branch 'branch-23.04' into bfknn
benfred Mar 14, 2023
bf6cdea
Small updates to docs
cjnolet Mar 14, 2023
e8f9c55
move faiss_select into raft::neighbors namespace
benfred Mar 14, 2023
a5d5865
Merge branch 'branch-23.04' into fea-2304-remove-nn-lib
cjnolet Mar 14, 2023
24004e3
Removing faiss from build
cjnolet Mar 14, 2023
6b01a17
Merge remote-tracking branch 'ben/bfknn' into build-2306-remove_faiss
cjnolet Mar 14, 2023
4d49ffd
Removing faissmr
cjnolet Mar 14, 2023
5ce9230
Removing faiss from docs
cjnolet Mar 14, 2023
6cf5c99
Merge branch 'build-2306-remove_faiss' into fea-2304-remove-nn-lib
cjnolet Mar 14, 2023
cc19b1b
Merge branch 'fea-2304-remove-nn-lib' of github.com:cjnolet/raft into…
cjnolet Mar 14, 2023
9f211a0
move knn_merge parts to its own file
benfred Mar 14, 2023
be4ca13
Removing faiss from conda recipe and dev env
cjnolet Mar 14, 2023
6b10ba6
Fixing typo
cjnolet Mar 14, 2023
9cbac3c
Merge branch 'branch-23.04' into bfknn
cjnolet Mar 14, 2023
0667526
Merge remote-tracking branch 'origin/branch-23.04' into bfknn
benfred Mar 15, 2023
9593ae1
Use stream pool
benfred Mar 15, 2023
76d2b19
Merge branch 'bfknn' of github.com:benfred/raft into bfknn
benfred Mar 15, 2023
01fb23b
Merge remote-tracking branch 'ben/bfknn' into build-2306-remove_faiss
cjnolet Mar 15, 2023
33dcc4a
Merge branch 'build-2306-remove_faiss' into fea-2304-remove-nn-lib
cjnolet Mar 15, 2023
d5debc7
Merge branch 'branch-23.04' into build-2306-remove_faiss
cjnolet Mar 17, 2023
364dbd9
Merge branch 'build-2306-remove_faiss' into fea-2304-remove-nn-lib
cjnolet Mar 17, 2023
ebf7619
Adding raft.png
cjnolet Mar 17, 2023
44aa123
Adding raft.png
cjnolet Mar 17, 2023
65f6b05
Adding smaller image
cjnolet Mar 17, 2023
7cbd8f3
Trying a slightly larger version
cjnolet Mar 17, 2023
c66ecc0
making a little larger
cjnolet Mar 17, 2023
85d3159
Merge remote-tracking branch 'rapidsai/branch-23.04' into fea-2304-re…
cjnolet Mar 18, 2023
9ec9a9d
Merge branch 'doc-2304_readme_image' into fea-2304-remove-nn-lib
cjnolet Mar 18, 2023
febedc8
Smaller raft.png
cjnolet Mar 18, 2023
8d1169f
Merge branch 'doc-2304-doc_updates' into fea-2304-remove-nn-lib
cjnolet Mar 18, 2023
3d99afd
Using proper raft image
cjnolet Mar 18, 2023
4b8b2c9
Merge branch 'branch-23.04' into doc-2304_readme_image
cjnolet Mar 18, 2023
75b0d42
Revert "Using proper raft image"
cjnolet Mar 18, 2023
a42af6d
Revert "Smaller raft.png"
cjnolet Mar 18, 2023
184c37c
Removing raft image commits for now. e can add it back in later if we…
cjnolet Mar 18, 2023
06e9912
Reverting change
cjnolet Mar 18, 2023
774c680
Merge branch 'doc-2304_readme_image' of github.com:cjnolet/raft into …
cjnolet Mar 18, 2023
3d7716f
Touching file skip-checks:true
cjnolet Mar 18, 2023
5f45e1d
Trying to [skip ci]
cjnolet Mar 18, 2023
1f611cd
Re-enabling CI
cjnolet Mar 18, 2023
830e885
Merge branch 'doc-2304_readme_image' into fea-2304-remove-nn-lib
cjnolet Mar 18, 2023
8bb6024
Changing ivf-flat cython to use raft::compiled
cjnolet Mar 19, 2023
b669f5d
Merge branch 'branch-23.04' into fea-2304-remove-nn-lib
cjnolet Mar 20, 2023
cb79db8
Removing unneeded conditional in cmakelists
cjnolet Mar 20, 2023
9be33d9
Merge branch 'fea-2304-remove-nn-lib' of github.com:cjnolet/raft into…
cjnolet Mar 20, 2023
c60c0cb
Removing brute-force python files for now.
cjnolet Mar 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/>&nbsp;RAFT: Reusable Accelerated Functions and Tools</div>


![Navigating the canyons of accelerated possibilities](img/raft.png)

## Resources

- [RAFT Reference Documentation](https://docs.rapids.ai/api/raft/stable/): API Documentation.
Expand Down Expand Up @@ -192,8 +195,7 @@ RAFT itself can be installed through conda, [CMake Package Manager (CPM)](https:

The easiest way to install RAFT is through conda and several packages are provided.
- `libraft-headers` RAFT headers
- `libraft-nn` (optional) contains shared libraries for the nearest neighbors primitives.
- `libraft-distance` (optional) contains shared libraries for distance primitives.
- `libraft` (optional) shared library of pre-compiled template specializations and runtime APIs.
- `pylibraft` (optional) Python wrappers around RAFT algorithms and primitives.
- `raft-dask` (optional) enables deployment of multi-node multi-GPU algorithms that use RAFT `raft::comms` in Dask clusters.

Expand All @@ -202,9 +204,9 @@ Use the following command to install all of the RAFT packages with conda (replac
mamba install -c rapidsai -c conda-forge -c nvidia raft-dask pylibraft
```

You can also install the `libraft-*` conda packages individually using the `mamba` command above.
You can also install the conda packages individually using the `mamba` command above.

After installing RAFT, `find_package(raft COMPONENTS nn distance)` can be used in your CUDA/C++ cmake build to compile and/or link against needed dependencies in your raft target. `COMPONENTS` are optional and will depend on the packages installed.
After installing RAFT, `find_package(raft COMPONENTS compiled distributed)` can be used in your CUDA/C++ cmake build to compile and/or link against needed dependencies in your raft target. `COMPONENTS` are optional and will depend on the packages installed.

### Pip

Expand Down Expand Up @@ -263,12 +265,11 @@ find_and_configure_raft(VERSION ${RAFT_VERSION}.00

Several CMake targets can be made available by adding components in the table below to the `RAFT_COMPONENTS` list above, separated by spaces. The `raft::raft` target will always be available. RAFT headers require, at a minimum, the CUDA toolkit libraries and RMM dependencies.

| Component | Target | Description | Base Dependencies |
| --- | --- | --- |------------------------------------------------------------------|
| n/a | `raft::raft` | Full RAFT header library | CUDA toolkit library, RMM, Thrust (optional), NVTools (optional) |
| distance | `raft::distance` | Pre-compiled template specializations for raft::distance | raft::raft, cuCollections (optional) |
| nn | `raft::nn` | Pre-compiled template specializations for raft::neighbors | raft::raft |
| distributed | `raft::distributed` | No specializations | raft::raft, UCX, NCCL |
| Component | Target | Description | Base Dependencies |
|-------------|---------------------|-----------------------------------------------------------|---------------------------------------|
| n/a | `raft::raft` | Full RAFT header library | CUDA toolkit, RMM, NVTX, CCCL, CUTLASS |
| compiled | `raft::compiled` | Pre-compiled template specializations and runtime library | raft::raft |
| distributed | `raft::distributed` | Dependencies for `raft::comms` APIs | raft::raft, UCX, NCCL |

### Source

Expand All @@ -279,7 +280,7 @@ mamba env create --name raft_dev_env -f conda/environments/all_cuda-118_arch-x86
mamba activate raft_dev_env
```
```
./build.sh raft-dask pylibraft libraft tests bench --compile-libs
./build.sh raft-dask pylibraft libraft tests bench --compile-lib
```

The [build](docs/source/build.md) instructions contain more details on building RAFT from source and including it in downstream projects. You can also find a more comprehensive version of the above CPM code snippet the [Building RAFT C++ from source](docs/source/build.md#building-raft-c-from-source-in-cmake) section of the build instructions.
Expand Down
79 changes: 20 additions & 59 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ARGS=$*
# script, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean libraft pylibraft raft-dask docs tests bench clean --uninstall -v -g -n --compile-libs --compile-nn --compile-dist --allgpuarch --no-nvtx --show_depr_warn -h --minimal-deps"
VALIDARGS="clean libraft pylibraft raft-dask docs tests bench clean --uninstall -v -g -n --compile-lib --allgpuarch --no-nvtx --show_depr_warn -h"
cjnolet marked this conversation as resolved.
Show resolved Hide resolved
HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<tool>] [--limit-tests=<targets>] [--limit-bench=<targets>]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
Expand All @@ -35,12 +35,7 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
-g - build for debug
-n - no install step
--uninstall - uninstall files for specified targets which were built and installed prior
--compile-libs - compile shared libraries for all components
--compile-nn - compile shared library for nn component
--compile-dist - compile shared library for distance and current random components
(eventually, this will be renamed to something more generic and
the only option to be supported)
--minimal-deps - disables dependencies like thrust so they can be overridden.
--compile-lib - compile shared libraries for all components
can be useful for a pure header-only install
--limit-tests - semicolon-separated list of test executables to compile (e.g. NEIGHBORS_TEST;CLUSTER_TEST)
--limit-bench - semicolon-separated list of benchmark executables to compute (e.g. NEIGHBORS_BENCH;CLUSTER_BENCH)
Expand Down Expand Up @@ -68,14 +63,11 @@ BUILD_ALL_GPU_ARCH=0
BUILD_TESTS=OFF
BUILD_TYPE=Release
BUILD_BENCH=OFF
COMPILE_LIBRARIES=OFF
COMPILE_NN_LIBRARY=OFF
COMPILE_DIST_LIBRARY=OFF
COMPILE_LIBRARY=OFF
INSTALL_TARGET=install

TEST_TARGETS="CLUSTER_TEST;CORE_TEST;DISTANCE_TEST;LABEL_TEST;LINALG_TEST;MATRIX_TEST;RANDOM_TEST;SOLVERS_TEST;SPARSE_TEST;SPARSE_DIST_TEST;SPARSE_NEIGHBORS_TEST;NEIGHBORS_TEST;STATS_TEST;UTILS_TEST"
BENCH_TARGETS="CLUSTER_BENCH;NEIGHBORS_BENCH;DISTANCE_BENCH;LINALG_BENCH;MATRIX_BENCH;SPARSE_BENCH;RANDOM_BENCH"
ENABLE_thrust_DEPENDENCY=ON

CACHE_ARGS=""
NVTX=ON
Expand Down Expand Up @@ -254,10 +246,6 @@ if hasArg -n; then
INSTALL_TARGET=""
fi

if hasArg --minimal-deps; then
ENABLE_thrust_DEPENDENCY=OFF
fi

if hasArg -v; then
VERBOSE_FLAG="-v"
CMAKE_LOG_LEVEL="VERBOSE"
Expand All @@ -270,64 +258,38 @@ if hasArg --allgpuarch; then
BUILD_ALL_GPU_ARCH=1
fi

if hasArg --compile-libs || (( ${NUMARGS} == 0 )); then
COMPILE_LIBRARIES=ON
fi

if hasArg --compile-nn || hasArg --compile-libs || (( ${NUMARGS} == 0 )); then
COMPILE_NN_LIBRARY=ON
CMAKE_TARGET="${CMAKE_TARGET};raft_nn_lib"
fi

if hasArg --compile-dist || hasArg --compile-libs || (( ${NUMARGS} == 0 )); then
COMPILE_DIST_LIBRARY=ON
CMAKE_TARGET="${CMAKE_TARGET};raft_distance_lib"
if hasArg --compile-lib || (( ${NUMARGS} == 0 )); then
COMPILE_LIBRARY=ON
CMAKE_TARGET="${CMAKE_TARGET};raft_lib"
fi

if hasArg tests || (( ${NUMARGS} == 0 )); then
BUILD_TESTS=ON
CMAKE_TARGET="${CMAKE_TARGET};${TEST_TARGETS}"

# Force compile nn library when needed test targets are specified
if [[ $CMAKE_TARGET == *"CLUSTER_TEST"* || \
$CMAKE_TARGET == *"SPARSE_DIST_TEST"* || \
$CMAKE_TARGET == *"SPARSE_NEIGHBORS_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_TEST"* || \
$CMAKE_TARGET == *"STATS_TEST"* ]]; then
echo "-- Enabling nearest neighbors lib for gtests"
COMPILE_NN_LIBRARY=ON
fi

# Force compile distance library when needed test targets are specified
# Force compile library when needed test targets are specified
if [[ $CMAKE_TARGET == *"CLUSTER_TEST"* || \
$CMAKE_TARGET == *"DISTANCE_TEST"* || \
$CMAKE_TARGET == *"SPARSE_DIST_TEST" || \
$CMAKE_TARGET == *"SPARSE_NEIGHBORS_TEST"* || \
$CMAKE_TARGET == *"MATRIX_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_TEST" || \
$CMAKE_TARGET == *"STATS_TEST"* ]]; then
echo "-- Enabling distance lib for gtests"
COMPILE_DIST_LIBRARY=ON
echo "-- Enabling compiled lib for gtests"
COMPILE_LIBRARY=ON
fi
fi

if hasArg bench || (( ${NUMARGS} == 0 )); then
BUILD_BENCH=ON
CMAKE_TARGET="${CMAKE_TARGET};${BENCH_TARGETS}"

# Force compile nn library when needed benchmark targets are specified
if [[ $CMAKE_TARGET == *"CLUSTER_BENCH"* || \
$CMAKE_TARGET == *"NEIGHBORS_BENCH"* ]]; then
echo "-- Enabling nearest neighbors lib for benchmarks"
COMPILE_NN_LIBRARY=ON
fi

# Force compile distance library when needed benchmark targets are specified
# Force compile library when needed benchmark targets are specified
if [[ $CMAKE_TARGET == *"CLUSTER_BENCH"* || \
$CMAKE_TARGET == *"MATRIX_BENCH"* || \
$CMAKE_TARGET == *"NEIGHBORS_BENCH"* ]]; then
echo "-- Enabling distance lib for benchmarks"
COMPILE_DIST_LIBRARY=ON
echo "-- Enabling compiled lib for benchmarks"
COMPILE_LIBRARY=ON
fi

fi
Expand Down Expand Up @@ -398,9 +360,7 @@ if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg docs || hasArg tests || has
-DBUILD_TESTS=${BUILD_TESTS} \
-DBUILD_BENCH=${BUILD_BENCH} \
-DCMAKE_MESSAGE_LOG_LEVEL=${CMAKE_LOG_LEVEL} \
-DRAFT_COMPILE_NN_LIBRARY=${COMPILE_NN_LIBRARY} \
-DRAFT_COMPILE_DIST_LIBRARY=${COMPILE_DIST_LIBRARY} \
-DRAFT_ENABLE_thrust_DEPENDENCY=${ENABLE_thrust_DEPENDENCY} \
-DRAFT_COMPILE_LIBRARY=${COMPILE_LIBRARY} \
${CACHE_ARGS} \
${EXTRA_CMAKE_ARGS}

Expand All @@ -414,34 +374,35 @@ if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg docs || hasArg tests || has
fi
fi

# Build and (optionally) install the raft-dask Python package
if (( ${NUMARGS} == 0 )) || hasArg raft-dask; then
# Build and (optionally) install the pylibraft Python package
if (( ${NUMARGS} == 0 )) || hasArg pylibraft; then
# Append `-DFIND_RAFT_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_RAFT_CPP"* ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_RAFT_CPP=ON"
fi

cd ${REPODIR}/python/raft-dask
cd ${REPODIR}/python/pylibraft
python setup.py build_ext --inplace -- -DCMAKE_PREFIX_PATH="${RAFT_DASK_BUILD_DIR};${INSTALL_PREFIX}" -DCMAKE_LIBRARY_PATH=${LIBRAFT_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1}
if [[ ${INSTALL_TARGET} != "" ]]; then
python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} ${EXTRA_CMAKE_ARGS}
fi
fi

# Build and (optionally) install the pylibraft Python package
if (( ${NUMARGS} == 0 )) || hasArg pylibraft; then
# Build and (optionally) install the raft-dask Python package
if (( ${NUMARGS} == 0 )) || hasArg raft-dask; then
# Append `-DFIND_RAFT_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_RAFT_CPP"* ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_RAFT_CPP=ON"
fi

cd ${REPODIR}/python/pylibraft
cd ${REPODIR}/python/raft-dask
python setup.py build_ext --inplace -- -DCMAKE_PREFIX_PATH="${RAFT_DASK_BUILD_DIR};${INSTALL_PREFIX}" -DCMAKE_LIBRARY_PATH=${LIBRAFT_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1}
if [[ ${INSTALL_TARGET} != "" ]]; then
python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} ${EXTRA_CMAKE_ARGS}
fi
fi


if hasArg docs; then
set -x
cd ${DOXYGEN_BUILD_DIR}
Expand Down
3 changes: 1 addition & 2 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ VERSION_NUMBER=$(rapids-get-rapids-version-from-git)
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
libraft-distance \
libraft \
libraft-headers \
libraft-nn \
pylibraft \
raft-dask

Expand Down
2 changes: 1 addition & 1 deletion ci/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ rapids-print-env

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libraft-headers libraft-distance libraft-nn libraft-tests
libraft-headers libraft libraft-tests

rapids-logger "Check GPU usage"
nvidia-smi
Expand Down
2 changes: 1 addition & 1 deletion ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rapids-print-env
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
libraft-distance libraft-headers pylibraft raft-dask
libraft libraft-headers pylibraft raft-dask

rapids-logger "Check GPU usage"
nvidia-smi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

./build.sh libraft --allgpuarch --compile-nn --no-nvtx
./build.sh libraft --allgpuarch --compile-lib --no-nvtx
4 changes: 0 additions & 4 deletions conda/recipes/libraft/build_libraft_distance.sh

This file was deleted.

47 changes: 5 additions & 42 deletions conda/recipes/libraft/meta.yaml
cjnolet marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ outputs:
home: https://rapids.ai/
license: Apache-2.0
summary: libraft-headers library
- name: libraft-distance
- name: libraft
version: {{ version }}
script: build_libraft_distance.sh
script: build_libraft.sh
build:
script_env: *script_env
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down Expand Up @@ -109,42 +109,7 @@ outputs:
about:
home: https://rapids.ai/
license: Apache-2.0
summary: libraft-distance library
- name: libraft-nn
version: {{ version }}
script: build_libraft_nn.sh
build:
script_env: *script_env
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
- {{ compiler('cuda') }}
requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- {{ compiler('cxx') }}
- cmake {{ cmake_version }}
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- {{ pin_subpackage('libraft-headers', exact=True) }}
- cuda-profiler-api {{ cuda_profiler_api_host_version }}
- lapack
- libcublas {{ libcublas_host_version }}
- libcublas-dev {{ libcublas_host_version }}
- libcurand {{ libcurand_host_version }}
- libcurand-dev {{ libcurand_host_version }}
- libcusolver {{ libcusolver_host_version }}
- libcusolver-dev {{ libcusolver_host_version }}
- libcusparse {{ libcusparse_host_version }}
- libcusparse-dev {{ libcusparse_host_version }}
run:
- {{ pin_subpackage('libraft-headers', exact=True) }}
about:
home: https://rapids.ai/
license: Apache-2.0
summary: libraft-nn library
summary: libraft library
- name: libraft-tests
version: {{ version }}
script: build_libraft_tests.sh
Expand All @@ -163,9 +128,8 @@ outputs:
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- {{ pin_subpackage('libraft-distance', exact=True) }}
- {{ pin_subpackage('libraft', exact=True) }}
- {{ pin_subpackage('libraft-headers', exact=True) }}
- {{ pin_subpackage('libraft-nn', exact=True) }}
- cuda-profiler-api {{ cuda_profiler_api_host_version }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
Expand All @@ -178,9 +142,8 @@ outputs:
- libcusparse {{ libcusparse_host_version }}
- libcusparse-dev {{ libcusparse_host_version }}
run:
- {{ pin_subpackage('libraft-distance', exact=True) }}
- {{ pin_subpackage('libraft', exact=True) }}
- {{ pin_subpackage('libraft-headers', exact=True) }}
- {{ pin_subpackage('libraft-nn', exact=True) }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
about:
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/pylibraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ requirements:
- cuda-python >=11.7.1,<12.0
- cudatoolkit ={{ cuda_version }}
- cython >=0.29,<0.30
- libraft-distance {{ version }}
- libraft {{ version }}
- libraft-headers {{ version }}
- python x.x
- rmm ={{ minor_version }}
Expand All @@ -43,7 +43,7 @@ requirements:
run:
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
- cuda-python >=11.7.1,<12.0
- libraft-distance {{ version }}
- libraft {{ version }}
- libraft-headers {{ version }}
- python x.x

Expand Down
Loading