Skip to content

Inspector APIs Doc Updates #12657

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
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions devtools/inspector/_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,7 @@ def calculate_numeric_gap(self, distance: str = "MSE") -> pd.DataFrame:
distance: the metrics the inspector will use for gap calculation. Should be one of "MSE", "L1" and "SNR".

Returns:
pd.DataFrame: A DataFrame listing corresponding operator outputs from
both stages and their computed numerical gaps.
pd.DataFrame: A DataFrame listing corresponding operator outputs from both stages and their computed numerical gaps.
"""
aot_intermediate_outputs, aot_debug_handle_to_op_names = (
self._get_aot_intermediate_outputs_and_op_names()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/source/model-inspector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ get_exported_program
Equality constraints: []


calculate_numeric_gap
~~~~~~~~~~~~~~~~~~

.. autofunction:: executorch.devtools.Inspector.calculate_numeric_gap

.. _example-usage-4:

**Example Usage:**

.. code:: python

print(inspector.calculate_numeric_gap("L1"))

.. image:: _static/img/calculate_numeric_gap.png
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.

Inspector Attributes
--------------------

Expand Down
Loading