From 60fb0cda4f8c7a73ad77c43bb292cec409e4fafa Mon Sep 17 00:00:00 2001 From: David Zier <42390249+dzier@users.noreply.github.com> Date: Thu, 6 Aug 2020 19:28:18 -0700 Subject: [PATCH] Update README to include install and usage instructions (#63) --- README.rst | 50 +++++++++++++++++++++++++++++++++++++++++++++ docs/install.rst | 21 +++---------------- docs/quickstart.rst | 21 +++---------------- 3 files changed, 56 insertions(+), 36 deletions(-) diff --git a/README.rst b/README.rst index 25c3f8d..affad00 100644 --- a/README.rst +++ b/README.rst @@ -64,6 +64,56 @@ the PyTorch container on `NVIDIA GPU Cloud (NGC) `_. The branch for this release is `r20.07 `_. +Quick Installation Instructions +------------------------------- + +.. quick-install-start-marker-do-not-remove + +* 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.3.0.dev0 + +.. quick-install-end-marker-do-not-remove + +Quick Start Instructions +------------------------ + +.. quick-start-start-marker-do-not-remove + +* 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 + +.. quick-start-end-marker-do-not-remove + Documentation ------------- diff --git a/docs/install.rst b/docs/install.rst index 52de334..c5e4a58 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -25,21 +25,6 @@ PyProf is available from GitHub. Installing from GitHub ---------------------- -* 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.3.0.dev0 - \ No newline at end of file +.. include:: ../README.rst + :start-after: quick-install-start-marker-do-not-remove + :end-before: quick-install-end-marker-do-not-remove \ No newline at end of file diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 2eaa6ef..1443a79 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -44,21 +44,6 @@ for details on how to install from GitHub Profile with PyProf ------------------- -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 - +.. include:: ../README.rst + :start-after: quick-start-start-marker-do-not-remove + :end-before: quick-start-end-marker-do-not-remove