Skip to content

Commit

Permalink
Arm backend: Add Deeplab3 test (#8370)
Browse files Browse the repository at this point in the history
The model causes problems that we see in other models
such as incorrect quantization and int64s showing up.

I'd like to use the model as a case study for improving
what errors we get.

Signed-off-by: Erik Lundell <erik.lundell@arm.com>
  • Loading branch information
Erik-Lundell authored Feb 12, 2025
1 parent 3681588 commit 3c378dd
Showing 1 changed file with 92 additions and 0 deletions.
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
)

0 comments on commit 3c378dd

Please sign in to comment.