Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions examples/arm/aot_arm_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,13 @@ def get_args():
default="Arm/vela.ini",
help="Specify custom vela configuration file (vela.ini)",
)
parser.add_argument(
"--non_strict_export",
dest="strict_export",
required=False,
action="store_false",
help="Disable strict checking while exporting models.",
)
args = parser.parse_args()

if args.evaluate and (
Expand Down Expand Up @@ -696,7 +703,7 @@ def quantize_model(args, model: torch.nn.Module, example_inputs, compile_spec):
)
# Wrap quantized model back into an exported_program
exported_program = torch.export.export_for_training(
model_int8, example_inputs, strict=True
model_int8, example_inputs, strict=args.strict_export
)

return model_int8, exported_program
Expand Down Expand Up @@ -791,7 +798,7 @@ def transform_for_cortex_m_backend(edge):
# export_for_training under the assumption we quantize, the exported form also works
# in to_edge if we don't quantize
exported_program = torch.export.export_for_training(
model, example_inputs, strict=True
model, example_inputs, strict=args.strict_export
)
model = exported_program.module()
model_fp32 = model
Expand Down
Loading