Skip to content

Commit e7c9c9e

Browse files
committed
Arm backend: Rebase aot_arm_compiler
Signed-off-by: Martin Lindström <Martin.Lindstroem@arm.com> Change-Id: I2a7f00efc9c7648c2944840bcf7427a5d801591b
1 parent 65eb62e commit e7c9c9e

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

backends/arm/scripts/aot_arm_compiler.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,12 +1093,6 @@ def main() -> None: # noqa: C901
10931093
os.makedirs(args.output, exist_ok=True)
10941094
output_file_name = os.path.join(args.output, output_file_name)
10951095

1096-
if args.bundleio or args.etrecord:
1097-
etrecord_file_name = os.path.splitext(output_file_name)[0] + "_etrecord.bin"
1098-
# Generate ETRecord
1099-
generate_etrecord(etrecord_file_name, edge_program_manager_copy, exec_prog)
1100-
print(f"ETRecord saved as {etrecord_file_name}")
1101-
11021096
if args.bundleio:
11031097
# Realize the quantization impact on numerics when generating reference output
11041098
reference_model = original_model if not model_quant else model_quant
@@ -1110,6 +1104,19 @@ def main() -> None: # noqa: C901
11101104
save_pte_program(exec_prog, output_file_name)
11111105
print(f"PTE file saved as {output_file_name}")
11121106

1107+
if args.bundleio or args.etrecord:
1108+
etrecord_file_name = os.path.splitext(output_file_name)[0] + "_etrecord.bin"
1109+
try:
1110+
generate_etrecord(etrecord_file_name, edge_program_manager_copy, exec_prog)
1111+
print(f"ETRecord saved as {etrecord_file_name}")
1112+
except Exception as e:
1113+
# Treat ETRecord failures as non-fatal only when generated as a side-effect
1114+
# of --bundleio. When --etrecord is explicitly requested, fail loudly.
1115+
if args.bundleio and not args.etrecord:
1116+
logging.warning(f"ETRecord generation failed (non-fatal): {e}")
1117+
else:
1118+
raise
1119+
11131120

11141121
if __name__ == "__main__":
11151122
main()

0 commit comments

Comments
 (0)