module cli.profiling#

Short summary#

module onnxcustom.cli.profiling

Command lines for profiling.

source on GitHub

Functions#

function

truncated documentation

nvprof2json

Converts traces produced by nvprof and saved with format sqlite3 (extension .sql).

Documentation#

Command lines for profiling.

source on GitHub

onnxcustom.cli.profiling.nvprof2json(filename, output='', temporary_file='', verbose=1, fLOG=<built-in function print>)#

Converts traces produced by nvprof and saved with format sqlite3 (extension .sql).

Parameters:
  • filename – filename

  • output – output file, if left empty, the result is printed on the standard output

  • temporary_file – if the file needs to be unzipped, this file will be created to be the unzipped file, it is not cleaned after the unzipping.

  • verbose – verbosity

  • fLOG – logging function

Returns:

json (if output is None, the list of events otherwise)

Converts a profile stored by nvprof into json

The sqlite dump is generated with a command line similar to:

nvprof -o gpu_profile.sql python plot_gpu_training.py

The command produces a json file following the Trace Event Format.

<<<

python -m onnxcustom nvprof2json --help

>>>

usage: nvprof2json [-h] [-f FILENAME] [-o OUTPUT] [-t TEMPORARY_FILE]
                   [-v VERBOSE]

Converts traces produced by `nvprof` and saved with format `sqlite3`
(extension `.sql`).

optional arguments:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        filename (default: None)
  -o OUTPUT, --output OUTPUT
                        output file, if left empty, the result is printed on
                        the standard output (default: )
  -t TEMPORARY_FILE, --temporary_file TEMPORARY_FILE
                        if the file needs to be unzipped, this file will be
                        created to be the unzipped file, it is not cleaned
                        after the unzipping. (default: )
  -v VERBOSE, --verbose VERBOSE
                        verbosity (default: 1)

source on GitHub