File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2323import torch
2424
2525from executorch .devtools .etrecord import generate_etrecord
26+ from executorch .devtools .backend_debug import get_delegation_info
27+ from tabulate import tabulate
2628from executorch .exir .passes .init_mutable_pass import InitializedMutableBufferPass
2729
2830from executorch .extension .llm .export .builder import DType , LLMEdgeManager
@@ -816,6 +818,13 @@ def _export_llama(args) -> LLMEdgeManager: # noqa: C901
816818
817819 builder = builder .to_executorch (passes = additional_passes )
818820
821+ if args .verbose :
822+ graph_module = builder .edge_manager .exported_program ().graph_module
823+ delegation_info = get_delegation_info (graph_module )
824+ print (delegation_info .get_summary ())
825+ df = delegation_info .get_operator_delegation_dataframe ()
826+ print (tabulate (df , headers = "keys" , tablefmt = "fancy_grid" ))
827+
819828 if args .profile_memory :
820829 generate_memory_trace (builder .export_program , "memory_profile.json" )
821830
You can’t perform that action at this time.
0 commit comments