File tree Expand file tree Collapse file tree 4 files changed +361
-190
lines changed
Expand file tree Collapse file tree 4 files changed +361
-190
lines changed Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ python_unittest(
388388 "//caffe2:torch",
389389 "//executorch/backends/cadence/aot:compiler",
390390 "//executorch/backends/cadence/aot:fuse_ops",
391+ "//executorch/backends/cadence/aot:graph_builder",
391392 "//executorch/backends/cadence/aot:ops_registrations",
392393 "//executorch/backends/cadence/aot:pass_utils",
393394 "//executorch/backends/cadence/aot:reorder_ops",
Original file line number Diff line number Diff line change @@ -343,6 +343,9 @@ def quantize_and_export_to_cadence(
343343 """
344344 quantized_model = quantize_pt2 (model , inputs )
345345
346+ import fbvscode
347+ fbvscode .set_trace ()
348+
346349 return _lower_ep_to_cadence (
347350 quantized_model ,
348351 opt_level = opt_level ,
Original file line number Diff line number Diff line change @@ -143,6 +143,18 @@ def nodes_not_connected_in_gm(
143143 return False
144144 return True
145145
146+ # Returns the position of the first entry of a node of a given kind in the graph.
147+ def get_node_pos (
148+ graph_module : torch .fx .GraphModule ,
149+ target : torch .fx .Node ,
150+ ) -> int :
151+ pos = 0
152+ for node in graph_module .graph .nodes :
153+ if node .target == target :
154+ return pos
155+ pos += 1
156+ return - 1
157+
146158
147159# Returns true if there is no instance of a node with target succ_target
148160# positioned immediately after a node with target pred_target in the graph
You can’t perform that action at this time.
0 commit comments