I'm not sure how to fix this myself correctly, but at the least we should guard against WARMUP==false && beam_width=0 so we can error early and say "cannot autodetect optimal beam width if we haven't warmed up" or something like that. And I'm not even really sure how I'm supposed to make warmup actually happen.
Your Environment
Operating system: ubuntu 22.04 lts
DiskANN version (or commit built from): 8aedb3a3d408b0ebde34f31eb4291bc8e0580122 (current latest as of today)
Expected Behavior
search_disk_index should optimize beam width
Actual Behavior
Example Code
Please see How to create a Minimal, Reproducible example for some guidance on creating the best possible example of the problem
Dataset Description
Please tell us about the shape and datatype of your data, (e.g. 128 dimensions, 12.3 billion points, floats)
Error
The code in https://github.com/microsoft/DiskANN/blob/main/apps/search_disk_index.cpp#L213-L214 will only work if the warmup values have been changed, likely if the #define WARMUP is set to true (it's false by default).
As a result, by the time you get to line 213, warmup is nullptr, warmup_num is 0, and warmup_aligned_dim is still 0.
Then when we enter https://github.com/microsoft/DiskANN/blob/main/include/percentile_stats.h#L39, we create a vector of size 0 (because warmup_num was 0), and then try to get the element at index 0 out of a 0 length vector. And we get a segfault. Boom!
I'm not sure how to fix this myself correctly, but at the least we should guard against WARMUP==false && beam_width=0 so we can error early and say "cannot autodetect optimal beam width if we haven't warmed up" or something like that. And I'm not even really sure how I'm supposed to make warmup actually happen.
Your Environment