-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Switch HalfTraversal to APIv2 #1022
Conversation
I need to check that FDBSCAN is not affected. We don't have benchmark for neighbor lists, so can't say how much it affected it. But I expect that there is some benefit as I switched to APIv2 with points instead of boxes for the tree construction. |
About 6% slowdown in
About 8.5% slowdown in The cost is likely passing values by const ref to the Maybe need to explore other cases where half traversal is useful but maybe not possible with the current callback interface. |
Move a part of the PR (the one that isn't related to switching HalfTraversal API to v2) to #1024. |
cfb2d3e
to
5cf6cad
Compare
Rebased on #1024. |
5cf6cad
to
b8f139e
Compare
b8f139e
to
fd39c11
Compare
The following change seems to have fixed the performance issue: --- a/src/details/ArborX_DetailsHalfTraversal.hpp
+++ b/src/details/ArborX_DetailsHalfTraversal.hpp
@@ -52,7 +52,7 @@ struct HalfTraversal
KOKKOS_FUNCTION void operator()(int i) const
{
- auto const &leaf_value = HappyTreeFriends::getValue(_bvh, i);
+ auto const leaf_value = HappyTreeFriends::getValue(_bvh, i);
auto const predicate = _get_predicate(leaf_value);
int node = HappyTreeFriends::getRope(_bvh, i); While it may have negative consequences for very large size values, this is acceptable for our common use cases. In the future, we may specialize on
|
@dalg24 ready for re-review |
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.
I am a bit surprised by the variability of the construction timings in the results you posted. Is it something you have been seeing before?
@@ -122,7 +127,9 @@ void findFullNeighborList(ExecutionSpace const &space, | |||
Points points{primitives}; // NOLINT | |||
int const n = points.size(); | |||
|
|||
BoundingVolumeHierarchy<MemorySpace, PairValueIndex<Point>> bvh( | |||
using Value = PairValueIndex<Point>; |
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.
Not a big fan of that naming
Something else was running which may have interfered at the moment. I rerun today a few times and saw consistent 0.207-0.210. |
The main thing is to change half-traversal callback from
callback(int, int)
tocallback(value, value)
.Note that this change is not backwards compatible. However,
HalfTraversal
is experimental, so it should be fine.