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 (variable_graph_degree) { | ||
| RAFT_LOG_INFO("# Pruning kNN graph (size=%lu, degree=%lu, target_pruned_degree=%lu)", | ||
| graph_size, | ||
| knn_graph_degree, | ||
| target_pruned_degree); | ||
| } |
There was a problem hiding this comment.
You might want to move down the legacy RAFT_LOG here as well and combine it.
| 0.0, | ||
| false, | ||
| normalize_mean); | ||
| raft::copy(res, raft::make_host_scalar_view(&avg_natural), d_avg_natural.view()); |
There was a problem hiding this comment.
Why did you not choose map_reduce on the vector directly?
| 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?
|
/ok to test |
|
@achirkin can we get some benchmarks attached to this PR please demonstrating the improvements? It's a lot easier to point users to PRs to see benefits of changes than it is to have to look up slide decks or internal convos. |
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.