Skip to content

Arm backend: Add Deeplab3 test #8370

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
merged 1 commit into from
Feb 12, 2025
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
92 changes: 92 additions & 0 deletions backends/arm/test/models/test_dl3_arm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# 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.

import unittest

import pytest

from executorch.backends.arm.test import common, conftest

from executorch.backends.arm.test.tester.arm_tester import ArmTester
from executorch.examples.models import deeplab_v3


class TestDl3(unittest.TestCase):
"""Tests DeepLabv3."""

dl3 = deeplab_v3.DeepLabV3ResNet50Model()
model_inputs = dl3.get_example_inputs()
dl3 = dl3.get_eager_model()

@unittest.expectedFailure
def test_dl3_tosa_MI(self):
(
ArmTester(
self.dl3,
example_inputs=self.model_inputs,
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
)
.export()
.to_edge_transform_and_lower()
.to_executorch()
.run_method_and_compare_outputs(self.model_inputs)
)

@unittest.expectedFailure
def test_dl3_tosa_BI(self):
(
ArmTester(
self.dl3,
example_inputs=self.model_inputs,
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
)
.quantize()
.export()
.to_edge_transform_and_lower()
.to_executorch()
.run_method_and_compare_outputs(atol=1.0, qtol=1, inputs=self.model_inputs)
)

@pytest.mark.slow
@pytest.mark.corstone_fvp
@unittest.skip
def test_dl3_u55_BI(self):
tester = (
ArmTester(
self.dl3,
example_inputs=self.model_inputs,
compile_spec=common.get_u55_compile_spec(),
)
.quantize()
.export()
.to_edge_transform_and_lower()
.to_executorch()
.serialize()
)
if conftest.is_option_enabled("corstone_fvp"):
tester.run_method_and_compare_outputs(
atol=1.0, qtol=1, inputs=self.model_inputs
)

@pytest.mark.slow
@pytest.mark.corstone_fvp
@unittest.skip
def test_dl3_u85_BI(self):
tester = (
ArmTester(
self.dl3,
example_inputs=self.model_inputs,
compile_spec=common.get_u85_compile_spec(),
)
.quantize()
.export()
.to_edge_transform_and_lower()
.to_executorch()
.serialize()
)
if conftest.is_option_enabled("corstone_fvp"):
tester.run_method_and_compare_outputs(
atol=1.0, qtol=1, inputs=self.model_inputs
)
Loading