Skip to content

Commit 6f17947

Browse files
Olivia-liufacebook-github-bot
authored andcommitted
New URL for the ETDump page (#5809)
Summary: Pull Request resolved: #5809 This diff is to rename the "sdk-etdump" documentation page to just "etdump". Old URL: https://pytorch.org/executorch/main/sdk-etdump.html New URL ("sdk" is removed): https://pytorch.org/executorch/main/etdump.html Design doc: https://docs.google.com/document/d/1l6DYTq9Kq6VrPohruRFP-qScZDj01W_g4zlKyvqKGF4/edit?usp=sharing Reviewed By: dbort Differential Revision: D63738952 fbshipit-source-id: dda59dc74512aacd2ad168a36e567556b44baa2f
1 parent 011d42b commit 6f17947

File tree

13 files changed

+61
-58
lines changed

13 files changed

+61
-58
lines changed

backends/apple/mps/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ python3 -m examples.apple.mps.scripts.mps_example --model_name="mv3" --no-use_fp
116116
cd executorch
117117
python3 -m examples.apple.mps.scripts.mps_example --model_name="mv3" --generate_etrecord -b
118118
```
119-
2. Run your Program on the ExecuTorch runtime and generate an [ETDump](./sdk-etdump.md).
119+
2. Run your Program on the ExecuTorch runtime and generate an [ETDump](./etdump.md).
120120
```
121121
./cmake-out/examples/apple/mps/mps_executor_runner --model_path mv3_mps_bundled_fp16.pte --bundled_program --dump-outputs
122122
```

docs/source/build-run-coreml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ python3 -m examples.apple.coreml.scripts.export --model_name mv3 --generate_etre
100100
# Builds `coreml_executor_runner`.
101101
./examples/apple/coreml/scripts/build_executor_runner.sh
102102
```
103-
3. Run and generate an [ETDump](./sdk-etdump.md).
103+
3. Run and generate an [ETDump](./etdump.md).
104104
```bash
105105
cd executorch
106106

107107
# Generate the ETDump file.
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](./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](./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/devtools-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ETDump (ExecuTorch Dump) is the binary blob that is generated by the runtime aft
3636
If you only care about looking at the raw performance data without linking back to source code and other extensive features, an ETDump alone will be enough to leverage the basic features of the Developer Tools. For the full experience, it is recommended that the users also generate an ETRecord.
3737
```
3838

39-
More details are available in the [ETDump documentation](sdk-etdump.md) on how to generate and store an ETDump from the runtime.
39+
More details are available in the [ETDump documentation](etdump.md) on how to generate and store an ETDump from the runtime.
4040

4141

4242
### Inspector APIs

docs/source/etdump.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Prerequisite | ETDump - ExecuTorch Dump
2+
3+
ETDump (ExecuTorch Dump) is one of the core components of the ExecuTorch Developer Tools. It is the mechanism through which all forms of profiling and debugging data is extracted from the runtime. Users can't parse ETDump directly; instead, they should pass it into the Inspector API, which deserializes the data, offering interfaces for flexible analysis and debugging.
4+
5+
6+
## Generating an ETDump
7+
8+
Generating an ETDump is a relatively straightforward process. Users can follow the steps detailed below to integrate it into their application that uses ExecuTorch.
9+
10+
1. ***Include*** the ETDump header in your code.
11+
```C++
12+
#include <executorch/devtools/etdump/etdump_flatcc.h>
13+
```
14+
15+
2. ***Create*** an Instance of the ETDumpGen class and pass it into the `load_method` call that is invoked in the runtime.
16+
17+
```C++
18+
torch::executor::ETDumpGen etdump_gen = torch::executor::ETDumpGen();
19+
Result<Method> method =
20+
program->load_method(method_name, &memory_manager, &etdump_gen);
21+
```
22+
23+
3. ***Dump Out the ETDump Buffer*** - after the inference iterations have been completed, users can dump out the ETDump buffer. If users are on a device which has a filesystem, they could just write it out to the filesystem. For more constrained embedded devices, users will have to extract the ETDump buffer from the device through a mechanism that best suits them (e.g. UART, JTAG etc.)
24+
25+
```C++
26+
etdump_result result = etdump_gen.get_etdump_data();
27+
if (result.buf != nullptr && result.size > 0) {
28+
// On a device with a file system users can just write it out
29+
// to the file-system.
30+
FILE* f = fopen(FLAGS_etdump_path.c_str(), "w+");
31+
fwrite((uint8_t*)result.buf, 1, result.size, f);
32+
fclose(f);
33+
free(result.buf);
34+
}
35+
```
36+
37+
4. ***Compile*** your binary using CMake with the `ET_EVENT_TRACER_ENABLED` pre-processor flag to enable events to be traced and logged into ETDump inside the ExecuTorch runtime. This flag needs to be added to the ExecuTorch library and any operator library that you are compiling into your binary. For reference, you can take a look at `examples/sdk/CMakeLists.txt`. The lines of interest are:
38+
```
39+
target_compile_options(executorch INTERFACE -DET_EVENT_TRACER_ENABLED)
40+
target_compile_options(portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED)
41+
```
42+
## Using an ETDump
43+
44+
Pass this ETDump into the [Inspector API](./sdk-inspector.rst) to access this data and do post-run analysis.

docs/source/extension-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Most of the ExecuTorch APIs, including those described above, return either `Res
134134

135135
### Profile the Module
136136

137-
Use [ExecuTorch Dump](sdk-etdump.md) to trace model execution. Create an instance of the `ETDumpGen` class and pass it to the `Module` constructor. After executing a method, save the `ETDump` to a file for further analysis. You can capture multiple executions in a single trace if desired.
137+
Use [ExecuTorch Dump](etdump.md) to trace model execution. Create an instance of the `ETDumpGen` class and pass it to the `Module` constructor. After executing a method, save the `ETDump` to a file for further analysis. You can capture multiple executions in a single trace if desired.
138138

139139
```cpp
140140
#include <fstream>

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Topics in this section will help you get started with ExecuTorch.
203203
devtools-overview
204204
bundled-io
205205
etrecord
206-
sdk-etdump
206+
etdump
207207
sdk-profiling
208208
model-debugging
209209
sdk-inspector

docs/source/llm/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ Run the export script and the ETRecord will be generated as `etrecord.bin`.
774774

775775
##### ETDump generation
776776

777-
An ETDump is an artifact generated at runtime containing a trace of the model execution. For more information, see [the ETDump docs](../sdk-etdump.md).
777+
An ETDump is an artifact generated at runtime containing a trace of the model execution. For more information, see [the ETDump docs](../etdump.md).
778778

779779
Include the ETDump header in your code.
780780
```cpp

docs/source/model-debugging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Currently, ExecuTorch supports the following debugging flows:
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

1616
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).
17-
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:
17+
2. Integrate [ETDump generation](./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++
2020
Span<uint8_t> buffer((uint8_t*)debug_buffer, debug_buffer_size);
@@ -30,8 +30,8 @@ For a real example reflecting the steps below, please refer to [example_runner.c
3030
etdump_gen.set_event_tracer_debug_level(
3131
EventTracerDebugLogLevel::kIntermediateOutputs);
3232
```
33-
3. Build the runtime with the pre-processor flag that enables tracking of debug events. Instructions are in the [ETDump documentation](./sdk-etdump.md).
34-
4. Run your model and dump out the ETDump buffer as described [here](./sdk-etdump.md). (Do so similarly for the debug buffer if configured above)
33+
3. Build the runtime with the pre-processor flag that enables tracking of debug events. Instructions are in the [ETDump documentation](./etdump.md).
34+
4. Run your model and dump out the ETDump buffer as described [here](./etdump.md). (Do so similarly for the debug buffer if configured above)
3535

3636

3737
### Accessing the debug outputs post run using the Inspector API's

docs/source/sdk-etdump.md

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
11
# Prerequisite | ETDump - ExecuTorch Dump
22

3-
ETDump (ExecuTorch Dump) is one of the core components of the ExecuTorch Developer Tools. It is the mechanism through which all forms of profiling and debugging data is extracted from the runtime. Users can't parse ETDump directly; instead, they should pass it into the Inspector API, which deserializes the data, offering interfaces for flexible analysis and debugging.
4-
5-
6-
## Generating an ETDump
7-
8-
Generating an ETDump is a relatively straightforward process. Users can follow the steps detailed below to integrate it into their application that uses ExecuTorch.
9-
10-
1. ***Include*** the ETDump header in your code.
11-
```C++
12-
#include <executorch/devtools/etdump/etdump_flatcc.h>
13-
```
14-
15-
2. ***Create*** an Instance of the ETDumpGen class and pass it into the `load_method` call that is invoked in the runtime.
16-
17-
```C++
18-
torch::executor::ETDumpGen etdump_gen = torch::executor::ETDumpGen();
19-
Result<Method> method =
20-
program->load_method(method_name, &memory_manager, &etdump_gen);
21-
```
22-
23-
3. ***Dump Out the ETDump Buffer*** - after the inference iterations have been completed, users can dump out the ETDump buffer. If users are on a device which has a filesystem, they could just write it out to the filesystem. For more constrained embedded devices, users will have to extract the ETDump buffer from the device through a mechanism that best suits them (e.g. UART, JTAG etc.)
24-
25-
```C++
26-
etdump_result result = etdump_gen.get_etdump_data();
27-
if (result.buf != nullptr && result.size > 0) {
28-
// On a device with a file system users can just write it out
29-
// to the file-system.
30-
FILE* f = fopen(FLAGS_etdump_path.c_str(), "w+");
31-
fwrite((uint8_t*)result.buf, 1, result.size, f);
32-
fclose(f);
33-
free(result.buf);
34-
}
35-
```
36-
37-
4. ***Compile*** your binary using CMake with the `ET_EVENT_TRACER_ENABLED` pre-processor flag to enable events to be traced and logged into ETDump inside the ExecuTorch runtime. This flag needs to be added to the ExecuTorch library and any operator library that you are compiling into your binary. For reference, you can take a look at `examples/sdk/CMakeLists.txt`. The lines of interest are:
38-
```
39-
target_compile_options(executorch INTERFACE -DET_EVENT_TRACER_ENABLED)
40-
target_compile_options(portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED)
41-
```
42-
## Using an ETDump
43-
44-
Pass this ETDump into the [Inspector API](./sdk-inspector.rst) to access this data and do post-run analysis.
3+
Please update your link to <https://pytorch.org/executorch/main/etdump.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
@@ -6,7 +6,7 @@ Overview
66

77
The Inspector APIs provide a convenient interface for analyzing the
88
contents of `ETRecord <etrecord.html>`__ and
9-
`ETDump <sdk-etdump.html>`__, helping developers get insights about model
9+
`ETDump <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.
1212

docs/source/sdk-profiling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ We provide access to all the profiling data via the Python [Inspector API](./sdk
1414
## Steps to Profile a Model in ExecuTorch
1515

1616
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).
17-
2. Build the runtime with the pre-processor flags that enable profiling. Detailed in the [ETDump documentation](./sdk-etdump.md).
18-
3. Run your Program on the ExecuTorch runtime and generate an [ETDump](./sdk-etdump.md).
17+
2. Build the runtime with the pre-processor flags that enable profiling. Detailed in the [ETDump documentation](./etdump.md).
18+
3. Run your Program on the ExecuTorch runtime and generate an [ETDump](./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.
2020
- Through the Inspector API, users can do a wide range of analysis varying from printing out performance details to doing more finer granular calculation on module level.
2121

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 <../etrecord.html>`__, `ETDump <../sdk-etdump.html>`__).
23+
# 1. Generate the artifacts consumed by the Developer Tools (`ETRecord <../etrecord.html>`__, `ETDump <../etdump.html>`__).
2424
# 2. Create an Inspector class consuming these artifacts.
2525
# 3. Utilize the Inspector class to analyze the model profiling result.
2626

@@ -297,5 +297,5 @@ def forward(self, x):
297297
#
298298
# - `ExecuTorch Developer Tools Overview <../devtools-overview.html>`__
299299
# - `ETRecord <../etrecord.html>`__
300-
# - `ETDump <../sdk-etdump.html>`__
300+
# - `ETDump <../etdump.html>`__
301301
# - `Inspector <../sdk-inspector.html>`__

extension/pybindings/pybindings.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _load_for_executorch(
136136
Args:
137137
path: File path to the ExecuTorch program as a string.
138138
enable_etdump: If true, enables an ETDump which can store profiling information.
139-
See documentation at https://pytorch.org/executorch/stable/sdk-etdump.html
139+
See documentation at https://pytorch.org/executorch/stable/etdump.html
140140
for how to use it.
141141
debug_buffer_size: If non-zero, enables a debug buffer which can store
142142
intermediate results of each instruction in the ExecuTorch program.

0 commit comments

Comments
 (0)