Skip to content

Commit cac85df

Browse files
Gasoonjiafacebook-github-bot
authored andcommitted
reformat inspector doc for better demo (#15325)
Summary: as title Differential Revision: D85183062
1 parent 06b65a9 commit cac85df

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

devtools/inspector/_inspector.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,10 +1036,8 @@ def __init__(
10361036
source_time_scale: The time scale of the performance data retrieved from the runtime. The default time hook implentation in the runtime returns NS.
10371037
target_time_scale: The target time scale to which the users want their performance data converted to. Defaults to MS.
10381038
debug_buffer_path: Debug buffer file path that contains the debug data referenced by ETDump for intermediate and program outputs.
1039-
delegate_metadata_parser: Optional function to parse delegate metadata from an Profiling Event. Expected signature of the function is:
1040-
(delegate_metadata_list: List[bytes]) -> Union[List[str], Dict[str, Any]]
1041-
delegate_time_scale_converter: Optional function to convert the time scale of delegate profiling data. If not given, use the conversion ratio of
1042-
target_time_scale/source_time_scale.
1039+
delegate_metadata_parser: Optional function to parse delegate metadata from an Profiling Event. Expected signature of the function is (delegate_metadata_list: List[bytes]) -> Union[List[str], Dict[str, Any]].
1040+
delegate_time_scale_converter: Optional function to convert the time scale of delegate profiling data. If not given, use the conversion ratio of target_time_scale/source_time_scale.
10431041
enable_module_hierarchy: Enable submodules in the operator graph. Defaults to False.
10441042
10451043
Returns:
@@ -1306,10 +1304,9 @@ def print_data_tabular(
13061304
Displays the underlying EventBlocks in a structured tabular format, with each row representing an Event.
13071305
13081306
Args:
1309-
file: Which IO stream to print to. Defaults to stdout.
1310-
Not used if this is in an IPython environment such as a Jupyter notebook.
1311-
include_units: Whether headers should include units (default true)
1312-
include_delegate_debug_data: Whether to include delegate debug metadata (default false)
1307+
file: Which IO stream to print to. Defaults to stdout. Not used if this is in an IPython environment such as a Jupyter notebook.
1308+
include_units: Whether headers should include units (default true).
1309+
include_delegate_debug_data: Whether to include delegate debug metadata (default false).
13131310
13141311
Returns:
13151312
None
@@ -1419,12 +1416,12 @@ def calculate_numeric_gap(
14191416
compare the intermediate outputs from the AOT and the runtime.
14201417
14211418
Args:
1422-
distance: the metrics the inspector will use for gap calculation. Should be one of "MSE", "L1" and "SNR".
1423-
disable_debug_handle_validation: Often when aten graph has symbolic shape nodes, and inbuilt ops like gt/lt etc.,
1424-
during re-export of such a graph 'from_node' information is lost from node.meta. As a result we loose connection
1425-
between edge IR nodes and aten nodes for such ops. By default we validate that every edge IR node has corresponding
1426-
node in aten IR, and when such validation fails numeric debugger falls back to edge IR as reference graph. This
1427-
flag allows one to override such behavior and make best effort comparison.
1419+
distance: The metrics the inspector will use for gap calculation. Should be one of "MSE", "L1" and "SNR".
1420+
disable_debug_handle_validation: Often when aten graph has symbolic shape nodes and inbuilt ops like gt/lt etc.,
1421+
during re-export of such a graph 'from_node' information is lost from node.meta. As a result we loose
1422+
connection between edge IR nodes and aten nodes for such ops. By default we validate that every edge IR
1423+
node has corresponding node in aten IR, and when such validation fails numeric debugger falls back to edge
1424+
IR as reference graph. This flag allows one to override such behavior and make best effort comparison.
14281425
14291426
Returns:
14301427
pd.DataFrame: A DataFrame listing corresponding operator intermediate outputs from both stages and their computed numerical gaps.

docs/source/model-inspector.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Inspector Methods
2626
Constructor
2727
~~~~~~~~~~~
2828

29-
.. autofunction:: executorch.devtools.Inspector.__init__
29+
.. automethod:: executorch.devtools.Inspector.__init__
3030

3131
**Example Usage:**
3232

@@ -39,13 +39,13 @@ Constructor
3939
to_dataframe
4040
~~~~~~~~~~~~~~~~
4141

42-
.. autofunction:: executorch.devtools.Inspector.to_dataframe
42+
.. automethod:: executorch.devtools.Inspector.to_dataframe
4343

4444

4545
print_data_tabular
4646
~~~~~~~~~~~~~~~~~~
4747

48-
.. autofunction:: executorch.devtools.Inspector.print_data_tabular
48+
.. automethod:: executorch.devtools.Inspector.print_data_tabular
4949

5050
.. _example-usage-1:
5151

@@ -62,7 +62,7 @@ Note that the unit of delegate profiling events is "cycles". We're working on pr
6262
find_total_for_module
6363
~~~~~~~~~~~~~~~~~~~~~
6464

65-
.. autofunction:: executorch.devtools.Inspector.find_total_for_module
65+
.. automethod:: executorch.devtools.Inspector.find_total_for_module
6666

6767
.. _example-usage-2:
6868

@@ -80,7 +80,7 @@ find_total_for_module
8080
get_exported_program
8181
~~~~~~~~~~~~~~~~~~~~
8282

83-
.. autofunction:: executorch.devtools.Inspector.get_exported_program
83+
.. automethod:: executorch.devtools.Inspector.get_exported_program
8484

8585
.. _example-usage-3:
8686

@@ -109,7 +109,7 @@ get_exported_program
109109
calculate_numeric_gap
110110
~~~~~~~~~~~~~~~~~~
111111

112-
.. autofunction:: executorch.devtools.Inspector.calculate_numeric_gap
112+
.. automethod:: executorch.devtools.Inspector.calculate_numeric_gap
113113

114114
.. _example-usage-4:
115115

0 commit comments

Comments
 (0)