Skip to content

Commit 4d3a1c8

Browse files
authored
Arm backend: Don't fall back to TOSA-1.0+INT in case of exception (pytorch#17484)
aot_arm_compiler.py silently fell back to TOSA-1.0+INT in case the user-provided TOSA spec could not be created. This may easily mislead the user by hiding actual errors with the input to the program. Change aot_arm_compiler.py to instead raising the exception in case the user-provided TOSA spec can not be created. Signed-off-by: Martin Lindström <Martin.Lindstroem@arm.com>
1 parent bd6a75d commit 4d3a1c8

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

‎backends/arm/scripts/pre-push‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ VERBS="Add|Fix|Update|Refactor|Improve|Remove|Change|Implement|Create|Modify|"\
3333
"Handle|Ignore|Interpret|Instantiate|Invoke|Limit|Load|Modify|Permit|Print|"\
3434
"Profile|Recalculate|Reconstruct|Redefine|Redesign|Reevaluate|Relocate|Remap|"\
3535
"Render|Reposition|Request|Revert|Sanitize|Specify|Strengthen|Stub|Substitute|"\
36-
"Tag|Tweak|Unify|Unlock|Unset|Use|Validate|Verify|Rename|Relax|Format"
36+
"Tag|Tweak|Unify|Unlock|Unset|Use|Validate|Verify|Rename|Relax|Format|Don't"
3737

3838
# Remote branch
3939
REMOTE=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)

‎examples/arm/aot_arm_compiler.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,7 @@ def get_compile_spec(
435435
) -> TosaCompileSpec | EthosUCompileSpec | VgfCompileSpec:
436436
compile_spec = None
437437
if target.startswith("TOSA"):
438-
try:
439-
tosa_spec = TosaSpecification.create_from_string(target)
440-
except Exception:
441-
tosa_spec = TosaSpecification.create_from_string("TOSA-1.0+INT")
438+
tosa_spec = TosaSpecification.create_from_string(target)
442439
compile_spec = TosaCompileSpec(tosa_spec)
443440
elif "ethos-u" in target:
444441
extra_flags = ["--verbose-operators", "--verbose-cycle-estimate"]

0 commit comments

Comments
 (0)