Commit b62b11a
authored
introduce libcuvs wheels (#594)
Contributes to rapidsai/build-planning#33.
Proposes packaging `libcuvs` as a wheel, which is then re-used by `cuvs-cu{11,12}`.
Similar changes were recently made in RAFT: rapidsai/raft#2531
As part of this, also proposes:
* introducing a new CMake option, `CUVS_COMPILE_DYNAMIC_ONLY`, to allow building/installing only the dynamic shared library (i.e. skipping the static library)
* enforcing `rapids-cmake`'s preferred CMake style (similar rapidsai/raft#2531 (comment))
* standardizing `clang` pins across the project, and pinning to `clang` 16 for Rust builds (#594 (comment))
## Notes for Reviewers
### Benefits of these changes
* smaller wheels for projects that depend on cuVS (they can dynamically link against `libcuvs` instead of statically linking in the pieces they need)
* fewer CI resources used for cuVS wheels (no more re-compiling for every Python minor version)
* faster, cheaper cuML wheel builds (rapidsai/cuml#6199 (comment))
* other benefits mentioned in rapidsai/build-planning#33
### Wheel contents
`libcuvs`:
* `libcuvs.so` and `libcuvs_c.so` (shared library)
* cuVS headers
* vendored dependencies (hnswlib)
`cuvs`:
* `cuvs` Python / Cython code and compiled Cython extensions
### Size changes (CUDA 12, Python 3.12, x86_64)
| wheel | num files (before) | num files (this PR) | size (before) | size (this PR) |
|:---------------:|------------------:|-----------------:|--------------:|---------------:|
| `libcuvs` | --- | 67 | --- | 843M |
| `cuvs` | 88 | 84 |845M | 2M |
|**TOTAL** | **88** | **131** | **845M** | **845M** |
*NOTES: size = compressed, "before" = 2025-01-22 nightlies*
<details><summary>how I calculated those (click me)</summary>
* nightly commit = rapidsai/cuml@7c715c4
* PR = this PR
```shell
docker run \
--rm \
--network host \
--env RAPIDS_NIGHTLY_DATE=2025-01-22 \
--env CUVS_NIGHTLY_SHA=f1de1b2 \
--env CUVS_PR="pull-request/594" \
--env CUVS_PR_SHA="97c56178cd0e07e4b6b138bb0904af78379f1bb3" \
--env RAPIDS_PY_CUDA_SUFFIX=cu12 \
--env WHEEL_DIR_BEFORE=/tmp/wheels-before \
--env WHEEL_DIR_AFTER=/tmp/wheels-after \
-it rapidsai/ci-wheel:cuda12.5.1-rockylinux8-py3.12 \
bash
# --- nightly wheels --- #
mkdir -p ./wheels-before
export RAPIDS_BUILD_TYPE=branch
export RAPIDS_REF_NAME="branch-25.02"
# cuvs
RAPIDS_PY_WHEEL_NAME="cuvs_${RAPIDS_PY_CUDA_SUFFIX}" \
RAPIDS_REPOSITORY=rapidsai/cuvs \
RAPIDS_SHA=${CUVS_NIGHTLY_SHA} \
rapids-download-wheels-from-s3 python ./wheels-before
# --- wheels from CI --- #
mkdir -p ./wheels-after
export RAPIDS_BUILD_TYPE="pull-request"
# libcuvs
RAPIDS_PY_WHEEL_NAME="libcuvs_${RAPIDS_PY_CUDA_SUFFIX}" \
RAPIDS_REPOSITORY=rapidsai/cuvs \
RAPIDS_REF_NAME="${CUVS_PR}" \
RAPIDS_SHA="${CUVS_PR_SHA}" \
rapids-download-wheels-from-s3 cpp ./wheels-after
# cuvs
RAPIDS_PY_WHEEL_NAME="cuvs_${RAPIDS_PY_CUDA_SUFFIX}" \
RAPIDS_REPOSITORY=rapidsai/cuvs \
RAPIDS_REF_NAME="${CUVS_PR}" \
RAPIDS_SHA="${CUVS_PR_SHA}" \
rapids-download-wheels-from-s3 python ./wheels-after
pip install pydistcheck
pydistcheck \
--inspect \
--select 'distro-too-large-compressed' \
./wheels-before/*.whl \
| grep -E '^checking|files: | compressed' \
> ./before.txt
# get more exact sizes
du -sh ./wheels-before/*
pydistcheck \
--inspect \
--select 'distro-too-large-compressed' \
./wheels-after/*.whl \
| grep -E '^checking|files: | compressed' \
> ./after.txt
# get more exact sizes
du -sh ./wheels-after/*
```
</details>
### How I tested this
* rapidsai/devcontainers#440
* rapidsai/cuml#6199
Authors:
- James Lamb (https://github.com/jameslamb)
Approvers:
- Bradley Dice (https://github.com/bdice)
- Ben Frederickson (https://github.com/benfred)
URL: #5941 parent 1c91e1f commit b62b11a
File tree
43 files changed
+653
-204
lines changed- .github/workflows
- ci
- release
- conda/environments
- cpp
- cmake/thirdparty
- examples/cpp
- python
- cuvs
- cuvs
- common
- distance
- neighbors
- brute_force
- cagra
- filters
- hnsw
- ivf_flat
- ivf_pq
- libcuvs
- libcuvs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
43 files changed
+653
-204
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
83 | 105 | | |
| 106 | + | |
84 | 107 | | |
85 | 108 | | |
86 | 109 | | |
| |||
99 | 122 | | |
100 | 123 | | |
101 | 124 | | |
| 125 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
142 | 152 | | |
143 | 153 | | |
144 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | 316 | | |
323 | 317 | | |
324 | 318 | | |
| |||
434 | 428 | | |
435 | 429 | | |
436 | 430 | | |
437 | | - | |
| 431 | + | |
438 | 432 | | |
439 | 433 | | |
440 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 8 | + | |
16 | 9 | | |
17 | | - | |
18 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
17 | 24 | | |
18 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
0 commit comments