Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cpp/src/neighbors/detail/cagra/cagra_build.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,12 @@ index<T, IdxT> build(
RAFT_LOG_DEBUG("Insufficient GPU memory to construct CAGRA index with dataset on GPU");
// We just add the graph. User is expected to update dataset separately (e.g allocating in
// managed memory).
index<T, IdxT> idx(res, params.metric);
idx.update_graph(res, raft::make_const_mdspan(cagra_graph.view()));
return idx;
} catch (raft::logic_error& e) {
// The memory error can also manifest as logic_error.
RAFT_LOG_DEBUG("Insufficient GPU memory to construct CAGRA index with dataset on GPU");
}
index<T, IdxT> idx(res, params.metric);
idx.update_graph(res, raft::make_const_mdspan(cagra_graph.view()));
return idx;
}
} // namespace cuvs::neighbors::cagra::detail
4 changes: 4 additions & 0 deletions cpp/src/neighbors/nn_descent.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cuvs/neighbors/nn_descent.hpp>
#include <raft/core/logger.hpp>

using namespace raft;
namespace cuvs::neighbors::nn_descent {

/**
Expand Down Expand Up @@ -53,6 +54,9 @@ bool has_enough_device_memory(raft::resources const& res,
} catch (std::bad_alloc& e) {
RAFT_LOG_DEBUG("Insufficient memory for NN descent");
return false;
} catch (raft::logic_error& e) {
RAFT_LOG_DEBUG("Insufficient memory for NN descent (logic error)");
return false;
}
}

Expand Down