Skip to content

Commit 8dea0e3

Browse files
Resnet-like model checked
1 parent c47d09d commit 8dea0e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/openvino/aot/aot_openvino_compiler.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def load_calibration_dataset(dataset_path: str):
6666

6767

6868
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()
7071

7172
print("PTQ: Annotate the model...")
7273
annotated_model = prepare_pt2e(model, quantizer)
@@ -100,12 +101,12 @@ def main(suite: str, model_name: str, input_shape, quantize: bool, dataset_path:
100101
# Quantize model
101102
if not dataset_path:
102103
raise ValueError("Quantization requires a calibration dataset.")
103-
calibration_dataset = load_calibration_dataset(dataset_path)
104+
#calibration_dataset = load_calibration_dataset(dataset_path)
104105

105106
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")
107108
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")
109110
aten_dialect: ExportedProgram = export(quantized_model, example_args)
110111

111112
# Convert to edge dialect

0 commit comments

Comments
 (0)