PyTorch NeuronX Profiling API — AWS Neuron Documentation (original) (raw)

Contents

This document is relevant for: Inf2, Trn1, Trn2

PyTorch NeuronX Profiling API#

The profiler provides a method to generate a context manager to capture trace events at the operator or runtime level.

torch_neuronx.experimental.profiler.profile(port=9012, ms_duration=60000, neuron_tensorboard_plugin_dir='logs/plugins/neuron', profile_type='operator', auto_start=True, delete_working=True)#

The torch_neuronx.experimental.profiler.profile() method returns a profile context manager object. This object doesn’t need to be used directly, as default options are set to auto capture events based on the profile_type.

The context manager will wrap around the entire model and training/inference loop. The context-manager is backwards-compatible with the torch_xla.debug.profiler``

Required Arguments

None

Optional Keyword Arguments

Keyword Arguments:

Returns:

The traced profile

Return type:

~profile

torch_neuronx.experimental.profiler.profile.start()#

The torch_neuronx.experimental.profiler.profile.start() method starts the profiler if not started (i.e when auto_start=False). This function does not take in any parameters, nor return anything.

Required Arguments

None

Optional Keyword Arguments

None

Returns:

None

This document is relevant for: Inf2, Trn1, Trn2