-
Notifications
You must be signed in to change notification settings - Fork 74
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
FAISS with cuVS enabled in cuvs-bench #561
base: branch-25.02
Are you sure you want to change the base?
Changes from all commits
689716c
8e3a02e
27dda5f
10618fb
c0ff9ba
21f92fd
20e462c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,11 @@ void parse_build_param(const nlohmann::json& conf, | |
typename cuvs::bench::faiss_gpu_ivf_flat<T>::build_param& param) | ||
{ | ||
parse_base_build_param<T>(conf, param); | ||
if (conf.contains("use_cuvs")) { | ||
param.use_cuvs = conf.at("use_cuvs"); | ||
} else { | ||
param.use_cuvs = false; | ||
} | ||
} | ||
|
||
template <typename T> | ||
|
@@ -60,6 +65,16 @@ void parse_build_param(const nlohmann::json& conf, | |
} else { | ||
param.use_float16 = false; | ||
} | ||
if (conf.contains("use_cuvs")) { | ||
param.use_cuvs = conf.at("use_cuvs"); | ||
} else { | ||
param.use_cuvs = false; | ||
} | ||
if (conf.contains("bitsPerCode")) { | ||
param.bitsPerCode = conf.at("bitsPerCode"); | ||
} else { | ||
param.bitsPerCode = 8; | ||
} | ||
} | ||
|
||
template <typename T> | ||
|
@@ -138,5 +153,18 @@ REGISTER_ALGO_INSTANCE(std::uint8_t); | |
|
||
#ifdef ANN_BENCH_BUILD_MAIN | ||
#include "../common/benchmark.hpp" | ||
int main(int argc, char** argv) { return cuvs::bench::run_main(argc, argv); } | ||
int main(int argc, char** argv) | ||
{ | ||
rmm::mr::cuda_memory_resource cuda_mr; | ||
// Construct a resource that uses a coalescing best-fit pool allocator | ||
// and is initially sized to half of free device memory. | ||
rmm::mr::pool_memory_resource<rmm::mr::cuda_memory_resource> pool_mr{ | ||
&cuda_mr, rmm::percent_of_free_device_memory(50)}; | ||
// Updates the current device resource pointer to `pool_mr` | ||
auto old_mr = rmm::mr::set_current_device_resource(&pool_mr); | ||
auto ret = cuvs::bench::run_main(argc, argv); | ||
// Restores the current device resource pointer to its previous value | ||
rmm::mr::set_current_device_resource(old_mr); | ||
return ret; | ||
} | ||
Comment on lines
+156
to
+169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've run in many issues in ann-bench in the past doing the program-wide setting of memory resource. This also changes the behavior depending on whether |
||
#endif |
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.
Let's not put algorithm-specific stuff in the common files. I agree with @achirkin about this one. If needed, you could propoagate this down to the specific algorithms, but the common stuff should be agnostic of he algoithmmic specific.
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.
Thanks, @cjnolet for spotting this. @tarang-jain , could you please move the warning into the faiss-related header (perhaps into the set_search_params)? There, you should be able to query the
cuvs::bench::benchmark_n_threads > 1
fromcommon/util.hpp
.