Skip to content

SDK tutorial doc update #3238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions docs/source/tutorials_source/sdk-integration-tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# This tutorial will show a full end-to-end flow of how to utilize the SDK.
# Specifically, it will:
#
# 1. Generate the artifacts consumed by the SDK (`ETRecord <../sdk-etrecord>`__, `ETDump <../sdk-etdump.html>`__).
# 1. Generate the artifacts consumed by the SDK (`ETRecord <../sdk-etrecord.html>`__, `ETDump <../sdk-etdump.html>`__).
# 2. Create an Inspector class consuming these artifacts.
# 3. Utilize the Inspector class to analyze the model.

Expand All @@ -42,7 +42,7 @@
#
# ``executorch.sdk.generate_etrecord`` takes in an output file path (str), the
# edge dialect model (``EdgeProgramManager``), the ExecuTorch dialect model
# (``ExecutorchProgramManager``), and an optional dictionary of additional models
# (``ExecutorchProgramManager``), and an optional dictionary of additional models.
#
# In this tutorial, an example model (shown below) is used to demonstrate.

Expand Down Expand Up @@ -113,9 +113,9 @@ def forward(self, x):
######################################################################
#
# .. warning::
# 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
# 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.
#

Expand Down Expand Up @@ -169,21 +169,10 @@ def forward(self, x):
f.write(serialized_bundled_program)

######################################################################
# We provide 2 ways of executing the Bundled Model to generate the ``ETDump``:
#
# **Option 1:**
#
# Use Buck (follow `these instructions <../getting-started-setup.html#building-a-runtime>`__ to set up buck)::
#
# cd executorch
# buck2 run -c executorch.event_tracer_enabled=true examples/sdk/sdk_example_runner:sdk_example_runner -- --bundled_program_path <bundled_program>
#
# **Option 2:**
#
# Use CMake (follow `these instructions <../runtime-build-and-cross-compilation.html#configure-the-cmake-build>`__ to set up cmake)::
# Use CMake (follow `these instructions <../runtime-build-and-cross-compilation.html#configure-the-cmake-build>`__ to set up cmake) to execute the Bundled Program to generate the ``ETDump``::
#
# cd executorch
# rm -rf cmake-out && mkdir cmake-out && cd cmake-out && cmake -DBUCK2=buck2 -DEXECUTORCH_BUILD_SDK=1 -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=1 ..
# rm -rf cmake-out && mkdir cmake-out && cd cmake-out && cmake -DEXECUTORCH_BUILD_SDK=1 -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=1 ..
# cd ..
# cmake --build cmake-out -j8 -t sdk_example_runner
# ./cmake-out/examples/sdk/sdk_example_runner --bundled_program_path <bundled_program>
Expand Down Expand Up @@ -308,6 +297,6 @@ def forward(self, x):
# ^^^^^^^^^^^^^^^
#
# - `ExecuTorch SDK <../sdk-overview.html>`__
# - `ETRecord <../sdk-etrecord>`__
# - `ETRecord <../sdk-etrecord.html>`__
# - `ETDump <../sdk-etdump.html>`__
# - `Inspector <../sdk-inspector.html>`__
Loading