-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce hgraph #114
base: main
Are you sure you want to change the base?
introduce hgraph #114
Conversation
LHT129
commented
Nov 4, 2024
- add basic implement for hgraph(hnswsq version)
- add one test for it
examples/cpp/example_hgraph.cpp
Outdated
std::cerr << "Failed to build index: internalError" << std::endl; | ||
exit(-1); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the search process and verify the result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete example. I will add new example use new params
examples/cpp/CMakeLists.txt
Outdated
@@ -21,3 +21,6 @@ target_link_libraries(custom_logger vsag) | |||
|
|||
add_executable (vsag_ext_example vsag_ext_example.cpp) | |||
target_link_libraries(vsag_ext_example vsag) | |||
|
|||
add_executable (example_hgraph example_hgraph.cpp) | |||
target_link_libraries(example_hgraph vsag -fopenmp gomp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you link the openmp here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
examples/cpp/example_hgraph.cpp
Outdated
#include <nlohmann/json.hpp> | ||
#include <random> | ||
|
||
#include "local_file_reader.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you include the file here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/factory/factory.cpp
Outdated
} else if (name == INDEX_HGRAPH) { | ||
auto json_param = nlohmann::json::parse(parameters); | ||
IndexCommonParam param; | ||
CHECK_ARGUMENT(json_param.contains(PARAMETER_METRIC_TYPE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use CHECK_ARGUMENT in parsing process rather than here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/factory/factory.cpp
Outdated
if (allocator != nullptr) { | ||
param.allocator_ = allocator; | ||
} else { | ||
param.allocator_ = new DefaultAllocator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace it with DefaultAllocator::Instance();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
if (!neighbors.empty()) { | ||
flatten->Prefetch(neighbors[0]); | ||
#ifdef USE_SSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between the flatten->Prefetch
and the following prefetch process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prefetch vec data, the following prefetch visit_list
@@ -58,6 +58,48 @@ main(int argc, char* argv[]) { | |||
std::string build_parameters = argv[4]; | |||
std::string search_parameters = argv[5]; | |||
|
|||
if (build_parameters == "hello hgraph") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the mean of hello hgraph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the origin param is too long,so I mark another name to do this, I will reset the changes in test_performance and examples
f8d74f7
to
a3ba76f
Compare
- add basic implement for hgraph(hnswsq version) - add one test for it Signed-off-by: LHT129 <[email protected]>