Skip to content

Commit b859bc5

Browse files
authored
Fix cagra::extend error message (#532)
When extending a CAGRA index that is built with `index_param.attach_dataset_on_build = false`, an error message "Only uncompressed dataset is supported" is displayed even if the dataset used to build the graph is not compressed. This problem occurs since the extend function does not check whether the dataset is empty. This PR fixes it. Authors: - tsuki (https://github.com/enp1s0) Approvers: - Artem M. Chirkin (https://github.com/achirkin) URL: #532
1 parent ef16a9e commit b859bc5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,14 @@ void extend_core(
432432
} else {
433433
index.update_graph(handle, raft::make_const_mdspan(updated_graph.view()));
434434
}
435+
} else if (dynamic_cast<const cuvs::neighbors::empty_dataset<int64_t>*>(&index.data()) !=
436+
nullptr) {
437+
RAFT_FAIL(
438+
"cagra::extend only supports an index to which the dataset is attached. Please check if the "
439+
"index was built with index_param.attach_dataset_on_build = true, or if a dataset was "
440+
"attached after the build.");
435441
} else {
436-
RAFT_FAIL("Only uncompressed dataset is supported");
442+
RAFT_FAIL("cagra::extend only supports an uncompressed dataset index");
437443
}
438444
}
439445
} // namespace cuvs::neighbors::cagra

0 commit comments

Comments
 (0)