Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .ci/scripts/test_backend.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# 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.
Expand Down Expand Up @@ -58,6 +59,12 @@ fi
if [[ "$FLOW" == *arm* ]]; then
# Setup ARM deps.
.ci/scripts/setup-arm-baremetal-tools.sh

if [[ "$FLOW" == *ethos_u* ]]; then
# Prepare a test runner binary that can run on the Corstone-3x0 FVPs
backends/arm/scripts/build_executorch.sh
backends/arm/test/setup_testing.sh
fi
fi

if [[ $IS_MACOS -eq 1 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-backend-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: ./.github/workflows/_test_backend.yml
with:
backend: arm
flows: '["arm_tosa"]'
flows: '["arm_tosa_fp", "arm_tosa_int", "arm_ethos_u55", "arm_ethos_u85"]'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 120
run-linux: true
17 changes: 15 additions & 2 deletions backends/test/suite/flow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 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 logging

from dataclasses import dataclass, field
Expand Down Expand Up @@ -122,10 +127,18 @@ def all_flows() -> dict[str, TestFlow]:
logger.info(f"Skipping QNN flow registration: {e}")

try:
from executorch.backends.test.suite.flows.arm import ARM_TOSA_FLOW
from executorch.backends.test.suite.flows.arm import (
ARM_ETHOS_U55_FLOW,
ARM_ETHOS_U85_FLOW,
ARM_TOSA_FP_FLOW,
ARM_TOSA_INT_FLOW,
)

flows += [
ARM_TOSA_FLOW,
ARM_TOSA_FP_FLOW,
ARM_TOSA_INT_FLOW,
ARM_ETHOS_U55_FLOW,
ARM_ETHOS_U85_FLOW,
]
except Exception as e:
logger.info(f"Skipping ARM flow registration: {e}")
Expand Down
68 changes: 58 additions & 10 deletions backends/test/suite/flows/arm.py
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,
Copy link
Contributor

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.

Copy link
Collaborator Author

@zingo zingo Oct 1, 2025

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 🙂

Copy link
Collaborator Author

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

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,
)
Loading