Skip to content

Commit 3dd1b98

Browse files
New URL for the ETRecord documentation page (#5848)
New URL for the ETRecord documentation page (#5764) Summary: Pull Request resolved: #5764 This diff is to rename the "sdk-etrecord" documentation page to "etrecord". Old URL: https://pytorch.org/executorch/main/sdk-etrecord.html New URL ("sdk" is removed): https://pytorch.org/executorch/main/etrecord.html Design doc: https://docs.google.com/document/d/1l6DYTq9Kq6VrPohruRFP-qScZDj01W_g4zlKyvqKGF4/edit?usp=sharing Reviewed By: dbort Differential Revision: D63646220 fbshipit-source-id: ca612a6e6f453dd73ce361e50594f99ca39fb7f7 (cherry picked from commit 450aece) Co-authored-by: Olivia Liu <[email protected]>
1 parent 077f24c commit 3dd1b98

12 files changed

+53
-49
lines changed

backends/apple/mps/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ python3 -m examples.apple.mps.scripts.mps_example --model_name="mv3" --no-use_fp
111111
```
112112

113113
### Profiling:
114-
1. [Optional] Generate an [ETRecord](./sdk-etrecord.rst) while you're exporting your model.
114+
1. [Optional] Generate an [ETRecord](./etrecord.rst) while you're exporting your model.
115115
```bash
116116
cd executorch
117117
python3 -m examples.apple.mps.scripts.mps_example --model_name="mv3" --generate_etrecord -b

docs/source/build-run-coreml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ cd executorch
8787

8888
Note that profiling is supported on [macOS](https://developer.apple.com/macos) >= 14.4.
8989

90-
1. [Optional] Generate an [ETRecord](./sdk-etrecord.rst) when exporting your model.
90+
1. [Optional] Generate an [ETRecord](./etrecord.rst) when exporting your model.
9191
```bash
9292
cd executorch
9393

@@ -108,7 +108,7 @@ cd executorch
108108
./coreml_executor_runner --model_path mv3_coreml_all.pte --profile_model --etdump_path etdump.etdp
109109
```
110110

111-
4. Create an instance of the [Inspector API](./sdk-inspector.rst) by passing in the [ETDump](./sdk-etdump.md) you have sourced from the runtime along with the optionally generated [ETRecord](./sdk-etrecord.rst) from step 1 or execute the following command in your terminal to display the profiling data table.
111+
4. Create an instance of the [Inspector API](./sdk-inspector.rst) by passing in the [ETDump](./sdk-etdump.md) you have sourced from the runtime along with the optionally generated [ETRecord](./etrecord.rst) from step 1 or execute the following command in your terminal to display the profiling data table.
112112
```bash
113113
python examples/apple/coreml/scripts/inspector_cli.py --etdump_path etdump.etdp --etrecord_path mv3_coreml.bin
114114
```

docs/source/compiler-delegate-and-partitioner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static auto success_with_compiler = register_backend(backend);
129129

130130
## Developer Tools Integration: Debuggability
131131

132-
Providing consistent debugging experience, be it for runtime failures or performance profiling, is important. ExecuTorch employs native Developer Tools for this purpose, which enables correlating program instructions to original PyTorch code, via debug handles. You can read more about it [here](./sdk-etrecord).
132+
Providing consistent debugging experience, be it for runtime failures or performance profiling, is important. ExecuTorch employs native Developer Tools for this purpose, which enables correlating program instructions to original PyTorch code, via debug handles. You can read more about it [here](./etrecord).
133133

134134
Delegated program or subgraphs are opaque to ExecuTorch runtime and appear as a special `call_delegate` instruction, which asks corresponding backend to handle the execution of the subgraph or program. Due to the opaque nature of backend delgates, native Developer Tools does not have visibility into delegated program. Thus the debugging, functional or performance, experiences of delegated execution suffers significantly as compared to it's non-delegated counterpart.
135135

docs/source/devtools-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ETRecord (ExecuTorch Record) is an artifact generated during the export process
2727

2828
To draw a rough equivalence to conventional software development ETRecord can be considered as the binary built with debug symbols that is used for debugging in GNU Project debugger (gdb).
2929

30-
More details are available in the [ETRecord documentation](sdk-etrecord.rst) on how to generate and store an ETRecord.
30+
More details are available in the [ETRecord documentation](etrecord.rst) on how to generate and store an ETRecord.
3131

3232
### ETDump
3333
ETDump (ExecuTorch Dump) is the binary blob that is generated by the runtime after running a model. Similarly as above, to draw a rough equivalence to conventional software development, ETDump can be considered as the coredump of ExecuTorch, but in this case within ETDump we store all the performance and debug data that was generated by the runtime during model execution.

docs/source/etrecord.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Prerequisite | ETRecord - ExecuTorch Record
2+
===========================================
3+
4+
Overview
5+
--------
6+
7+
``ETRecord`` is intended to be the debug artifact that is generated by
8+
users ahead of time (when they export their model to run on ExecuTorch).
9+
To draw a rough equivalent to conventional software development,
10+
``ETRecord`` can be considered as the binary built with debug symbols
11+
that is used for debugging in GNU Debugger (gdb). It is expected that
12+
the user will supply this to the ExecuTorch Developer Tools in order for
13+
them to debug and visualize their model.
14+
15+
``ETRecord`` contains numerous components such as:
16+
17+
* Edge dialect graph with debug handles
18+
* Delegate debug handle maps
19+
20+
The ``ETRecord`` object itself is intended to be opaque to users and they should not access any components inside it directly.
21+
It should be provided to the `Inspector API <sdk-inspector.html>`__ to link back performance and debug data sourced from the runtime back to the Python source code.
22+
23+
Generating an ``ETRecord``
24+
--------------------------
25+
26+
The user should use the following API to generate an ``ETRecord`` file. They
27+
will be expected to provide the Edge Dialect program (returned by the call to ``to_edge()``),
28+
the ExecuTorch program (returned by the call to ``to_executorch()``), and optional models that
29+
they are interested in working with via our tooling.
30+
31+
.. warning::
32+
Users should do a deepcopy of the output of ``to_edge()`` and pass in the deepcopy to the ``generate_etrecord`` API. This is needed because the subsequent call, ``to_executorch()``, does an in-place mutation and will lose debug data in the process.
33+
34+
.. currentmodule:: executorch.devtools.etrecord._etrecord
35+
.. autofunction:: generate_etrecord
36+
37+
Using an ``ETRecord``
38+
---------------------
39+
40+
Pass the ``ETRecord`` as an optional argument into the `Inspector API <sdk-inspector.html>`__ to access this data and do post-run analysis.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Topics in this section will help you get started with ExecuTorch.
202202

203203
devtools-overview
204204
sdk-bundled-io
205-
sdk-etrecord
205+
etrecord
206206
sdk-etdump
207207
sdk-profiling
208208
sdk-debugging

docs/source/llm/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ Through the ExecuTorch Developer Tools, users are able to profile model executio
752752

753753
##### ETRecord generation (Optional)
754754

755-
An ETRecord is an artifact generated at the time of export that contains model graphs and source-level metadata linking the ExecuTorch program to the original PyTorch model. You can view all profiling events without an ETRecord, though with an ETRecord, you will also be able to link each event to the types of operators being executed, module hierarchy, and stack traces of the original PyTorch source code. For more information, see [the ETRecord docs](../sdk-etrecord.md).
755+
An ETRecord is an artifact generated at the time of export that contains model graphs and source-level metadata linking the ExecuTorch program to the original PyTorch model. You can view all profiling events without an ETRecord, though with an ETRecord, you will also be able to link each event to the types of operators being executed, module hierarchy, and stack traces of the original PyTorch source code. For more information, see [the ETRecord docs](../etrecord.md).
756756

757757

758758
In your export script, after calling `to_edge()` and `to_executorch()`, call `generate_etrecord()` with the `EdgeProgramManager` from `to_edge()` and the `ExecuTorchProgramManager` from `to_executorch()`. Make sure to copy the `EdgeProgramManager`, as the call to `to_backend()` mutates the graph in-place.

docs/source/sdk-debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Currently, ExecuTorch supports the following debugging flows:
1313
### Runtime
1414
For a real example reflecting the steps below, please refer to [example_runner.cpp](https://github.com/pytorch/executorch/blob/main/examples/devtools/example_runner/example_runner.cpp).
1515

16-
1. [Optional] Generate an [ETRecord](./sdk-etrecord.rst) while exporting your model. When provided, this enables users to link profiling information back to the eager model source code (with stack traces and module hierarchy).
16+
1. [Optional] Generate an [ETRecord](./etrecord.rst) while exporting your model. When provided, this enables users to link profiling information back to the eager model source code (with stack traces and module hierarchy).
1717
2. Integrate [ETDump generation](./sdk-etdump.md) into the runtime and set the debugging level by configuring the `ETDumpGen` object. Then, provide an additional buffer to which intermediate outputs and program outputs will be written. Currently we support two levels of debugging:
1818
- Program level outputs
1919
```C++

docs/source/sdk-etrecord.rst

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,4 @@
11
Prerequisite | ETRecord - ExecuTorch Record
22
===========================================
33

4-
Overview
5-
--------
6-
7-
``ETRecord`` is intended to be the debug artifact that is generated by
8-
users ahead of time (when they export their model to run on ExecuTorch).
9-
To draw a rough equivalent to conventional software development,
10-
``ETRecord`` can be considered as the binary built with debug symbols
11-
that is used for debugging in GNU Debugger (gdb). It is expected that
12-
the user will supply this to the ExecuTorch Developer Tools in order for
13-
them to debug and visualize their model.
14-
15-
``ETRecord`` contains numerous components such as:
16-
17-
* Edge dialect graph with debug handles
18-
* Delegate debug handle maps
19-
20-
The ``ETRecord`` object itself is intended to be opaque to users and they should not access any components inside it directly.
21-
It should be provided to the `Inspector API <sdk-inspector.html>`__ to link back performance and debug data sourced from the runtime back to the Python source code.
22-
23-
Generating an ``ETRecord``
24-
--------------------------
25-
26-
The user should use the following API to generate an ``ETRecord`` file. They
27-
will be expected to provide the Edge Dialect program (returned by the call to ``to_edge()``),
28-
the ExecuTorch program (returned by the call to ``to_executorch()``), and optional models that
29-
they are interested in working with via our tooling.
30-
31-
.. warning::
32-
Users should do a deepcopy of the output of ``to_edge()`` and pass in the deepcopy to the ``generate_etrecord`` API. This is needed because the subsequent call, ``to_executorch()``, does an in-place mutation and will lose debug data in the process.
33-
34-
.. currentmodule:: executorch.devtools.etrecord._etrecord
35-
.. autofunction:: generate_etrecord
36-
37-
Using an ``ETRecord``
38-
---------------------
39-
40-
Pass the ``ETRecord`` as an optional argument into the `Inspector API <sdk-inspector.html>`__ to access this data and do post-run analysis.
4+
Please update your link to <https://pytorch.org/executorch/main/etrecord.html>. This URL will be deleted after v0.4.0.

docs/source/sdk-inspector.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Overview
55
--------
66

77
The Inspector APIs provide a convenient interface for analyzing the
8-
contents of `ETRecord <sdk-etrecord.html>`__ and
8+
contents of `ETRecord <etrecord.html>`__ and
99
`ETDump <sdk-etdump.html>`__, helping developers get insights about model
1010
architecture and performance statistics. It’s built on top of the `EventBlock Class <#eventblock-class>`__ data structure,
1111
which organizes a group of `Event <#event-class>`__\ s for easy access to details of profiling events.

docs/source/sdk-profiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We provide access to all the profiling data via the Python [Inspector API](./sdk
1313

1414
## Steps to Profile a Model in ExecuTorch
1515

16-
1. [Optional] Generate an [ETRecord](./sdk-etrecord.rst) while you're exporting your model. If provided this will enable users to link back profiling details to eager model source code (with stack traces and module hierarchy).
16+
1. [Optional] Generate an [ETRecord](./etrecord.rst) while you're exporting your model. If provided this will enable users to link back profiling details to eager model source code (with stack traces and module hierarchy).
1717
2. Build the runtime with the pre-processor flags that enable profiling. Detailed in the [ETDump documentation](./sdk-etdump.md).
1818
3. Run your Program on the ExecuTorch runtime and generate an [ETDump](./sdk-etdump.md).
1919
4. Create an instance of the [Inspector API](./sdk-inspector.rst) by passing in the ETDump you have sourced from the runtime along with the optionally generated ETRecord from step 1.

docs/source/tutorials_source/devtools-integration-tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# This tutorial will show a full end-to-end flow of how to utilize the Developer Tools to profile a model.
2121
# Specifically, it will:
2222
#
23-
# 1. Generate the artifacts consumed by the Developer Tools (`ETRecord <../sdk-etrecord.html>`__, `ETDump <../sdk-etdump.html>`__).
23+
# 1. Generate the artifacts consumed by the Developer Tools (`ETRecord <../etrecord.html>`__, `ETDump <../sdk-etdump.html>`__).
2424
# 2. Create an Inspector class consuming these artifacts.
2525
# 3. Utilize the Inspector class to analyze the model profiling result.
2626

@@ -296,6 +296,6 @@ def forward(self, x):
296296
# ^^^^^^^^^^^^^^^
297297
#
298298
# - `ExecuTorch Developer Tools Overview <../devtools-overview.html>`__
299-
# - `ETRecord <../sdk-etrecord.html>`__
299+
# - `ETRecord <../etrecord.html>`__
300300
# - `ETDump <../sdk-etdump.html>`__
301301
# - `Inspector <../sdk-inspector.html>`__

0 commit comments

Comments
 (0)