Improve or New time profiling utility
See original GitHub issue🚀 Feature
Currently, ignite provides only a basic time profiling tool : https://pytorch.org/ignite/master/contrib/handlers.html#ignite.contrib.handlers.time_profilers.BasicTimeProfiler
Which can print something like
----------------------------------------------------
| Time profiling stats (in seconds): |
----------------------------------------------------
total | min/index | max/index | mean | std
Processing function:
157.46292 | 0.01452/1501 | 0.26905/0 | 0.07730 | 0.01258
Dataflow:
6.11384 | 0.00008/1935 | 0.28461/1551 | 0.00300 | 0.02693
Event handlers:
2.82721
- Events.STARTED: []
0.00000
- Events.EPOCH_STARTED: []
0.00006 | 0.00000/0 | 0.00000/17 | 0.00000 | 0.00000
- Events.ITERATION_STARTED: ['PiecewiseLinear']
0.03482 | 0.00001/188 | 0.00018/679 | 0.00002 | 0.00001
- Events.ITERATION_COMPLETED: ['TerminateOnNan']
0.20037 | 0.00006/866 | 0.00089/1943 | 0.00010 | 0.00003
- Events.EPOCH_COMPLETED: ['empty_cuda_cache', 'training.<locals>.log_elapsed_time', ]
2.57860 | 0.11529/0 | 0.14977/13 | 0.12893 | 0.00790
- Events.COMPLETED: []
not yet triggered
What would be nice to have:
- more compact representation (maybe inspire from https://pytorch.org/docs/stable/autograd.html#torch.autograd.profiler.profile)
- profile handlers and not events. As we are looking for bottlenecks it would be helpful to know which functions take time and not on which event.
- better representation of data prep time vs training time
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to Choose the Best Performance Profiling Tools - Stackify
Learn how to choose the best performance profiling tools to detect performance issues and improve your overall application performance.
Read more >First look at profiling tools - Visual Studio (Windows)
To use the tool, choose Application Timeline in the Performance Profiler, and then choose Start. In your app, go through the scenario with...
Read more >Fundamentals of Performance Profiling - SmartBear
Performance profilers are software development tools designed to help you analyze the performance of your applications and improve poorly performing ...
Read more >Profile Your Code to Improve Performance - MATLAB & Simulink
Profiling is a way to measure the time it takes to run your code and identify where MATLAB ® spends the most time....
Read more >All About Code Profiling | How to Choose the Right Tool
Customers love fast, clean, and efficient applications. Profiling code helps optimize applications, and consequently, the user experience.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@harsh8398 sounds good !
Let’s see this a bit later. I think handling custom events should not be too different from original events. Engine is aware of all events it could trigger and which handlers… If you could open a follow-up issue on that, it would be perfect 😃
I’m done with profiler implementation. The output looks as follows:
You can review the changes and suggest if any modifications required but there’s still some TODOs left before raising the PR. Which are as follows:
write_results()
as per new profiler stats formatI have one question, should we include handler times for GET_BATCH_STARTED and GET_BATCH_COMPLETED for calculating dataflow time? Previous implementation had this but I’m not sure if it was intentional.