-
Notifications
You must be signed in to change notification settings - Fork 607
Add all relevant testcases for Arm Ethos-U85 #5346
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
Changes from all commits
78264f4
4ce29cf
6a0fc0e
4b9da19
77b12eb
2a197b1
e15095c
e958a23
0e56d02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
from executorch.backends.arm.test import common | ||
from executorch.backends.arm.test.tester.arm_tester import ArmTester | ||
from executorch.exir import EdgeCompileConfig | ||
from executorch.exir.backend.compile_spec_schema import CompileSpec | ||
from parameterized import parameterized | ||
|
||
|
||
|
@@ -92,16 +93,17 @@ def _test_add_tosa_BI_pipeline( | |
.run_method_and_compare_outputs(inputs=test_data, qtol=1) | ||
) | ||
|
||
def _test_add_u55_BI_pipeline( | ||
def _test_add_ethos_BI_pipeline( | ||
self, | ||
module: torch.nn.Module, | ||
compile_spec: CompileSpec, | ||
test_data: Tuple[torch.Tensor], | ||
): | ||
tester = ( | ||
ArmTester( | ||
module, | ||
example_inputs=test_data, | ||
compile_spec=common.get_u55_compile_spec(permute_memory_to_nhwc=True), | ||
compile_spec=compile_spec, | ||
) | ||
.quantize() | ||
.export() | ||
|
@@ -114,8 +116,7 @@ def _test_add_u55_BI_pipeline( | |
.serialize() | ||
) | ||
|
||
if common.is_option_enabled("corstone300"): | ||
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data) | ||
return tester | ||
|
||
@parameterized.expand(Add.test_parameters) | ||
def test_add_tosa_MI(self, test_data: torch.Tensor): | ||
|
@@ -130,7 +131,22 @@ def test_add_tosa_BI(self, test_data: torch.Tensor): | |
@parameterized.expand(Add.test_parameters) | ||
def test_add_u55_BI(self, test_data: torch.Tensor): | ||
test_data = (test_data,) | ||
self._test_add_u55_BI_pipeline(self.Add(), test_data) | ||
tester = self._test_add_ethos_BI_pipeline( | ||
self.Add(), | ||
common.get_u55_compile_spec(permute_memory_to_nhwc=True), | ||
test_data, | ||
) | ||
if common.is_option_enabled("corstone300"): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how would this run u85 bitstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The compilespec is for Ethos-U55 and the run_method_and_compare_outpus is only run here for. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but this function can be called for both u55 and u85 IIUC |
||
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data) | ||
|
||
@parameterized.expand(Add.test_parameters) | ||
def test_add_u85_BI(self, test_data: torch.Tensor): | ||
test_data = (test_data,) | ||
self._test_add_ethos_BI_pipeline( | ||
self.Add(), | ||
common.get_u85_compile_spec(permute_memory_to_nhwc=True), | ||
test_data, | ||
) | ||
|
||
@parameterized.expand(Add2.test_parameters) | ||
def test_add2_tosa_MI(self, operand1: torch.Tensor, operand2: torch.Tensor): | ||
|
@@ -145,4 +161,15 @@ def test_add2_tosa_BI(self, operand1: torch.Tensor, operand2: torch.Tensor): | |
@parameterized.expand(Add2.test_parameters) | ||
def test_add2_u55_BI(self, operand1: torch.Tensor, operand2: torch.Tensor): | ||
test_data = (operand1, operand2) | ||
self._test_add_u55_BI_pipeline(self.Add2(), test_data) | ||
tester = self._test_add_ethos_BI_pipeline( | ||
self.Add2(), common.get_u55_compile_spec(), test_data | ||
) | ||
if common.is_option_enabled("corstone300"): | ||
tester.run_method_and_compare_outputs(qtol=1, inputs=test_data) | ||
|
||
@parameterized.expand(Add2.test_parameters) | ||
def test_add2_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor): | ||
test_data = (operand1, operand2) | ||
self._test_add_ethos_BI_pipeline( | ||
self.Add2(), common.get_u85_compile_spec(), test_data | ||
) |
Uh oh!
There was an error while loading. Please reload this page.