@@ -299,7 +299,7 @@ def __init__(
299299 run_on_tosa_ref_model : bool = True ,
300300 tosa_version : str = "TOSA-0.80+BI" ,
301301 symmetric_io_quantization : bool = False ,
302- per_channel_quantization : bool = False ,
302+ per_channel_quantization : bool = True ,
303303 use_to_edge_transform_and_lower : bool = True ,
304304 custom_path : str = None ,
305305 atol : float = 1e-03 ,
@@ -316,16 +316,14 @@ def __init__(
316316 compile_spec = common .get_tosa_compile_spec (
317317 tosa_profiles [tosa_version ], custom_path = custom_path
318318 )
319- if symmetric_io_quantization or per_channel_quantization :
320- quantizer = TOSAQuantizer (tosa_profiles [tosa_version ])
321- quantization_config = get_symmetric_quantization_config (
322- is_per_channel = per_channel_quantization
323- )
324- if symmetric_io_quantization :
325- quantizer .set_io (quantization_config )
326- quant_stage = Quantize (quantizer , quantization_config )
327- else :
328- quant_stage = None
319+
320+ quantizer = TOSAQuantizer (tosa_profiles [tosa_version ])
321+ quantization_config = get_symmetric_quantization_config (
322+ is_per_channel = per_channel_quantization
323+ )
324+ if symmetric_io_quantization :
325+ quantizer .set_io (quantization_config )
326+ quant_stage = Quantize (quantizer , quantization_config )
329327
330328 super ().__init__ (
331329 module ,
@@ -474,24 +472,21 @@ def __init__(
474472 exir_ops : Optional [str | List [str ]] = None ,
475473 run_on_fvp : bool = True ,
476474 symmetric_io_quantization : bool = False ,
477- per_channel_quantization : bool = False ,
475+ per_channel_quantization : bool = True ,
478476 use_to_edge_transform_and_lower : bool = True ,
479477 custom_path : str = None ,
480478 atol : float = 1e-03 ,
481479 rtol : float = 1e-03 ,
482480 qtol : int = 1 ,
483481 ):
484482 compile_spec = common .get_u55_compile_spec (custom_path = custom_path )
485- if symmetric_io_quantization or per_channel_quantization :
486- quantizer = EthosUQuantizer (compile_spec )
487- quantization_config = get_symmetric_quantization_config (
488- is_per_channel = per_channel_quantization
489- )
490- if symmetric_io_quantization :
491- quantizer .set_io (quantization_config )
492- quant_stage = Quantize (quantizer , quantization_config )
493- else :
494- quant_stage = None
483+ quantizer = EthosUQuantizer (compile_spec )
484+ quantization_config = get_symmetric_quantization_config (
485+ is_per_channel = per_channel_quantization
486+ )
487+ if symmetric_io_quantization :
488+ quantizer .set_io (quantization_config )
489+ quant_stage = Quantize (quantizer , quantization_config )
495490
496491 super ().__init__ (
497492 module ,
@@ -564,24 +559,21 @@ def __init__(
564559 exir_ops : str | List [str ] = None ,
565560 run_on_fvp : bool = True ,
566561 symmetric_io_quantization : bool = False ,
567- per_channel_quantization : bool = False ,
562+ per_channel_quantization : bool = True ,
568563 use_to_edge_transform_and_lower : bool = True ,
569564 custom_path : str = None ,
570565 atol : float = 1e-03 ,
571566 rtol : float = 1e-03 ,
572567 qtol : int = 1 ,
573568 ):
574569 compile_spec = common .get_u85_compile_spec (custom_path = custom_path )
575- if symmetric_io_quantization or per_channel_quantization :
576- quantizer = EthosUQuantizer (compile_spec )
577- quantization_config = get_symmetric_quantization_config (
578- is_per_channel = per_channel_quantization
579- )
580- if symmetric_io_quantization :
581- quantizer .set_io (quantization_config )
582- quant_stage = Quantize (quantizer , quantization_config )
583- else :
584- quant_stage = None
570+ quantizer = EthosUQuantizer (compile_spec )
571+ quantization_config = get_symmetric_quantization_config (
572+ is_per_channel = per_channel_quantization
573+ )
574+ if symmetric_io_quantization :
575+ quantizer .set_io (quantization_config )
576+ quant_stage = Quantize (quantizer , quantization_config )
585577
586578 super ().__init__ (
587579 module ,
0 commit comments