@@ -300,7 +300,7 @@ def __init__(
300300 run_on_tosa_ref_model : bool = True ,
301301 tosa_version : str = "TOSA-0.80+BI" ,
302302 symmetric_io_quantization : bool = False ,
303- per_channel_quantization : bool = False ,
303+ per_channel_quantization : bool = True ,
304304 use_to_edge_transform_and_lower : bool = True ,
305305 custom_path : str = None ,
306306 atol : float = 1e-03 ,
@@ -317,16 +317,14 @@ def __init__(
317317 compile_spec = common .get_tosa_compile_spec (
318318 tosa_profiles [tosa_version ], custom_path = custom_path
319319 )
320- if symmetric_io_quantization or per_channel_quantization :
321- quantizer = TOSAQuantizer (tosa_profiles [tosa_version ])
322- quantization_config = get_symmetric_quantization_config (
323- is_per_channel = per_channel_quantization
324- )
325- if symmetric_io_quantization :
326- quantizer .set_io (quantization_config )
327- quant_stage = Quantize (quantizer , quantization_config )
328- else :
329- quant_stage = None
320+
321+ quantizer = TOSAQuantizer (tosa_profiles [tosa_version ])
322+ quantization_config = get_symmetric_quantization_config (
323+ is_per_channel = per_channel_quantization
324+ )
325+ if symmetric_io_quantization :
326+ quantizer .set_io (quantization_config )
327+ quant_stage = Quantize (quantizer , quantization_config )
330328
331329 super ().__init__ (
332330 module ,
@@ -475,24 +473,21 @@ def __init__(
475473 exir_ops : Optional [str | List [str ]] = None ,
476474 run_on_fvp : bool = True ,
477475 symmetric_io_quantization : bool = False ,
478- per_channel_quantization : bool = False ,
476+ per_channel_quantization : bool = True ,
479477 use_to_edge_transform_and_lower : bool = True ,
480478 custom_path : str = None ,
481479 atol : float = 1e-03 ,
482480 rtol : float = 1e-03 ,
483481 qtol : int = 1 ,
484482 ):
485483 compile_spec = common .get_u55_compile_spec (custom_path = custom_path )
486- if symmetric_io_quantization or per_channel_quantization :
487- quantizer = EthosUQuantizer (compile_spec )
488- quantization_config = get_symmetric_quantization_config (
489- is_per_channel = per_channel_quantization
490- )
491- if symmetric_io_quantization :
492- quantizer .set_io (quantization_config )
493- quant_stage = Quantize (quantizer , quantization_config )
494- else :
495- quant_stage = None
484+ quantizer = EthosUQuantizer (compile_spec )
485+ quantization_config = get_symmetric_quantization_config (
486+ is_per_channel = per_channel_quantization
487+ )
488+ if symmetric_io_quantization :
489+ quantizer .set_io (quantization_config )
490+ quant_stage = Quantize (quantizer , quantization_config )
496491
497492 super ().__init__ (
498493 module ,
@@ -565,24 +560,21 @@ def __init__(
565560 exir_ops : str | List [str ] = None ,
566561 run_on_fvp : bool = True ,
567562 symmetric_io_quantization : bool = False ,
568- per_channel_quantization : bool = False ,
563+ per_channel_quantization : bool = True ,
569564 use_to_edge_transform_and_lower : bool = True ,
570565 custom_path : str = None ,
571566 atol : float = 1e-03 ,
572567 rtol : float = 1e-03 ,
573568 qtol : int = 1 ,
574569 ):
575570 compile_spec = common .get_u85_compile_spec (custom_path = custom_path )
576- if symmetric_io_quantization or per_channel_quantization :
577- quantizer = EthosUQuantizer (compile_spec )
578- quantization_config = get_symmetric_quantization_config (
579- is_per_channel = per_channel_quantization
580- )
581- if symmetric_io_quantization :
582- quantizer .set_io (quantization_config )
583- quant_stage = Quantize (quantizer , quantization_config )
584- else :
585- quant_stage = None
571+ quantizer = EthosUQuantizer (compile_spec )
572+ quantization_config = get_symmetric_quantization_config (
573+ is_per_channel = per_channel_quantization
574+ )
575+ if symmetric_io_quantization :
576+ quantizer .set_io (quantization_config )
577+ quant_stage = Quantize (quantizer , quantization_config )
586578
587579 super ().__init__ (
588580 module ,
0 commit comments