Skip to content

Commit 00704c7

Browse files
huuanhhuynachirkin
andauthored
Apply suggestions from code review
Co-authored-by: Artem M. Chirkin <9253178+achirkin@users.noreply.github.com>
1 parent 07cd1be commit 00704c7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cpp/src/neighbors/detail/cagra/cagra_build.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ void build_knn_graph(
16721672
pq.search_params.coarse_search_dtype == CUDA_R_16F) {
16731673
{
16741674
const bool fp16_overflow = cuvs::neighbors::ivf_pq::helpers::detect_fp16_overflow(
1675-
res, index, pq.search_params, dataset, node_degree);
1675+
res, index, pq.search_params, dataset, node_degree + 1);
16761676
if (fp16_overflow) {
16771677
RAFT_LOG_WARN(
16781678
"IVF-PQ FP16 distance produced non-finite results on a probe search for this dataset -> "

cpp/src/neighbors/ivf_pq/ivf_pq_fp16_overflow.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool detect_fp16_overflow(
4444
const cuvs::neighbors::ivf_pq::index<int64_t>& index,
4545
cuvs::neighbors::ivf_pq::search_params search_params,
4646
raft::mdspan<const DataT, raft::matrix_extent<int64_t>, raft::row_major, Accessor> dataset,
47-
uint32_t node_degree)
47+
uint32_t k)
4848
{
4949
raft::common::nvtx::range<cuvs::common::nvtx::domain::cuvs> fun_scope("fp16_ovfl_detect");
5050
const int64_t n_rows = dataset.extent(0);
@@ -55,7 +55,7 @@ bool detect_fp16_overflow(
5555

5656
constexpr int64_t kMaxSampleQueries = 128;
5757
const int64_t n_sample = std::min<int64_t>(n_rows, kMaxSampleQueries);
58-
const uint32_t top_k = std::min<uint32_t>(static_cast<uint32_t>(n_rows), node_degree + 1);
58+
const uint32_t top_k = std::min<uint32_t>(static_cast<uint32_t>(n_rows), k);
5959

6060
auto mr = raft::resource::get_workspace_resource_ref(handle);
6161
auto queries =

0 commit comments

Comments
 (0)