Skip to content
Merged
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
10 changes: 8 additions & 2 deletions devtools/inspector/_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,14 +1170,18 @@ def _get_aot_intermediate_outputs_and_op_names(

export_program = None

# Will use the exported program to extract intermediate output if and only if exported_program has been provided, and it is the greatest ancestor of the edge_dialect_program
# Will use the exported program to extract intermediate output if and only if exported_program has been provided, and it is one of the ancestors of the edge_dialect_program
if self._etrecord.exported_program and propagate_back_debug_handle(
self._etrecord.exported_program,
self._etrecord.export_graph_id,
self._etrecord.edge_dialect_program,
):
export_program = self._etrecord.exported_program
else:
log.warning(
"Either aten dialect exported program is not in ETRecord, or it is not one of the ancestors of current edge dialect program."
"Will fall back to use edge dialect program to extract intermediate output",
)
export_program = self._etrecord.edge_dialect_program
graph_module = export_program.module()
aot_debug_handle_to_op_name = get_aot_debug_handle_to_op_name_mapping(
Expand Down Expand Up @@ -1392,7 +1396,9 @@ def calculate_numeric_gap(self, distance: str = "MSE"):
"""
Compares logged intermediate outputs from the exported graph (in ETRecord)
with runtime outputs (in ETDump) using a user-specific numerical comparator.
To use this function, you must first generate the ETRecord using the `bundle_program`,
If the exported graph is not supported, the function will fall back to use edge dialect graph.

To use this function, you must first generate the ETRecord with representative inputs,
and then create the Inspector instance with the ETRecord and ETDump. The Inspector can then
compare the intermediate outputs from the AOT and the runtime.

Expand Down
Loading