-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Allow Custom Time Unit When Printing Profiler Table #157913
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
Allow Custom Time Unit When Printing Profiler Table #157913
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157913
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 749b2e2 with merge base 86eaf45 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: profiler" |
|
This seems reasonable to me. Just for posterity can you please add an example output to the PR description? |
| ) | ||
| self.assertIn("Total MFLOPs", profiler_output) | ||
|
|
||
| def test_override_time_units(self): |
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.
In this unit test you make sure that the time unit you see is as expected but you don't check to make sure that the conversion is correct. Can you please add this?
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.
Yeah, good point, I'll update the tests.
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.
As override_time_unit is a nested function, I cannot write unit tests for it directly. I've opted to instead verify the correctly converted values are present in the table.
|
Thanks! |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Overview
This PR adds a kwarg to the
table()method of the profiler allowing users to specify a time unit to be used for all results in the profiling table. The available options are:s,msandus. If an invalid unit or no unit is provided, then a time unit is selected based on the size of the value (current default behaviour).Testing
A unit test has been added to verify this works correctly.
Documentation
I couldn't find any documentation specific to the
table()function beyond doc strings which have been updated.Example Output