Skip to content

[LP] Visualize Model Artifacts with Model Explorer + ExecuTorch Extension#3413

Open
matt-cossins wants to merge 10 commits into
ArmDeveloperEcosystem:mainfrom
matt-cossins:model_explorer
Open

[LP] Visualize Model Artifacts with Model Explorer + ExecuTorch Extension#3413
matt-cossins wants to merge 10 commits into
ArmDeveloperEcosystem:mainfrom
matt-cossins:model_explorer

Conversation

@matt-cossins

Copy link
Copy Markdown
Contributor

Before submitting a pull request for a new Learning Path, please review Create a Learning Path

  • I have reviewed Create a Learning Path

Please do not include any confidential information in your contribution. This includes confidential microarchitecture details and unannounced product information.

  • I have checked my contribution for confidential information

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the Creative Commons Attribution 4.0 International License.

@matt-cossins

Copy link
Copy Markdown
Contributor Author

Had initial reviews by the model explorer team. Ready for further review.

Note, this learning path requires small updates to the install process after this is finalised in the next week or so. It cannot be published until these changes are made. However it can be reviewed in the meantime.


## Install the Arm adapters

{{% notice TODO before release %}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you update this before merging?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before publishing, certainly - will update when the combined extension releases


In ExecuTorch, ETRecord is the static side of the profiling workflow. It is produced at export time and preserves graph, operator, debug handle, and delegate partition metadata. This is the information that lets a runtime event map back to a graph node.

ETDump is the runtime side of the profiling workflow. It is produced while executing the model with ExecuTorch event tracing enabled. It can contain events such as `Method::execute`, `OPERATOR_CALL`, `DELEGATE_CALL`, backend-specific events, start times, durations, and cycle counts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might confuse readers. The ETDump provider explicitly filters out wrapper events such as Method::execute, OPERATOR_CALL, and DELEGATE_CALL, and currently exposes only aggregate node overlays.
Also, the first version of the ETDump data provider for Model Explorer only exposes timing information. We plan to add additional metrics in the future, so it may be better to describe the data more generically rather than listing specific event types.

| `.etdp` | Runtime event trace | Timing data from a specific execution |
| `.pte` | ExecuTorch program | The packaged program and backend/delegate structure |

Without a matching ETRecord, an ETDump can still contain useful timing data. With the ETRecord loaded as graph context, the timing data becomes much easier to interpret because runtime measurements can be overlaid on the exported graph.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the first sentence: "Without a matching ETRecord, an ETDump can still contain useful timing data."
We need ETRecord to be loaded before user can use ETDump data provider so it might be better remove the first sentence to avoid confusion in this context.


The [ExecuTorch ETRecord documentation](https://docs.pytorch.org/executorch/stable/etrecord.html) describes ETRecord as an ahead-of-time debug artifact. It contains the Edge dialect graph, debug handles, and delegate debug maps that allow runtime data to be linked back to graph nodes and, when available, Python source information.

For recent ExecuTorch versions, the recommended pattern is to enable ETRecord generation during export or lowering, then retrieve the ETRecord from the resulting program manager:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recently added a Delegate visibility section (https://github.com/Arm-Debug/etrecord-adapter-model-explorer/blob/main/README.md#delegate-visibility) that explains how delegated ExecuTorch models are represented. It might be useful to reference or include this alongside the Generate ETRecord section.


## Load profiling overlays

The ExecuTorch extension for Model Explorer contains an ETRecord adapter and an ETDump data provider. The ETRecord adapter opens the exported graph. The first version of the ETDump data provider overlays runtime timing data on top of that graph.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first version of the ETDump data provider overlays runtime timing data on top of that graph.
This could be confused that the timing data is rendered directly on the graph itself. It may be clearer to say that it is provided as information associated with the graph.


If you pass only an ETDump to the Inspector, you still get runtime events. If you also pass the matching ETRecord, the Inspector can correlate events with graph operators and delegate metadata.

## Load profiling overlays

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be clearer to use "Load profiling data"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants