Skip to content

Commit 723735f

Browse files
committed
Update
[ghstack-poisoned]
2 parents ba687e6 + bec37a0 commit 723735f

File tree

45 files changed

+554
-421
lines changed

Some content is hidden

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

45 files changed

+554
-421
lines changed
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 }}

backends/arm/operator_support/tosa_supported_operators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def is_node_supported(
115115
exir_ops.edge.aten.logical_and.default,
116116
exir_ops.edge.aten.logical_or.default,
117117
exir_ops.edge.aten.logical_xor.default,
118+
exir_ops.edge.aten.logical_not.default,
118119
exir_ops.edge.aten.bitwise_and.Tensor,
119120
exir_ops.edge.aten.bitwise_or.Tensor,
120121
exir_ops.edge.aten.bitwise_xor.Tensor,
@@ -199,6 +200,7 @@ def is_node_supported(
199200
exir_ops.edge.aten.logical_and.default,
200201
exir_ops.edge.aten.logical_or.default,
201202
exir_ops.edge.aten.logical_xor.default,
203+
exir_ops.edge.aten.logical_not.default,
202204
exir_ops.edge.aten.amax.default,
203205
exir_ops.edge.aten.amin.default,
204206
exir_ops.edge.aten.eq.Tensor,

backends/arm/operators/ops_unary.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
)
1515

1616
from executorch.backends.arm.tosa_mapping import TosaArg
17-
from executorch.backends.arm.tosa_specification import TosaSpecification
1817
from serializer.tosa_serializer import TosaOp
1918

2019

2120
def unary_operator_factory(unary_target: str, tosa_op):
2221
"Creates and registers NodeVisitors for operations that have one input and map directly into a TOSA op."
2322

24-
class UnaryOperator_080_MI(NodeVisitor):
25-
target = unary_target
23+
# Some TOSA unary operators only support float
24+
fp_only_ops = ["aten.floor.default"]
2625

27-
tosa_specs = [TosaSpecification.create_from_string("TOSA-0.80+MI")]
26+
class UnaryOperator(NodeVisitor):
27+
target = unary_target
2828

2929
def __init__(self, *args):
3030
super().__init__(*args)
@@ -43,15 +43,15 @@ def define_node(
4343
f"Got {inputs[0].dtype=}, {output.dtype=}"
4444
)
4545

46-
if not (inputs[0].dtype == ts.DType.FP32):
46+
if self.target in fp_only_ops and not (inputs[0].dtype == ts.DType.FP32):
4747
raise ValueError(
4848
"All inputs need to be FP32." f"Got {inputs[0].dtype=}"
4949
)
5050

51-
# MI lowering
5251
tosa_graph.addOperator(tosa_op, [inputs[0].name], [output.name])
5352

54-
register_node_visitor(UnaryOperator_080_MI)
53+
register_node_visitor(UnaryOperator)
5554

5655

5756
unary_operator_factory("aten.floor.default", TosaOp.Op().FLOOR)
57+
unary_operator_factory("aten.logical_not.default", TosaOp.Op().LOGICAL_NOT)

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/models/test_conformer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class TestConformer(unittest.TestCase):
3434
"executorch_exir_dialects_edge__ops_aten_max_default": 1,
3535
"executorch_exir_dialects_edge__ops_aten_eq_Scalar": 2,
3636
"executorch_exir_dialects_edge__ops_aten_where_self": 4,
37-
"executorch_exir_dialects_edge__ops_aten_logical_not_default": 4,
3837
"executorch_exir_dialects_edge__ops_aten_any_dim": 2,
3938
"torch.ops.aten._assert_scalar.default": 10,
4039
"torch.ops.aten._local_scalar_dense.default": 1,

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

backends/arm/test/ops/test_logical.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ def forward(self, tensor1: torch.Tensor, tensor2: torch.Tensor):
4040
return tensor1.logical_or(tensor2)
4141

4242

43+
class Not(torch.nn.Module):
44+
aten_op = "torch.ops.aten.logical_not.default"
45+
exir_op = "executorch_exir_dialects_edge__ops_aten_logical_not_default"
46+
47+
def forward(self, tensor: torch.Tensor):
48+
return torch.logical_not(tensor)
49+
50+
4351
input_t2 = Tuple[torch.Tensor, torch.Tensor] # Input x, y
4452

4553

@@ -64,6 +72,10 @@ def forward(self, tensor1: torch.Tensor, tensor2: torch.Tensor):
6472

6573

6674
test_data = {
75+
"not_rank1": (Not(), test_input["rank1"][:-1]),
76+
"not_rand_rank2": (Not(), test_input["rand_rank2"][:-1]),
77+
"not_rand_rank3": (Not(), test_input["rand_rank3"][:-1]),
78+
"not_rand_rank4": (Not(), test_input["rand_rank4"][:-1]),
6779
"and_rank1": (And(), test_input["rank1"]),
6880
"and_rand_rank2": (And(), test_input["rand_rank2"]),
6981
"and_rand_rank3": (And(), test_input["rand_rank3"]),
@@ -80,6 +92,10 @@ def forward(self, tensor1: torch.Tensor, tensor2: torch.Tensor):
8092

8193

8294
fvp_xfails = {
95+
"not_rank1": "MLETORCH-706 Support ScalarType::Bool in EthosUBackend.",
96+
"not_rand_rank2": "MLETORCH-706: Support ScalarType::Bool in EthosUBackend.",
97+
"not_rand_rank3": "MLETORCH-706: Support ScalarType::Bool in EthosUBackend.",
98+
"not_rand_rank4": "MLETORCH-706: Support ScalarType::Bool in EthosUBackend.",
8399
"and_rank1": "MLETORCH-706 Support ScalarType::Bool in EthosUBackend.",
84100
"and_rand_rank2": "MLETORCH-706: Support ScalarType::Bool in EthosUBackend.",
85101
"and_rand_rank3": "MLETORCH-706: Support ScalarType::Bool in EthosUBackend.",

0 commit comments

Comments
 (0)