@@ -66,7 +66,8 @@ def load_calibration_dataset(dataset_path: str):
66
66
67
67
68
68
def quantize_model (model : torch .fx .GraphModule , example_args , subset_size = 300 ):
69
- quantizer = OpenVINOQuantizer (ignored_scope = nncf .IgnoredScope (types = ["__getitem__" , "layer_norm" ]))
69
+ #quantizer = OpenVINOQuantizer(ignored_scope=nncf.IgnoredScope(types=["__getitem__", "layer_norm"]))
70
+ quantizer = OpenVINOQuantizer ()
70
71
71
72
print ("PTQ: Annotate the model..." )
72
73
annotated_model = prepare_pt2e (model , quantizer )
@@ -100,12 +101,12 @@ def main(suite: str, model_name: str, input_shape, quantize: bool, dataset_path:
100
101
# Quantize model
101
102
if not dataset_path :
102
103
raise ValueError ("Quantization requires a calibration dataset." )
103
- calibration_dataset = load_calibration_dataset (dataset_path )
104
+ # calibration_dataset = load_calibration_dataset(dataset_path)
104
105
105
106
captured_model = aten_dialect .module ()
106
- visualize_fx_model (captured_model , f"{ model_name } _fp32.svg" )
107
+ # visualize_fx_model(captured_model, f"{model_name}_fp32.svg")
107
108
quantized_model = quantize_model (captured_model , example_args )
108
- visualize_fx_model (quantized_model , f"{ model_name } _int8.svg" )
109
+ # visualize_fx_model(quantized_model, f"{model_name}_int8.svg")
109
110
aten_dialect : ExportedProgram = export (quantized_model , example_args )
110
111
111
112
# Convert to edge dialect
0 commit comments