# Profiling TorchNeuron (Part 1): System-level profiling on AWS Trainium.

DevFeed: [Profiling TorchNeuron (Part 1): System-level profiling on AWS Trainium.](<https://devfeed.tech/articles/profiling-torchneuron-part-1-system-level-profiling-on-aws-trainium-93066.md>)

Original publisher: [Read original article](<https://huggingface.co/blog/amazon/profiling-torchneuron-part-1>)

Author: Josh Longenecker

Published: 2026-10-21T16:04:43Z

Content type: tutorial

Language: en

Sources: [Hugging Face](<https://devfeed.tech/sources/hugging-face-blog.md>)

Topics: [AWS Trainium](<https://devfeed.tech/topics/aws-trainium.md>), [neuron](<https://devfeed.tech/topics/neuron.md>), [PyTorch](<https://devfeed.tech/topics/pytorch.md>), [AWS AI chips](<https://devfeed.tech/topics/aws-ai-chips.md>), [Learning](<https://devfeed.tech/topics/learning.md>)

Tags: [aws](<https://devfeed.tech/tags/aws.md>), [aws-trainium](<https://devfeed.tech/tags/aws-trainium.md>), [inference-performance](<https://devfeed.tech/tags/inference-performance.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [system](<https://devfeed.tech/tags/system.md>), [torchneuron](<https://devfeed.tech/tags/torchneuron.md>), [trainium](<https://devfeed.tech/tags/trainium.md>)

## AI overview

The post shows how to profile PyTorch inference on AWS Trainium with `torch.profiler` and Neuron tools, then trace device time from framework dispatch through runtime scheduling to hardware execution in Neuron Explorer. It compares three RMSNorm implementations under the same inputs and profiler schedule: separate PyTorch operations take 2.355 ms of Neuron time, while `torch.rms_norm()` and `torch.compile(backend="neuron")` each fuse the work into one kernel dispatch and take about 403 μs and 375.5 μs, respectively, in these runs. The walkthrough explains configuring `NeuronConfig`, capturing a clean trace with `ProfilerActivity.PrivateUse1`, synchronizing before export, and using `key_averages()` to find device-time hotspots. These results illustrate the benefit of fusion for this operation; Part 1 does not yet cover device-level engine or roofline analysis.

## Source excerpt

Many ML practitioners have some intuition about how to make models run fast, but fewer know how to analyze why a model is slow. In Part 1 of this series, you will learn how to systematically analyze inference performance and identify where the time is spent. This post starts from scratch and assumes no prior profiling experience. The walkthrough uses AWS Trainium, a purpose-built AI chip for deep learning training and inference workloads, and TorchNeuron, its open source native PyTorch backend.