-
Notifications
You must be signed in to change notification settings - Fork 687
Arm backend: Backend test TOSA FP, INT and Ethos-U55/U85 #14653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
zingo
merged 4 commits into
pytorch:main
from
zingo:Arm-backend-Backend-test-both-TOSA-FP-and-TOSA-INT
Oct 1, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
23da52c
Arm backend: Backend test both TOSA FP and TOSA INT
zingo 7ff0cb7
Arm backend: Backend test Ethos-U55/Ethos-U85
zingo f7d5f2c
Merge branch 'main' into Arm-backend-Backend-test-both-TOSA-FP-and-TO…
zingo 71b3a6e
Merge branch 'main' into Arm-backend-Backend-test-both-TOSA-FP-and-TO…
zingo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,72 @@ | ||
# Copyright 2025 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
|
||
from executorch.backends.arm.quantizer import ( | ||
get_symmetric_quantization_config, | ||
TOSAQuantizer, | ||
) | ||
from executorch.backends.arm.test import common | ||
from executorch.backends.arm.test.tester.arm_tester import ArmTester | ||
from executorch.backends.test.suite.flow import TestFlow | ||
from executorch.backends.xnnpack.test.tester.tester import Quantize | ||
|
||
|
||
def _create_arm_tester_tosa_fp(*args, **kwargs) -> ArmTester: | ||
kwargs["compile_spec"] = common.get_tosa_compile_spec(tosa_spec="TOSA-1.0+FP") | ||
def _create_tosa_flow( | ||
name, | ||
compile_spec, | ||
quantize: bool = False, | ||
symmetric_io_quantization: bool = False, | ||
per_channel_quantization: bool = True, | ||
) -> TestFlow: | ||
|
||
return ArmTester( | ||
*args, | ||
**kwargs, | ||
) | ||
def _create_arm_tester(*args, **kwargs) -> ArmTester: | ||
kwargs["compile_spec"] = compile_spec | ||
|
||
return ArmTester( | ||
*args, | ||
**kwargs, | ||
) | ||
|
||
# Create and configure quantizer to use in the flow | ||
def create_quantize_stage() -> Quantize: | ||
quantizer = TOSAQuantizer(compile_spec) | ||
quantization_config = get_symmetric_quantization_config( | ||
is_per_channel=per_channel_quantization | ||
) | ||
if symmetric_io_quantization: | ||
quantizer.set_io(quantization_config) | ||
return Quantize(quantizer, quantization_config) | ||
|
||
def _create_tosa_flow() -> TestFlow: | ||
return TestFlow( | ||
"arm_tosa", | ||
name, | ||
backend="arm", | ||
tester_factory=_create_arm_tester_tosa_fp, | ||
tester_factory=_create_arm_tester, | ||
supports_serialize=False, | ||
quantize=quantize, | ||
quantize_stage_factory=create_quantize_stage if quantize else None, | ||
) | ||
|
||
|
||
ARM_TOSA_FLOW = _create_tosa_flow() | ||
ARM_TOSA_FP_FLOW = _create_tosa_flow( | ||
"arm_tosa_fp", common.get_tosa_compile_spec(tosa_spec="TOSA-1.0+FP") | ||
) | ||
ARM_TOSA_INT_FLOW = _create_tosa_flow( | ||
"arm_tosa_int", | ||
common.get_tosa_compile_spec(tosa_spec="TOSA-1.0+INT"), | ||
quantize=True, | ||
) | ||
|
||
ARM_ETHOS_U55_FLOW = _create_tosa_flow( | ||
"arm_ethos_u55", | ||
common.get_u55_compile_spec(), | ||
quantize=True, | ||
) | ||
|
||
ARM_ETHOS_U85_FLOW = _create_tosa_flow( | ||
"arm_ethos_u85", | ||
common.get_u85_compile_spec(), | ||
quantize=True, | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not enable this? This should work if we can provide a runner somehow to the FVP? This might be an alternative to pybinding assuming we want to do it this way.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We hope to enable more and more here over time. Plan is to do more in later PR but would be nice to get som INT stuff into the flow already now 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for supports_serialize=False, specificalli, we have not looked deep enough yet to check it, its basicaly just left as is from the first PR by @GregoryComer