Skip to content

Commit

Permalink
implement optimized nndescent in diskann
Browse files Browse the repository at this point in the history
Signed-off-by: jinjiabao.jjb <[email protected]>
  • Loading branch information
jinjiabao.jjb committed Jan 5, 2025
1 parent 545d7f7 commit efe77bb
Show file tree
Hide file tree
Showing 14 changed files with 813 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/cpp/custom_memory_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ main() {
// vsag::Options::Instance().logger()->SetLevel(vsag::Logger::kDEBUG);

ExampleAllocator allocator;
vsag::Resource resource(&allocator);
vsag::Resource resource(&allocator, nullptr);
vsag::Engine engine(&resource);

auto paramesters = R"(
Expand Down
6 changes: 6 additions & 0 deletions include/vsag/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ extern const char* const DISKANN_PARAMETER_USE_REFERENCE;
extern const char* const DISKANN_PARAMETER_USE_OPQ;
extern const char* const DISKANN_PARAMETER_USE_ASYNC_IO;
extern const char* const DISKANN_PARAMETER_USE_BSA;
extern const char* const DISKANN_PARAMETER_GRAPH_TYPE;
extern const char* const DISKANN_PARAMETER_ALPHA;
extern const char* const DISKANN_PARAMETER_TURN;
extern const char* const DISKANN_PARAMETER_SAMPLE_RATE;
extern const char* const DISKANN_GRAPH_TYPE_VAMANA;
extern const char* const DISKANN_GRAPH_TYPE_ODESCENT;

extern const char* const DISKANN_PARAMETER_BEAM_SEARCH;
extern const char* const DISKANN_PARAMETER_IO_LIMIT;
Expand Down
5 changes: 5 additions & 0 deletions src/allocator_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class AllocatorWrapper {
return allocator_ == other.allocator_;
}

bool
operator!=(const AllocatorWrapper& other) const noexcept {
return allocator_ != other.allocator_;
}

inline pointer
allocate(size_type n, const_void_pointer hint = 0) {
return static_cast<pointer>(allocator_->Allocate(n * sizeof(value_type)));
Expand Down
7 changes: 7 additions & 0 deletions src/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ const char* const DISKANN_PARAMETER_BEAM_SEARCH = "beam_search";
const char* const DISKANN_PARAMETER_IO_LIMIT = "io_limit";
const char* const DISKANN_PARAMETER_EF_SEARCH = "ef_search";
const char* const DISKANN_PARAMETER_REORDER = "use_reorder";
const char* const DISKANN_PARAMETER_GRAPH_TYPE = "graph_type";
const char* const DISKANN_PARAMETER_ALPHA = "alpha";
const char* const DISKANN_PARAMETER_TURN = "turn";
const char* const DISKANN_PARAMETER_SAMPLE_RATE = "sample_rate";

const char* const DISKANN_GRAPH_TYPE_VAMANA = "vamana";
const char* const DISKANN_GRAPH_TYPE_ODESCENT = "odescent";

const char* const HNSW_PARAMETER_EF_RUNTIME = "ef_search";
const char* const HNSW_PARAMETER_M = "max_degree";
Expand Down
Loading

0 comments on commit efe77bb

Please sign in to comment.