Skip to content

Commit dc557a7

Browse files
Juntian777facebook-github-bot
authored andcommitted
Inspector APIs Doc Updates (#12657)
Summary: Pull Request resolved: #12657 This PR updates the Inspector APIs' documentation to introduce the calculate_numeric_gap for the executorch 0.7 release. Differential Revision: D78595467
1 parent 4d7f9ca commit dc557a7

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

devtools/inspector/_inspector.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,8 +1385,7 @@ def calculate_numeric_gap(self, distance: str = "MSE") -> pd.DataFrame:
13851385
distance: the metrics the inspector will use for gap calculation. Should be one of "MSE", "L1" and "SNR".
13861386
13871387
Returns:
1388-
pd.DataFrame: A DataFrame listing corresponding operator outputs from
1389-
both stages and their computed numerical gaps.
1388+
pd.DataFrame: A DataFrame listing corresponding operator outputs from both stages and their computed numerical gaps.
13901389
"""
13911390
aot_intermediate_outputs, aot_debug_handle_to_op_names = (
13921391
self._get_aot_intermediate_outputs_and_op_names()
814 KB
Loading

docs/source/model-inspector.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,22 @@ get_exported_program
106106
Equality constraints: []
107107

108108

109+
calculate_numeric_gap
110+
~~~~~~~~~~~~~~~~~~
111+
112+
.. autofunction:: executorch.devtools.Inspector.calculate_numeric_gap
113+
114+
.. _example-usage-4:
115+
116+
**Example Usage:**
117+
118+
.. code:: python
119+
120+
print(inspector.calculate_numeric_gap("L1"))
121+
122+
.. image:: _static/img/calculate_numeric_gap.png
123+
This table compares the intermediate outputs of operations between ahead-of-time (AOT) and runtime. The columns show debug handles, intermediate outputs from both AOT and runtime, and the L1(user defined) gap between them. Later, we will change the debug_handle to operator names to better improve readability and interpretability of the results.
124+
109125
Inspector Attributes
110126
--------------------
111127

0 commit comments

Comments
 (0)