Skip to content

Commit e04d9ba

Browse files
jerryzh168facebook-github-bot
authored andcommitted
Re-enable inception_v4 quantization (#366)
Summary: Pull Request resolved: #366 previously it is disabled since it takes a long time to save the model, not sure if it just happens in my machine or it also affects CI Reviewed By: larryliu0820 Differential Revision: D49302580 fbshipit-source-id: 1bd48e58e2c220e67c15c4c17e83529aea62d8c9
1 parent 31a96ea commit e04d9ba

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

examples/quantization/example.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,19 @@ def verify_xnnpack_quantizer_matching_fx_quant_model(model_name, model, example_
160160
start = time.perf_counter()
161161
quantized_model = quantize(model, example_inputs)
162162
end = time.perf_counter()
163-
# logging.info(f"Quantize time: {end - start}s")
163+
logging.info(f"Quantize time: {end - start}s")
164164

165-
# TODO[T163161310]: takes a long time to export to exec prog and save inception_v4 quantized model
166-
if args.model_name != "ic4":
167-
168-
start = time.perf_counter()
169-
edge_compile_config = EdgeCompileConfig(_check_ir_validity=False)
170-
edge_m = export_to_edge(
171-
quantized_model, example_inputs, edge_compile_config=edge_compile_config
172-
)
173-
end = time.perf_counter()
165+
start = time.perf_counter()
166+
edge_compile_config = EdgeCompileConfig(_check_ir_validity=False)
167+
edge_m = export_to_edge(
168+
quantized_model, example_inputs, edge_compile_config=edge_compile_config
169+
)
170+
end = time.perf_counter()
171+
logging.info(f"Export time: {end - start}s")
174172

175-
start = time.perf_counter()
176-
prog = edge_m.to_executorch(None)
177-
save_pte_program(prog.buffer, f"{args.model_name}_quantized")
178-
end = time.perf_counter()
173+
start = time.perf_counter()
174+
prog = edge_m.to_executorch(None)
175+
save_pte_program(prog.buffer, f"{args.model_name}_quantized")
176+
end = time.perf_counter()
177+
logging.info(f"Save time: {end - start}s")
179178
logging.info("finished")

examples/recipes/xnnpack_optimization/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class OptimizationOptions(object):
2020
"mv2": OptimizationOptions(True, True),
2121
"mv3": OptimizationOptions(False, True),
2222
"ic4": OptimizationOptions(
23-
False, False
23+
True, False
2424
), # TODO[T163161310]: takes a long time to export to exec prog and save inception_v4 quantized model
2525
"w2l": OptimizationOptions(False, True),
2626
}

0 commit comments

Comments
 (0)