pytorch performance analysis tool Profiler

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

ProfilerUse Tensorboardvisualization 模型的性能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.

insert image description here

Figure 1 Summary of performance

insert image description here

Figure 2 The time occupation of op

2. Profiler tool use

Guess you like

Origin blog.csdn.net/weixin_38346042/article/details/130071989