composer.profiler.json_trace#

Outputs profiling data in JSON trace format.

Classes

JSONTraceHandler

Records trace events in JSON trace format.

class composer.profiler.json_trace.JSONTraceHandler(flush_every_n_batches=100, buffering=- 1, output_directory='composer_profiler')[source]#

Bases: composer.profiler.ProfilerEventHandler

Records trace events in JSON trace format.

Traces are output to output_directory. Traces can be visualized using the Chrome Trace Viewer. To view in a Google Chrome browser, navigate to chrome://tracing and load the JSON trace file.

Parameters
  • flush_every_n_batches (int) โ€“ Interval at which to flush the logfile. (Default: 100 batches)

  • buffering (int, optional) โ€“ Buffering parameter passed to open() when opening the logfile. (Default: -1 for the system default)

  • output_directory (str) โ€“ Directory, relative to the run directory, to store traces. Each trace will be called rank_XXX.trace.json within this directory, where XXX is the global rank. (Default: composer_profiler within the run_directory)