From the source
Amazon's TorchNeuron team published the first part of a guide teaching ML practitioners how to profile inference performance on AWS Trainium, starting from no prior profiling experience.
- The walkthrough shows how to configure torch.profiler with the Neuron backend, read the key_averages() table to see which operations consume Neuron device time, and follow a single operation through Neuron Explorer from framework dispatch to hardware execution.
- Neuron integrates with PyTorch through the PrivateUse1 extension point, so the torch_neuronx package registers it as a native backend without a dedicated dispatch key.
- Profiling uses NeuronConfig to select data streams and NeuronCores and NeuronProfiler to export a framework trace alongside Neuron system traces.
- The guide profiles three implementations of RMSNorm — individual PyTorch operations, the built-in torch.rms_norm(), and the naive version under torch.compile — using identical inputs and schedules so results are comparable.
- Reproduction scripts are in the torch-neuronx examples directory.
