Skip to content

Commit 7311ade

Browse files
authored
Merge pull request #1982 from rapidsai/release/26.04
Forward-merge release/26.04 into main
2 parents f8d3e7b + d6e6a50 commit 7311ade

22 files changed

Lines changed: 90 additions & 73 deletions

c/include/cuvs/neighbors/all_neighbors.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -17,7 +17,7 @@ extern "C" {
1717
#endif
1818

1919
/**
20-
* @defgroup all_neighbors_c_build All-neighbors C-API build
20+
* @defgroup all_neighbors_c_params All-neighbors C-API build parameters
2121
* @{
2222
*
2323
* All-neighbors constructs an approximate k-NN graph for all vectors in a dataset.
@@ -78,6 +78,13 @@ cuvsError_t cuvsAllNeighborsIndexParamsCreate(cuvsAllNeighborsIndexParams_t* ind
7878
*/
7979
cuvsError_t cuvsAllNeighborsIndexParamsDestroy(cuvsAllNeighborsIndexParams_t index_params);
8080

81+
/** @} */
82+
83+
/**
84+
* @defgroup all_neighbors_c_build All-neighbors C-API build
85+
* @{
86+
*/
87+
8188
/**
8289
* @brief Build an all-neighbors k-NN graph automatically detecting host vs device dataset.
8390
*

cpp/include/cuvs/cluster/kmeans.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,15 +1573,14 @@ void cluster_cost(
15731573
* @}
15741574
*/
15751575

1576+
namespace helpers {
15761577
/**
15771578
* @defgroup kmeans_helpers k-means API helpers
15781579
* @{
15791580
*/
15801581

1581-
namespace helpers {
1582-
15831582
/**
1584-
* Automatically find the optimal value of k using a binary search.
1583+
* @brief Automatically find the optimal value of k using a binary search.
15851584
* This method maximizes the Calinski-Harabasz Index while minimizing the per-cluster inertia.
15861585
*
15871586
* @code{.cpp}
@@ -1626,10 +1625,9 @@ void find_k(raft::resources const& handle,
16261625
int kmin = 1,
16271626
int maxiter = 100,
16281627
float tol = 1e-3);
1629-
} // namespace helpers
1630-
16311628
/**
16321629
* @}
16331630
*/
1631+
} // namespace helpers
16341632

16351633
} // namespace cuvs::cluster::kmeans

cpp/include/cuvs/preprocessing/quantize/binary.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -30,11 +30,10 @@ enum class bit_threshold { zero, mean, sampling_median };
3030
* @brief quantizer parameters.
3131
*/
3232
struct params {
33+
/** Threshold method for binarization. */
3334
bit_threshold threshold = bit_threshold::mean;
3435

35-
/*
36-
* specifies the sampling ratio
37-
*/
36+
/** Specifies the sampling ratio. */
3837
float sampling_ratio = 0.1;
3938
};
4039

@@ -48,8 +47,10 @@ struct params {
4847
*/
4948
template <typename T>
5049
struct quantizer {
50+
/** Threshold vector used for binarization. */
5151
raft::device_vector<T, int64_t> threshold;
5252

53+
/** @brief Construct a quantizer with an empty threshold vector. */
5354
quantizer(raft::resources const& res) : threshold(raft::make_device_vector<T, int64_t>(res, 0)) {}
5455
};
5556

cpp/include/cuvs/preprocessing/quantize/pq.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ struct params {
8484
*/
8585
template <typename T>
8686
struct quantizer {
87+
/** Parameters used to build this quantizer. */
8788
params params_quantizer;
89+
/** VPQ codebooks produced during training. */
8890
cuvs::neighbors::vpq_dataset<T, int64_t> vpq_codebooks;
8991
};
9092

cpp/include/cuvs/preprocessing/quantize/scalar.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -24,9 +24,9 @@ namespace cuvs::preprocessing::quantize::scalar {
2424
* @brief quantizer parameters.
2525
*/
2626
struct params {
27-
/*
28-
* specifies how many outliers at top & bottom will be ignored
29-
* needs to be within range of (0, 1]
27+
/**
28+
* Specifies how many outliers at top & bottom will be ignored.
29+
* Needs to be within range of (0, 1].
3030
*/
3131
float quantile = 0.99;
3232
};
@@ -42,7 +42,9 @@ struct params {
4242
*/
4343
template <typename T>
4444
struct quantizer {
45+
/** Minimum value of the quantization range. */
4546
T min_;
47+
/** Maximum value of the quantization range. */
4648
T max_;
4749
};
4850

docs/source/c_api/neighbors.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Nearest Neighbors
99
:maxdepth: 2
1010
:caption: Contents:
1111

12+
neighbors_all_neighbors_c.rst
1213
neighbors_bruteforce_c.rst
13-
neighbors_ivf_flat_c.rst
14-
neighbors_ivf_pq_c.rst
1514
neighbors_cagra_c.rst
1615
neighbors_hnsw_c.rst
16+
neighbors_ivf_flat_c.rst
17+
neighbors_ivf_pq_c.rst
1718
neighbors_mg.rst
18-
neighbors_all_neighbors_c.rst
1919
neighbors_vamana_c.rst

docs/source/c_api/neighbors_all_neighbors_c.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ The all-neighbors method constructs a k-NN graph for all vectors in a dataset. I
99

1010
``#include <cuvs/neighbors/all_neighbors.h>``
1111

12+
Build parameters
13+
----------------
14+
15+
.. doxygengroup:: all_neighbors_c_params
16+
:project: cuvs
17+
:members:
18+
:content-only:
19+
1220
Build
1321
-----
1422

docs/source/cpp_api/cluster.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Cluster
99
:maxdepth: 2
1010
:caption: Contents:
1111

12-
cluster_kmeans.rst
1312
cluster_agglomerative.rst
13+
cluster_kmeans.rst
1414
cluster_spectral.rst

docs/source/cpp_api/cluster_agglomerative.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Agglomerative
55
:language: c++
66
:class: highlight
77

8-
Params
9-
------
8+
Parameters
9+
----------
1010

1111
``#include <cuvs/cluster/agglomerative.hpp>``
1212

@@ -18,10 +18,10 @@ namespace *cuvs::cluster::agglomerative*
1818
:content-only:
1919

2020

21-
Single-linkage
22-
--------------
21+
Agglomerative
22+
-------------
2323

24-
``include <cuvs/cluster/agglomerative.hpp>``
24+
``#include <cuvs/cluster/agglomerative.hpp>``
2525

2626
namespace *cuvs::cluster::agglomerative*
2727

docs/source/cpp_api/cluster_kmeans.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ K-Means
55
:language: c++
66
:class: highlight
77

8-
Params
9-
------
8+
Parameters
9+
----------
1010

1111
``#include <cuvs/cluster/kmeans.hpp>``
1212

@@ -21,7 +21,7 @@ namespace *cuvs::cluster::kmeans*
2121
K-means
2222
-------
2323

24-
``include <cuvs/cluster/kmeans.hpp>``
24+
``#include <cuvs/cluster/kmeans.hpp>``
2525

2626
namespace *cuvs::cluster::kmeans*
2727

@@ -34,7 +34,7 @@ namespace *cuvs::cluster::kmeans*
3434
K-means Helpers
3535
---------------
3636

37-
``include <cuvs/cluster/kmeans.hpp>``
37+
``#include <cuvs/cluster/kmeans.hpp>``
3838

3939
namespace *cuvs::cluster::kmeans::helpers*
4040

0 commit comments

Comments
 (0)