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

Add option for device sync at beginning and end of TinyProfiler region #1505

Merged

Conversation

maximumcats
Copy link
Member

@maximumcats maximumcats commented Nov 4, 2020

Summary

Now when setting tiny_profiler.device_synchronize_on_region_end = 1 in the inputs file, we will synchronize before calling nvtxRangePop() and nvtxRangePush(), which means that TINY_PROFILE regions will include the full kernel time, rather than just the kernel launch time.

Additional background

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • are described in the proposed changes to the AMReX documentation, if appropriate

@WeiqunZhang
Copy link
Member

I wonder if we should sync before the timer starts.

@maximumcats
Copy link
Member Author

Probably a good idea also. Should I add a separate option or rename it and then have it do both?

@WeiqunZhang
Copy link
Member

I prefer one parameter to rule them all.

@maximumcats maximumcats changed the title Add option for device sync at end of TinyProfiler region Add option for device sync at beginning and end of TinyProfiler region Nov 4, 2020
@maximumcats
Copy link
Member Author

Updated.

@WeiqunZhang WeiqunZhang merged commit db41d3d into AMReX-Codes:development Nov 4, 2020
@maximumcats maximumcats deleted the tiny_profiler_device_sync branch November 4, 2020 18:45
WeiqunZhang pushed a commit that referenced this pull request Feb 14, 2024
In #1505
`tiny_profiler.device_synchronize_around_region = 1` was added to better
measure timings on GPU using nvtx, however this would also be useful for
the timings in TinyProfiler itself. Currently codes have to custom-add
these syncs to get meaningful output from TinyProfiler on GPU

https://github.com/Hi-PACE/hipace/blob/development/src/utils/HipaceProfilerWrapper.H
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.

2 participants