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 23
23
import torch
24
24
25
25
from executorch .devtools .etrecord import generate_etrecord
26
+ from executorch .devtools .backend_debug import get_delegation_info
27
+ from tabulate import tabulate
26
28
from executorch .exir .passes .init_mutable_pass import InitializedMutableBufferPass
27
29
28
30
from executorch .extension .llm .export .builder import DType , LLMEdgeManager
@@ -816,6 +818,13 @@ def _export_llama(args) -> LLMEdgeManager: # noqa: C901
816
818
817
819
builder = builder .to_executorch (passes = additional_passes )
818
820
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
+
819
828
if args .profile_memory :
820
829
generate_memory_trace (builder .export_program , "memory_profile.json" )
821
830
You can’t perform that action at this time.
0 commit comments