Repository navigation
[observability] Profile Neuron devices with the PrivateUse1 activity - #6
Closed
kvshbg-aws wants to merge 1 commit into
Closed
kvshbg-aws wants to merge 1 commit into
kvshbg-aws wants to merge 1 commit into
Conversation
On Neuron, the profiler recorded only CPU activity. Add ProfilerActivity.PrivateUse1 when device_type is "neuron", as the CUDA and XPU branches do. Also set with_stack, so Neuron Explorer can link framework events to source lines.
kvshbg-aws
marked this pull request as ready for review
October 5, 2026 22:00
Collaborator
|
let's reword to requires also to verified on Neuron hardware. |
Collaborator
Author
|
closing this one since we have the upstream PR open - pytorch#5072 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On AWS Neuron (Trainium),
build_torch_profilerrecorded only CPU activity. This PR addsProfilerActivity.PrivateUse1whendevice_type == "neuron", in the same way the CUDA and XPU branches add their activities. No other device changes.The Neuron branch also sets
with_stack=True. Neuron Explorer uses the stacks to link framework events to source lines. The stacks add host overhead only on profiled steps.Notes
torch-neuronx>=2.33version This PR adds no Neuron imports or configuration.TORCH_NEURONX_PROFILE_*environment variables set the Neuron profile options. The defaults capture rank 0.device_module. This PR does not change them.Test plan
with_stackon a mocked Neuron device.privateuse1_runtimeand 22Kprivateuse1_driverevents;