Add option for device sync at beginning and end of TinyProfiler region#1505
Merged
WeiqunZhang merged 2 commits intoAMReX-Codes:developmentfrom Nov 4, 2020
Merged
Conversation
Member
|
I wonder if we should sync before the timer starts. |
Member
Author
|
Probably a good idea also. Should I add a separate option or rename it and then have it do both? |
Member
|
I prefer one parameter to rule them all. |
Member
Author
|
Updated. |
WeiqunZhang
approved these changes
Nov 4, 2020
This was referenced Feb 14, 2024
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Now when setting
tiny_profiler.device_synchronize_on_region_end = 1in 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: