Skip to content

Commit 8035f47

Browse files
tarun292facebook-github-bot
authored andcommitted
Profiling documentation (#631)
Summary: Pull Request resolved: #631 Reviewed By: Jack-Khuu Differential Revision: D49944911 Pulled By: tarun292 fbshipit-source-id: c947f12727accecc552d49c67e65c448a6b9c7bc
1 parent 4418dfd commit 8035f47

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

docs/source/sdk-debugging.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/source/sdk-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Introduction
1+
# Introduction to the ExecuTorch SDK
22

33
The ExecuTorch SDK is a set of tools designed to provide ExecuTorch users with the tooling they need to profile, debug, and visualize models that they have onboarded onto ExecuTorch.
44

docs/source/sdk-profiling.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1-
# Profiling
1+
# Profiling Models in ExecuTorch
22

3-
TBA
3+
Profiling in ExecuTorch gives users access to these runtime metrics:
4+
- Model loading time.
5+
- Operator level execution time
6+
- Delegate execution time
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
9+
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+
12+
We provide access to all the profiling data via the Python [Inspector API](./sdk-inspector.rst). The data mentioned above can be accessed through these interfaces, allowing users to perform any post-run analysis of their choice.
13+
14+
## Steps to Profile a Model in ExecuTorch
15+
16+
1. [Optional] Generate an [ETRecord](./sdk-etrecord.md) 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).
19+
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 ETRecord generated earlier (optional).
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+
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.

0 commit comments

Comments
 (0)