Skip to content

Commit 5f2d0bb

Browse files
Merge branch 'main' into add-dim-dims-ops
2 parents 2fbaa5c + 42d3952 commit 5f2d0bb

File tree

58 files changed

+1123
-1039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1123
-1039
lines changed

.ci/scripts/unittest-buck2.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ buck2 query "//backends/apple/... + //backends/example/... + \
1919

2020
UNBUILDABLE_OPTIMIZED_OPS_REGEX="gelu|fft_r2c|log_softmax"
2121
BUILDABLE_OPTIMIZED_OPS=$(buck2 query //kernels/optimized/cpu/... | grep -E -v $UNBUILDABLE_OPTIMIZED_OPS_REGEX)
22+
23+
BUILDABLE_KERNELS_PRIM_OPS_TARGETS=$(buck2 query //kernels/prim_ops/... | grep -v prim_ops_test_py)
2224
# TODO: expand the covered scope of Buck targets.
2325
# //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH.
2426
# //runtime/test/... requires Python torch, which we don't have in our OSS buck setup.
25-
buck2 test $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... //runtime/backend/... //runtime/core/... \
27+
buck2 test $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... \
28+
$BUILDABLE_KERNELS_PRIM_OPS_TARGETS //runtime/backend/... //runtime/core/... \
2629
//runtime/executor: //runtime/kernel/... //runtime/platform/...

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ jobs:
353353
with:
354354
runner: macos-latest-xlarge
355355
python-version: '3.11'
356-
submodules: 'true'
356+
submodules: 'recursive'
357357
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
358358
upload-artifact: ios-apps
359359
secrets-env: BUILD_CERTIFICATE_BASE64 EXECUTORCH_BENCHMARK_BUILD_PROVISION_PROFILE_BASE64 KEYCHAIN_PASSWORD

.github/workflows/build-wheels-m1.yml renamed to .github/workflows/build-wheels-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# From https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows
2-
name: Build M1 Wheels
2+
name: Build macOS Wheels
33

44
on:
55
pull_request:
66
paths:
77
- build/packaging/**
8-
- .github/workflows/build-wheels-m1.yml
8+
- .github/workflows/build-wheels-macos.yml
99
push:
1010
branches:
1111
- nightly
@@ -56,7 +56,7 @@ jobs:
5656
# files to look at.
5757
submodules: true
5858
delocate-wheel: false
59-
env-var-script: build/packaging/env_var_script_m1.sh
59+
env-var-script: build/packaging/env_var_script_macos.sh
6060
pre-script: ${{ matrix.pre-script }}
6161
post-script: ${{ matrix.post-script }}
6262
package-name: ${{ matrix.package-name }}

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ jobs:
234234
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
235235
with:
236236
runner: macos-m1-stable
237-
python-version: '3.11'
237+
python-version: "3.11"
238238
submodules: 'true'
239239
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
240240
script: |

backends/arm/scripts/build_executorch.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1515
et_root_dir=$(realpath ${et_root_dir})
1616
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1717
toolchain_cmake=$(realpath ${toolchain_cmake})
18+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
19+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1820

1921
et_build_root="${et_root_dir}/arm_test"
2022
build_type="Release"
@@ -43,6 +45,13 @@ for arg in "$@"; do
4345
esac
4446
done
4547

48+
# Source the tools
49+
# This should be prepared by the setup.sh
50+
[[ -f ${setup_path_script} ]] \
51+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
52+
53+
source ${setup_path_script}
54+
4655
et_build_dir="${et_build_root}/cmake-out"
4756

4857
# Used for flatcc host excutable if Devtools is used

backends/arm/scripts/build_executorch_runner.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1010
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1111
et_root_dir=$(realpath ${et_root_dir})
1212
toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
13+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
14+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1315

1416
pte_file=""
1517
target="ethos-u55-128"
@@ -66,6 +68,13 @@ for arg in "$@"; do
6668
esac
6769
done
6870

71+
# Source the tools
72+
# This should be prepared by the setup.sh
73+
[[ -f ${setup_path_script} ]] \
74+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
75+
76+
source ${setup_path_script}
77+
6978
pte_file=$(realpath ${pte_file})
7079
ethosu_tools_dir=$(realpath ${ethosu_tools_dir})
7180
ethos_u_root_dir="$ethosu_tools_dir/ethos-u"

backends/arm/scripts/build_portable_kernels.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1515
et_root_dir=$(realpath ${et_root_dir})
1616
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1717
toolchain_cmake=$(realpath ${toolchain_cmake})
18+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
19+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1820

1921

2022
et_build_root="${et_root_dir}/arm_test"
@@ -41,6 +43,13 @@ for arg in "$@"; do
4143
esac
4244
done
4345

46+
# Source the tools
47+
# This should be prepared by the setup.sh
48+
[[ -f ${setup_path_script} ]] \
49+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
50+
51+
source ${setup_path_script}
52+
4453
et_build_dir=${et_build_root}/cmake-out
4554

4655
cd "${et_root_dir}"

backends/arm/scripts/run_fvp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly ins
1919

2020
elf_file=""
2121
target="ethos-u55-128"
22-
timeout="240"
22+
timeout="600"
2323

2424
help() {
2525
echo "Usage: $(basename $0) [options]"

backends/arm/test/ops/test_batch_norm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# Copyright 2024-2025 Arm Limited and/or its affiliates.
32
# All rights reserved.
3+
# Copyright 2024-2025 Arm Limited and/or its affiliates.
44
#
55
# This source code is licensed under the BSD-style license found in the
66
# LICENSE file in the root directory of this source tree.
@@ -647,7 +647,7 @@ def _test_batchnorm2d_u55_BI_pipeline(
647647
)
648648

649649
@parameterized.expand(test_data_suite)
650-
def test_batchnorm2d_tosa_MI(
650+
def test_native_batch_norm_legit_no_training_tosa_MI(
651651
self,
652652
test_name: str,
653653
test_data: torch.Tensor,
@@ -665,7 +665,7 @@ def test_batchnorm2d_tosa_MI(
665665
# Expected to fail since not inplemented
666666
@parameterized.expand(test_no_stats_data_suite)
667667
@unittest.expectedFailure
668-
def test_batchnorm2d_no_stats_tosa_MI(
668+
def test_native_batch_norm_legit_tosa_MI(
669669
self,
670670
test_name: str,
671671
test_data: torch.Tensor,
@@ -686,7 +686,7 @@ def test_batchnorm2d_no_stats_tosa_MI(
686686
@unittest.skip(
687687
reason="Expected to fail since TOSAQuantizer (for BI) cannot quantize a BatchNorm layer"
688688
)
689-
def test_batchnorm2d_tosa_BI(
689+
def test_native_batch_norm_legit_no_training_tosa_BI(
690690
self,
691691
test_name: str,
692692
test_data: torch.Tensor,
@@ -708,7 +708,7 @@ def test_batchnorm2d_tosa_BI(
708708
reason="Expected to fail since EthosUQuantizer cannot quantize a BatchNorm layer"
709709
)
710710
@unittest.expectedFailure
711-
def test_batchnorm2d_u55_BI(
711+
def test_native_batch_norm_legit_no_training_u55_BI(
712712
self,
713713
test_name: str,
714714
test_data: torch.Tensor,

backends/arm/test/ops/test_bmm.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,9 @@ def test_bmm_single_input_tosa_BI(self, test_data_generator: Callable[[], Tuple]
150150
test_data = test_data_generator()
151151
self._test_bmm_tosa_BI_pipeline(self.BMMSingleInput(), test_data)
152152

153-
# Expected to fail on FVP as TOSA.MATMUL is not supported on U55
154153
@parameterized.expand(BMM.test_data_generators)
155154
@pytest.mark.corstone_fvp
156-
@conftest.expectedFailureOnFVP
157-
def test_bmm_u55_BI_xfails(self, test_data_generator: Callable[[], Tuple]):
155+
def test_bmm_u55_BI(self, test_data_generator: Callable[[], Tuple]):
158156
test_data = test_data_generator()
159157
self._test_bmm_ethosu_BI_pipeline(
160158
self.BMM(), common.get_u55_compile_spec(), test_data
@@ -171,10 +169,7 @@ def test_bmm_u85_BI(self, test_data_generator: Callable[[], Tuple]):
171169
# Expected to fail on FVP as TOSA.MATMUL is not supported on U55
172170
@parameterized.expand(BMMSingleInput.test_data_generators)
173171
@pytest.mark.corstone_fvp
174-
@conftest.expectedFailureOnFVP
175-
def test_bmm_single_input_u55_BI_xfails(
176-
self, test_data_generator: Callable[[], Tuple]
177-
):
172+
def test_bmm_single_input_u55_BI(self, test_data_generator: Callable[[], Tuple]):
178173
test_data = test_data_generator()
179174
self._test_bmm_ethosu_BI_pipeline(
180175
self.BMMSingleInput(), common.get_u55_compile_spec(), test_data

0 commit comments

Comments
 (0)