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

Sampler's begin for callee's null check before fence (less overhead in corner case) #253

Merged
merged 2 commits into from
May 23, 2024

Conversation

vlkale
Copy link
Contributor

@vlkale vlkale commented May 18, 2024

This PR is simple fix involving a slight reduction in Kokkos Tools runtime overhead for one of the kokkosp_begin_parallel_xyz callbacks (done correctly for the other two); it does not raise any incorrect behavior in the develop branch version of the sampler. The callee being null is a corner case, and this reduces overhead in that case.

Specifically, in the function kokkosp_begin_parallel_for(), the check of the callee pointer being null is placed after the tool-invoked fence. It should be placed before the tool-invoked fence. If the child callee pointer is null, e.g., the sampler's tool-invoked fence need not be invoked. This would reduce Kokkos Tools runtime overhead.

Note that this is consistent with @(DavidPoliakoff)'s passthrough utility draft PR.

This improves performance in the case there is no callee for the kokkosp_begin_parallel_for.

This is actually done correctly in the kokkosp_begin_parallel_scan and begin_parallel_reduce.
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

You'll have to fix the indentation.

@vlkale vlkale marked this pull request as ready for review May 20, 2024 14:01
@vlkale
Copy link
Contributor Author

vlkale commented May 20, 2024

You'll have to fix the indentation.

Thanks! Applying clang-format today.

@vlkale
Copy link
Contributor Author

vlkale commented May 21, 2024

You'll have to fix the indentation.

Thanks! Applying clang-format today.

Done.

@crtrott crtrott merged commit 44ada1f into kokkos:develop May 23, 2024
7 checks passed
@vlkale vlkale deleted the smplr-for-callee-chk-first branch June 6, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants