CAGRA: variable graph degree for CPU-based algorithm - #2031
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
|
/ok to test |
|
/ok to test |
mfoerste4
left a comment
There was a problem hiding this comment.
graph_core.cuh looks good to me.
| if constexpr (VariableDegree) { | ||
| if (i + 1 == target_pruned_degree) { | ||
| // Freeze the detour level after we've placed exactly target_pruned_degree edges. | ||
| target_detour_level = warp_min_count; | ||
| } else if (i >= target_pruned_degree && warp_min_count > target_detour_level && | ||
| natural_degree == output_graph_degree) { | ||
| // The detour level just rose above the target band. Record the natural degree once. | ||
| natural_degree = i; | ||
| } | ||
| } |
There was a problem hiding this comment.
So we just track the 'natural_degree' here but continue to fill up the output graph - is this required?
There was a problem hiding this comment.
Yes, because we need the full graph in the other steps; we only use the natural degree later during the merging step.
|
/ok to test |
julianmi
left a comment
There was a problem hiding this comment.
Thanks, this feature looks very promising. Could you add some statistics on the resulting graph degree with the SAME_GRAPH_FOOTPRINT and SIMILAR_SEARCH_PERFORMANCE please? Please also extend the results to include variable_graph_degree_fraction = 0.7 if this becomes the default SIMILAR_SEARCH_PERFORMANCE heuristic.
| auto graph_degree = static_cast<int>(index_.graph_degree()); | ||
| os.write(reinterpret_cast<char*>(&graph_degree), sizeof(int)); | ||
| int actual_degree = static_cast<int>(index_.graph_degree()); | ||
| for (int j = 0; j < actual_degree; j++) { |
There was a problem hiding this comment.
Which values of actual_degree do we see for the two heuristics 0.35 and 0.7? I wonder if it make sense to revert this loop depending of how close the actual and fixed graph degrees are.
Add the missing HNSW bindings and cleans up the changes in #1719. Implements feature #2156. More work might be needed to better fit the recall curve provided by HNSW. See #2031. CC @achirkin Authors: - Julian Miller (https://github.com/julianmi) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) - Igor Motov (https://github.com/imotov) - MithunR (https://github.com/mythrocks) - Tamas Bela Feher (https://github.com/tfeher) URL: #2307
…ction (the effective degree is a bit higher anyway)
|
Hi @julianmi many thanks for the thorough review! After more benchmarks, I decided to disable the variable degree feature completely for the SIMILAR_SEARCH_PERFORMANCE heuristic. In this mode, the maximum degree is already |



Modify
optimizeroutine of CAGRA build process to allow variable graph degree.Introduce
variable_graph_degree_fractionparameter (by default = 1.0 = normal / constant degree behavior). This parameter defines the minimum allowed graph degree for any graph node.