ETRecord adapter package for Model Explorer
Project description
ETRecord Adapter for Model Explorer
etrecord-adapter-model-explorer is the standalone Model Explorer adapter
for ExecuTorch .etrecord files.
This repository contains the ETRecord-specific adapter code, tests, and
fixtures. For a combined install that wires the PTE adapter, ETRecord adapter,
and ETDump data provider together, use the umbrella package
executorch-extension-model-explorer.
Installation
Install the standalone adapter package:
pip install etrecord-adapter-model-explorer
The adapter expects an environment with the ExecuTorch Python packages available.
Usage
Run Model Explorer with the standalone ETRecord adapter enabled:
model-explorer --extensions=etrecord_adapter_model_explorer
Then open an .etrecord file.
Delegate visibility
Delegated ExecuTorch programs often collapse a backend-supported subgraph into
an opaque executorch_call_delegate node. If an ETRecord is generated from the
post-delegation edge graph, this adapter can only display that delegate call for
the delegated region because the original edge operators are no longer present
in the recorded edge graph.
To keep the original operators visible, generate the ETRecord with the
pre-delegation EdgeProgramManager as edge_dialect_program and the delegated
ExecutorchProgramManager as executorch_program:
import copy
import torch
from executorch.backends.arm import EthosUCompileSpec, EthosUPartitioner
from executorch.devtools import generate_etrecord
from executorch.exir import to_edge, to_edge_transform_and_lower
exported_program = torch.export.export(model.eval(), example_inputs)
edge_program = to_edge(exported_program)
edge_program_for_record = copy.deepcopy(edge_program)
compile_spec = EthosUCompileSpec("ethos-u55-128")
delegated_edge_program = to_edge_transform_and_lower(
programs=exported_program,
partitioner=[EthosUPartitioner(compile_spec)],
)
executorch_program = delegated_edge_program.to_executorch()
generate_etrecord(
"model.etrecord",
edge_dialect_program=edge_program_for_record,
executorch_program=executorch_program,
)
Backends that emit delegate debug mapping can also let the adapter group those
operators under a delegate namespace such as
delegates/CoreMLBackend/partition_0. Backends that do not emit that mapping
can still show the pre-delegation operators, but delegate grouping may be
limited.
Development
Local ETRecord test fixtures live under
src/etrecord_adapter_model_explorer/tests/fixtures/.
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file etrecord_adapter_model_explorer-0.1.0.tar.gz.
File metadata
- Download URL: etrecord_adapter_model_explorer-0.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a47028c5a568890e95b0114f3cb13145069ba248d8848b7b3622dd02d5e22ed1
|
|
| MD5 |
c27a730a84e06003147beb15545ce4af
|
|
| BLAKE2b-256 |
f038bf67251a25327af2b62e2f9ad88cb4a0d16704d90832bb7191d5ec377587
|
Provenance
The following attestation bundles were made for etrecord_adapter_model_explorer-0.1.0.tar.gz:
Publisher:
ci.yml on arm/etrecord-adapter-model-explorer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etrecord_adapter_model_explorer-0.1.0.tar.gz -
Subject digest:
a47028c5a568890e95b0114f3cb13145069ba248d8848b7b3622dd02d5e22ed1 - Sigstore transparency entry: 2047569722
- Sigstore integration time:
-
Permalink:
arm/etrecord-adapter-model-explorer@297af9f7e4fb02ddeb03de16b0af8bd8a96cda56 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/arm
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@297af9f7e4fb02ddeb03de16b0af8bd8a96cda56 -
Trigger Event:
push
-
Statement type:
File details
Details for the file etrecord_adapter_model_explorer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: etrecord_adapter_model_explorer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f01999d105c292cf47b46d24558067613527062deefc5caa9697ac4aa9562b
|
|
| MD5 |
e5a832df8c5543aba2cd96380e430912
|
|
| BLAKE2b-256 |
d279ed954590d2610322cf5cf56d654c89b07c21e1f17fba0c9963e32824b04b
|
Provenance
The following attestation bundles were made for etrecord_adapter_model_explorer-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on arm/etrecord-adapter-model-explorer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etrecord_adapter_model_explorer-0.1.0-py3-none-any.whl -
Subject digest:
50f01999d105c292cf47b46d24558067613527062deefc5caa9697ac4aa9562b - Sigstore transparency entry: 2047570185
- Sigstore integration time:
-
Permalink:
arm/etrecord-adapter-model-explorer@297af9f7e4fb02ddeb03de16b0af8bd8a96cda56 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/arm
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@297af9f7e4fb02ddeb03de16b0af8bd8a96cda56 -
Trigger Event:
push
-
Statement type: