You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding CMake and OSS Buck build details for ETDump (#779)
Summary:
Adding documentation on how to generate ETDump with CMake and Buck.
Pull Request resolved: #779
Reviewed By: Jack-Khuu
Differential Revision: D50127466
fbshipit-source-id: d698144514d61e5101a730bac72769882cbe1783
Copy file name to clipboardExpand all lines: docs/source/sdk-etdump.md
+19-16Lines changed: 19 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
ETDump (ExecuTorch Dump) is one of the core components of the ExecuTorch SDK experience. 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
4
5
5
6
-
## Generating an ETDump:
6
+
## Generating an ETDump
7
7
8
8
Generating an ETDump is a relatively straight forward process. Users can follow the steps detailed below to integrate it into their application that uses ExecuTorch.
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 file-system, they could just write it out to the fileystem. 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.)
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 file-system, they could just write it out to the fileystem. 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
24
25
25
```C++
26
26
etdump_result result = etdump_gen.get_etdump_data();
4.***Compile*** your binary with the flags that enable events to be traced and logged into ETDump inside the ExecuTorch runtime. The pre-processor flag that controls this is `ET_EVENT_TRACER_ENABLED`.
37
+
4.***Compile*** your binary with the `ET_EVENT_TRACER_ENABLED` flag to enable events to be traced and logged into ETDump inside the ExecuTorch runtime.
38
38
39
-
i). ***CMake***
39
+
i). ***Buck***
40
40
41
-
In CMake users can add this to their compile flags:
41
+
In Buck, users simply depend on the etdump target which is:
42
42
```
43
-
-DET_EVENT_TRACER_ENABLED
43
+
//executorch/sdk/etdump:etdump_flatcc
44
+
```
45
+
When compiling their binary through Buck, users can pass in this buck config to enable the pre-processor flag. For example, when compiling `sdk_example_runner` to enable ETDump generation, users compile using the following command:
In Buck users can simply depend on the etdump target which is:
52
+
In CMake, users add this to their compile flags:
49
53
```
50
-
//executorch/sdk/etdump:etdump_flatcc
54
+
-DET_EVENT_TRACER_ENABLED
51
55
```
52
-
When compiling their binary through Buck, users can pass in this buck config which will enable this pre-processor flag:
56
+
57
+
This flag needs to be added to the ExecuTorch library and any operator library that the users are compiling into their binary. For reference, users can take a look at `examples/sdk/CMakeLists.txt`. The lines of of interest are:
Copy file name to clipboardExpand all lines: docs/source/sdk-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ All the components of the SDK have been designed from the ground up with deep in
8
8
9
9
The ExecuTorch SDK supports the following features:
10
10
11
+
-**BundledProgram** is a utility tool for exporting the model bundled with a sample set of (representative) inputs and expected outputs, so that during runtime users can validate that the actual output is in fact the same as the expected output.
11
12
-**Profiling** models with operator level breakdown of performance stats
12
13
- Linking back operator performance stats to source code and module hierarchy
13
14
- Model loading and execution time
14
-
-**BundledProgram** is a utility tool for exporting the model bundled with a sample set of (representative) inputs and expected outputs, so that during runtime users can validate that the actual output is in fact the same as the expected output.
15
15
-**Delegate Integration** - Surfacing performance details from delegate backends
16
16
- Link back delegate operator execution to the nodes they represent in the edge dialect graph (and subsequently linking back to source code and module hierarchy)
17
17
-**Debugging** (Intermediate outputs and output quality analysis) - Coming soon
Copy file name to clipboardExpand all lines: docs/source/sdk-profiling.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# Profiling Models in ExecuTorch
2
2
3
3
Profiling in ExecuTorch gives users access to these runtime metrics:
4
-
- Model loading time.
5
-
- Operator level execution time
6
-
- Delegate execution time
4
+
- Model Load Time.
5
+
- Operator Level Execution Time.
6
+
- Delegate Execution Time.
7
7
- If the delegate that the user is calling into has been integrated with the [SDK](./sdk-delegate-integration.md), then users will also be able to access delegated operator execution time.
8
-
- End-to-end inference execution time
8
+
- End-to-end Inference Execution Time.
9
9
10
10
One uniqe aspect of ExecuTorch Profiling is the ability to link every runtime executed operator back to the exact line of python code from which this operator originated. This capability enables users to easily identify hotspots in their model, source them back to the exact line of Python code, and optimize if chosen to.
11
11
@@ -20,4 +20,4 @@ We provide access to all the profiling data via the Python [Inspector API](./sdk
20
20
- 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.
21
21
22
22
23
-
Please refer to the [SDK tutorial](link to SDK tutorial) for a step-by-step walkthrough of the above process on a sample model.
23
+
Please refer to the [SDK tutorial](./tutorials/sdk-integration-tutorial.rst) for a step-by-step walkthrough of the above process on a sample model.
0 commit comments