@@ -118,6 +118,8 @@ def get_descendent_quant_ops(self, node: torch.fx.Node) -> List[torch.fx.Node]:
118118 if user_target in {
119119 torch .ops .quantized_decomposed .quantize_per_tensor ,
120120 exir_ops .edge .quantized_decomposed .quantize_per_tensor ,
121+ torch .ops .cadence .quantize_per_tensor ,
122+ exir_ops .edge .cadence .quantize_per_tensor ,
121123 }:
122124 descendent_quant_ops .append (user )
123125 # If the successor is a trivially quantizable op, consider its users
@@ -300,6 +302,8 @@ def advance_quantize_op(self, graph_module: torch.fx.GraphModule):
300302 if get_overload_packet (node .target ) not in (
301303 exir_ops .edge .quantized_decomposed .quantize_per_tensor ,
302304 torch .ops .quantized_decomposed .quantize_per_tensor ,
305+ exir_ops .edge .cadence .quantize_per_tensor ,
306+ torch .ops .cadence .quantize_per_tensor ,
303307 ):
304308 continue
305309
@@ -413,6 +417,7 @@ def postponing_feasible(self, dequant_node: torch.fx.Node):
413417 in {
414418 exir_ops .edge .quantized_decomposed .quantize_per_tensor ,
415419 exir_ops .edge .quantized_decomposed .quantize_per_channel ,
420+ exir_ops .edge .cadence .quantize_per_tensor ,
416421 }
417422 for x in users
418423 )
@@ -422,6 +427,7 @@ def postpone_dequantize_op(self, graph_module: torch.fx.GraphModule) -> bool:
422427 packet_to_overload_map = {
423428 exir_ops .edge .quantized_decomposed .dequantize_per_tensor : "default" ,
424429 exir_ops .edge .quantized_decomposed .dequantize_per_channel : "default" ,
430+ exir_ops .edge .cadence .dequantize_per_tensor : "default" ,
425431 }
426432 graph = graph_module .graph
427433 modified = False
@@ -500,6 +506,7 @@ class SinkOpsCloserToUsePass(ExportPass):
500506 exir_ops .edge .aten .dequantize ,
501507 exir_ops .edge .quantized_decomposed .dequantize_per_tensor ,
502508 exir_ops .edge .quantized_decomposed .dequantize_per_channel ,
509+ exir_ops .edge .cadence .dequantize_per_tensor ,
503510 }
504511
505512 def sink_ops_closer_to_use (self , graph_module : torch .fx .GraphModule ):
@@ -558,6 +565,7 @@ class HoistOpsCloserToDefPass(ExportPass):
558565
559566 hoistable_ops : Set [EdgeOpOverload ] = {
560567 exir_ops .edge .quantized_decomposed .quantize_per_tensor ,
568+ exir_ops .edge .cadence .quantize_per_tensor ,
561569 exir_ops .edge .aten .slice_copy ,
562570 exir_ops .edge .aten .select_copy ,
563571 }
0 commit comments