Skip to content
/ PyProf Public

A GPU performance profiling tool for PyTorch models

License

Notifications You must be signed in to change notification settings

NVIDIA/PyProf

Repository files navigation

License

PyProf - PyTorch Profiling tool

NOTE: You are currently on the r21.03 branch which tracks stabilization towards the release. This branch is not usable during stabilization.

Quick Installation Instructions

  • Clone the git repository

    $ git clone https://github.com/NVIDIA/PyProf.git
    
  • Navigate to the top level PyProf directory

  • Install PyProf

    $ pip install .
    
  • Verify installation is complete with pip list

    $ pip list | grep pyprof
    
  • Should display

    pyprof            3.9.0
    

Quick Start Instructions

  • Add the following lines to the PyTorch network you want to profile:

    import torch.cuda.profiler as profiler
    import pyprof
    pyprof.init()
    
  • Profile with NVProf or Nsight Systems to generate a SQL file.

    $ nsys profile -f true -o net --export sqlite python net.py
    
  • Run the parse.py script to generate the dictionary.

    $ python -m pyprof.parse net.sqlite > net.dict
    
  • Run the prof.py script to generate the reports.

    $ python -m pyprof.prof --csv net.dict