-
Notifications
You must be signed in to change notification settings - Fork 184
Use CCCL's mdspan implementation #1605
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
Changes from 14 commits
edd5450
59e50e2
7c5dd65
6ebd30e
9f58867
40fd155
4e04cab
a31db96
a6ae9c0
85df234
9ae4e44
8ed1af5
dd7bb3b
0f43b18
2a5a552
d383f48
9d6e674
e12b58e
9be7c01
0aa6f8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # download CI artifacts | ||
| LIBRAFT_CHANNEL=$(rapids-get-pr-artifact raft 2836 cpp conda) | ||
| PYLIBRAFT_CHANNEL=$(rapids-get-pr-artifact raft 2836 python conda) | ||
|
|
||
| # For `rattler` builds: | ||
| # | ||
| # Add these channels to the array checked by 'rapids-rattler-channel-string'. | ||
| # This ensures that when conda packages are built with strict channel priority enabled, | ||
| # the locally-downloaded packages will be preferred to remote packages (e.g. nightlies). | ||
| # | ||
| RAPIDS_PREPENDED_CONDA_CHANNELS=( | ||
| "${LIBRAFT_CHANNEL}" | ||
| "${PYLIBRAFT_CHANNEL}" | ||
| ) | ||
| export RAPIDS_PREPENDED_CONDA_CHANNELS | ||
|
|
||
| # For tests and `conda-build` builds: | ||
| # | ||
| # Add these channels to the system-wide conda configuration. | ||
| # This results in PREPENDING them to conda's channel list, so | ||
| # these packages should be found first if strict channel priority is enabled. | ||
| # | ||
| for _channel in "${RAPIDS_PREPENDED_CONDA_CHANNELS[@]}" | ||
| do | ||
| conda config --system --add channels "${_channel}" | ||
| done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # initialize PIP_CONSTRAINT | ||
| source rapids-init-pip | ||
|
|
||
| RAPIDS_PY_CUDA_SUFFIX=$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}") | ||
|
|
||
| # download wheels, store the directories holding them in variables | ||
| LIBRAFT_WHEELHOUSE=$( | ||
| RAPIDS_PY_WHEEL_NAME="libraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-artifact raft 2836 cpp wheel | ||
| ) | ||
| PYLIBRAFT_WHEELHOUSE=$( | ||
| RAPIDS_PY_WHEEL_NAME="pylibraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-artifact raft 2836 python wheel | ||
| ) | ||
| # write a pip constraints file saying e.g. "whenever you encounter a requirement for 'librmm-cu12', use this wheel" | ||
| cat > "${PIP_CONSTRAINT}" <<EOF | ||
| libraft-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo "${LIBRAFT_WHEELHOUSE}"/libraft_*.whl) | ||
| pylibraft-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo "${PYLIBRAFT_WHEELHOUSE}"/pylibraft_*.whl) | ||
| EOF |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -269,10 +269,8 @@ constexpr typename list_spec<SizeT, IdxT>::list_extents list_spec<SizeT, IdxT>:: | |||||
| { | ||||||
| // how many elems of pq_dim fit into one kIndexGroupVecLen-byte chunk | ||||||
| auto pq_chunk = (kIndexGroupVecLen * 8u) / pq_bits; | ||||||
| return raft::make_extents<SizeT>(raft::div_rounding_up_safe<SizeT>(n_rows, kIndexGroupSize), | ||||||
| raft::div_rounding_up_safe<SizeT>(pq_dim, pq_chunk), | ||||||
| kIndexGroupSize, | ||||||
| kIndexGroupVecLen); | ||||||
| return list_extents{raft::div_rounding_up_safe<SizeT>(n_rows, kIndexGroupSize), | ||||||
| raft::div_rounding_up_safe<SizeT>(pq_dim, pq_chunk)}; | ||||||
| } | ||||||
|
|
||||||
| template <typename IdxT, typename SizeT = uint32_t> | ||||||
|
|
@@ -335,8 +333,8 @@ struct index : cuvs::neighbors::index { | |||||
| static_assert(!raft::is_narrowing_v<uint32_t, IdxT>, | ||||||
| "IdxT must be able to represent all values of uint32_t"); | ||||||
|
|
||||||
| using pq_centers_extents = std::experimental:: | ||||||
| extents<uint32_t, raft::dynamic_extent, raft::dynamic_extent, raft::dynamic_extent>; | ||||||
| using pq_centers_extents = | ||||||
| raft::extents<uint32_t, raft::dynamic_extent, raft::dynamic_extent, raft::dynamic_extent>; | ||||||
|
|
||||||
| public: | ||||||
| index(const index&) = delete; | ||||||
|
|
@@ -2875,7 +2873,7 @@ void make_rotation_matrix(raft::resources const& res, | |||||
| */ | ||||||
| void set_centers(raft::resources const& res, | ||||||
| index<int64_t>* index, | ||||||
| raft::device_matrix_view<const float, uint32_t> cluster_centers); | ||||||
| raft::device_matrix_view<const float, int64_t> cluster_centers); | ||||||
|
|
||||||
| /** | ||||||
| * @brief Public helper API for fetching a trained index's IVF centroids | ||||||
|
|
@@ -2896,7 +2894,7 @@ void set_centers(raft::resources const& res, | |||||
| */ | ||||||
| void extract_centers(raft::resources const& res, | ||||||
| const index<int64_t>& index, | ||||||
| raft::device_matrix_view<float, uint32_t, raft::row_major> cluster_centers); | ||||||
| raft::device_matrix_view<float, int64_t, raft::row_major> cluster_centers); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might need to change the signatures of ivf-pq getters to int64_t instead of uint32_t, right? For example things like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you share a link reference?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes so we have cuvs/cpp/include/cuvs/neighbors/ivf_pq.hpp Line 406 in ba67db1
Do we want to change this signature to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In other words, what I am trying to say is that we might be considering an index-wide migration to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tfeher had made of aware of plans for this, but maybe that is outside the scope of this PR.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
cuvs/cpp/include/cuvs/neighbors/ivf_pq.hpp Line 501 in ba67db1
It should be returning |
||||||
|
|
||||||
| /** @copydoc extract_centers */ | ||||||
| void extract_centers(raft::resources const& res, | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.