diff --git a/devtools/inspector/_inspector.py b/devtools/inspector/_inspector.py index 5a083655f2a..a82b97c3474 100644 --- a/devtools/inspector/_inspector.py +++ b/devtools/inspector/_inspector.py @@ -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() diff --git a/docs/source/_static/img/calculate_numeric_gap.png b/docs/source/_static/img/calculate_numeric_gap.png new file mode 100644 index 00000000000..35def24cf84 Binary files /dev/null and b/docs/source/_static/img/calculate_numeric_gap.png differ diff --git a/docs/source/model-inspector.rst b/docs/source/model-inspector.rst index d80a8960b1b..3f541dd10b3 100644 --- a/docs/source/model-inspector.rst +++ b/docs/source/model-inspector.rst @@ -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 --------------------