Skip to content

Commit

Permalink
IVF-Flat bug fix: the *squared* norm is required for expanded distanc…
Browse files Browse the repository at this point in the history
…e calculations (#1141)

Authors:
  - Louis Sugy (https://github.com/Nyrio)
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Artem M. Chirkin (https://github.com/achirkin)
  - Tamas Bela Feher (https://github.com/tfeher)

URL: #1141
  • Loading branch information
Nyrio authored Jan 13, 2023
1 parent 7e5ce78 commit dde7c53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cpp/include/raft/spatial/knn/detail/ivf_flat_build.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ inline auto extend(const handle_t& handle,
n_lists,
raft::linalg::L2Norm,
true,
stream,
raft::sqrt_op());
stream);
RAFT_LOG_TRACE_VEC(ext_index.center_norms()->data_handle(), std::min<uint32_t>(dim, 20));
}
}
Expand Down
3 changes: 1 addition & 2 deletions cpp/include/raft/spatial/knn/detail/ivf_pq_build.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1294,8 +1294,7 @@ auto build(
index.n_lists(),
raft::linalg::L2Norm,
true,
stream,
raft::sqrt_op());
stream);
RAFT_CUDA_TRY(cudaMemcpy2DAsync(index.centers().data_handle() + index.dim(),
sizeof(float) * index.dim_ext(),
center_norms.data(),
Expand Down

0 comments on commit dde7c53

Please sign in to comment.