Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.87 KB

etrecord.rst

File metadata and controls

40 lines (29 loc) · 1.87 KB

Prerequisite | ETRecord - ExecuTorch Record

Overview

ETRecord is intended to be the debug artifact that is generated by users ahead of time (when they export their model to run on ExecuTorch). To draw a rough equivalent to conventional software development, ETRecord can be considered as the binary built with debug symbols that is used for debugging in GNU Debugger (gdb). It is expected that the user will supply this to the ExecuTorch Developer Tools in order for them to debug and visualize their model.

ETRecord contains numerous components such as:

  • Edge dialect graph with debug handles
  • Delegate debug handle maps

The ETRecord object itself is intended to be opaque to users and they should not access any components inside it directly. It should be provided to the Inspector API to link back performance and debug data sourced from the runtime back to the Python source code.

Generating an ETRecord

The user should use the following API to generate an ETRecord file. They will be expected to provide the Edge Dialect program (returned by the call to to_edge()), the ExecuTorch program (returned by the call to to_executorch()), and optional models that they are interested in working with via our tooling.

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 lose debug data in the process.

.. currentmodule:: executorch.devtools.etrecord._etrecord
.. autofunction:: generate_etrecord

Using an ETRecord

Pass the ETRecord as an optional argument into the Inspector API to access this data and do post-run analysis.