module utils.nvprof2json
#
Short summary#
module onnxcustom.utils.nvprof2json
Converts traces from nvprof. The source comes from nvprof2json.
Classes#
class |
truncated documentation |
---|---|
List of events. |
Functions#
function |
truncated documentation |
---|---|
Demangle a C++ identifier using c++filt |
|
Take a time from nvprof and convert it into a chrome://tracing time. |
|
Format size with metric units (like nvvp) |
|
Converts traces produced by nvprof and saved with format sqlite3 (extension .sql). The output format … |
|
Converts a json dump obtained with function |
|
Converts a big json dump (from |
Documentation#
Converts traces from nvprof. The source comes from nvprof2json.
- onnxcustom.utils.nvprof2json._demangle(name)#
Demangle a C++ identifier using c++filt
- onnxcustom.utils.nvprof2json._munge_time(t)#
Take a time from nvprof and convert it into a chrome://tracing time.
- onnxcustom.utils.nvprof2json._sizeof_fmt(num, suffix='B')#
Format size with metric units (like nvvp)
- onnxcustom.utils.nvprof2json.convert_trace_to_json(filename, output=None, temporary_file=None, verbose=0, fLOG=None)#
Converts traces produced by nvprof and saved with format sqlite3 (extension .sql). The output format follows Trace Event Format.
- Parameters:
filename – filename
output – output file or None
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)
This file, if not too big, can be viewed with chrome-tracing. The traces are usually generated by using a command line similar to:
nvprof -o gpu_profile.sql python plot_gpu_training.py
- onnxcustom.utils.nvprof2json.json_to_dataframe(js)#
Converts a json dump obtained with function
convert_trace_to_json
to a dataframe.- Parameters:
js – a filename, a json string, a stream containing json
- Returns:
a dataframe
- onnxcustom.utils.nvprof2json.json_to_dataframe_streaming(js, chunksize=100000, flatten=False, **kwargs)#
Converts a big json dump (from
convert_trace_to_json
) to a dataframe. The function processes the data by streaming to avoid loading huge data in memory. Returns an iterator on dataframes. The function relies on pandas_streaming.- Parameters:
js – a filename, a json string, a stream containing json
chunksize – see
pandas_streaming.df.StreamingDataFrame.read_json()
flatten – see
pandas_streaming.df.StreamingDataFrame.read_json()
kwargs – see
pandas_streaming.df.StreamingDataFrame.read_json()
- Returns:
a dataframe