1. Torch Profiler tool introduction
https://zhuanlan.zhihu.com/p/360479566
PyTorch Profiler is an open source tool for accurate and efficient analysis of large-scale deep learning models 性能分析
. Including the following functions:
- Analyze the GPU and CPU usage of the model
- Time consumption of various operators op
- CPU and GPU usage of the trace network in the pipeline
Profiler
Use Tensorboard
visualization 模型的性能
to help discover models 瓶颈
. For example, the CPU usage reaches 80%, indicating that the performance of the network is mainly affected by the CPU, not the GPU inference of the model and the consumption of various kernel operations. At this time, light weighting of the model and pruning are not helpful to the running speed of the model. The key is to reduce CPU consumption and code optimization, so as to avoid doing some useless work and help us optimize the performance of the project.