Skip to content
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

SYCL: Make sure to use a large enough workgroup size for tree traversal #931

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/details/ArborX_DetailsTreeTraversal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ struct TreeTraversal<BVH, Predicates, Callback, SpatialPredicateTag>
}
else
{
Kokkos::parallel_for("ArborX::TreeTraversal::spatial",
Kokkos::RangePolicy<ExecutionSpace>(
space, 0, Access::size(predicates)),
*this);
Kokkos::RangePolicy<ExecutionSpace> policy(space, 0,
Access::size(predicates));
// FIXME_SYCL
#ifdef KOKKOS_ENABLE_SYCL
if constexpr (std::is_same_v<ExecutionSpace, Kokkos::Experimental::SYCL>)
policy.set_chunk_size(1024);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment on the considerations that went into choosing 1024?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure if there is much behind it rather than that choosing the maximum gave much better performance (than 32 which is what the compiler chose) and I couldn't find a different workgroup size that gave better results (but results don't differ much choosing between 256 and 1024 threads per workgroup).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please post the results in this issue for different workgroup sizes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll share it privately.

Copy link
Contributor

@dalg24 dalg24 Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cc me

#endif
Kokkos::parallel_for("ArborX::TreeTraversal::spatial", policy, *this);
}
}

Expand Down