@@ -46,7 +46,6 @@ def verify_xnnpack_quantizer_matching_fx_quant_model(model_name, model, example_
46
46
m = prepare_pt2e (m , quantizer )
47
47
# calibration
48
48
after_prepare_result = m (* example_inputs )
49
- print ("pt2e prepare:" , m )
50
49
m = convert_pt2e (m )
51
50
after_quant_result = m (* example_inputs )
52
51
@@ -58,7 +57,6 @@ def verify_xnnpack_quantizer_matching_fx_quant_model(model_name, model, example_
58
57
m_copy , qconfig_mapping , example_inputs , backend_config = backend_config
59
58
)
60
59
after_prepare_result_fx = m_fx (* example_inputs )
61
- print ("fx prepare:" , m_fx )
62
60
m_fx = _convert_to_reference_decomposed_fx (m_fx , backend_config = backend_config )
63
61
after_quant_result_fx = m_fx (* example_inputs )
64
62
@@ -71,10 +69,10 @@ def verify_xnnpack_quantizer_matching_fx_quant_model(model_name, model, example_
71
69
print ("m_fx:" , m_fx )
72
70
print ("prepare sqnr:" , compute_sqnr (after_prepare_result , after_prepare_result_fx ))
73
71
assert compute_sqnr (after_prepare_result , after_prepare_result_fx ) > 100
74
- print ("diff max:" , torch .max (after_quant_result - after_quant_result_fx ))
75
- print ("sqnr:" , compute_sqnr (after_quant_result , after_quant_result_fx ))
72
+ print ("quant diff max:" , torch .max (after_quant_result - after_quant_result_fx ))
76
73
assert torch .max (after_quant_result - after_quant_result_fx ) < 1e-1
77
- assert compute_sqnr (after_quant_result , after_quant_result_fx ) > 35
74
+ print ("quant sqnr:" , compute_sqnr (after_quant_result , after_quant_result_fx ))
75
+ assert compute_sqnr (after_quant_result , after_quant_result_fx ) > 30
78
76
79
77
80
78
if __name__ == "__main__" :
@@ -123,7 +121,7 @@ def verify_xnnpack_quantizer_matching_fx_quant_model(model_name, model, example_
123
121
raise RuntimeError (
124
122
f"Model { args .model_name } is not a valid name. or not quantizable right now, "
125
123
"please contact executorch team if you want to learn why or how to support "
126
- "quantization for the requested model "
124
+ "quantization for the requested model"
127
125
f"Available models are { list (MODEL_NAME_TO_OPTIONS .keys ())} ."
128
126
)
129
127
0 commit comments