Skip to content

Commit 94decbc

Browse files
Merge branch 'main' into fix-odr-violation-due-to-mismatched-gemm-definition
2 parents 84be313 + 21ec3a1 commit 94decbc

Some content is hidden

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

54 files changed

+2147
-783
lines changed

.github/workflows/apple.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
id: set_version
3838
shell: bash
3939
run: |
40-
VERSION="0.4.0.$(TZ='PST8PDT' date +%Y%m%d)"
40+
VERSION="0.5.0.$(TZ='PST8PDT' date +%Y%m%d)"
4141
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
4242
4343
build-demo-ios:

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# Copyright 2024-2025 Arm Limited and/or its affiliates.
23
# All rights reserved.
34
#
45
# This source code is licensed under the BSD-style license found in the
@@ -819,6 +820,14 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
819820
list(APPEND _executor_runner_libs quantized_ops_lib)
820821
endif()
821822

823+
if(EXECUTORCH_ENABLE_EVENT_TRACER)
824+
if(EXECUTORCH_BUILD_DEVTOOLS)
825+
list(APPEND _executor_runner_libs etdump flatccrt)
826+
else()
827+
message(SEND_ERROR "Use of 'EXECUTORCH_ENABLE_EVENT_TRACER' requires 'EXECUTORCH_BUILD_DEVTOOLS' to be enabled.")
828+
endif()
829+
endif()
830+
822831
add_executable(executor_runner ${_executor_runner__srcs})
823832
if(CMAKE_BUILD_TYPE STREQUAL "Release")
824833
if(APPLE)

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,38 @@ Meta has a [bounty program](https://www.facebook.com/whitehat/) for the safe
4444
disclosure of security bugs. In those cases, please go through the process
4545
outlined on that page and do not file a public issue.
4646

47+
### Issue Labels
48+
49+
#### Module/Partner Labels
50+
51+
[Labels beginning with `module:`](https://github.com/pytorch/executorch/labels?q=%22module%3A+%22)
52+
indicate the area that the issue relates to. The ExecuTorch oncall will
53+
typically add this label.
54+
55+
[Labels beginning with `partner:`](https://github.com/pytorch/executorch/labels?q=%22partner%3A+%22)
56+
indicate the ExecuTorch partner who owns the issue. The ExecuTorch oncall will
57+
typically add this label.
58+
59+
#### Lifecycle Labels
60+
61+
The ExecuTorch oncall will triage new issues. If the issue requires more
62+
information from the issue's author, oncall will add the `need-user-input` label
63+
and wait for the author to respond.
64+
65+
Once the issue contains enough information, the oncall will:
66+
- Ensure that the title is descriptive
67+
- Add one of the labels:
68+
- `bug`: The issue describes an unexpected problem
69+
- `feature`: The issue describes a request for new functionality
70+
- `rfc`: The issue describes a proposed change to functionality
71+
- Add one `module:` label or one `partner:` label, as described above
72+
- Add the `triaged` label
73+
74+
After this point, the oncall has finished the triage process, and the
75+
module owner or partner is responsible for resolving the issue. (See
76+
https://github.com/pytorch/executorch/issues/7679 for the mapping of labels to
77+
owners.)
78+
4779
### Claiming Issues
4880
We'd love your help closing out [open
4981
issues](https://github.com/pytorch/executorch/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)

backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ def fold_and_annotate_arg(
105105
for arg in arg_list:
106106
if not isinstance(arg, Node):
107107
return
108-
"""
109-
Make sure arg has requires_grad set to False
110-
For parameters that are not quantized, sometimes (i.e. convolution)
111-
the Parameter(FakeTensor(...)) has requires_grad set to True, which
112-
causes the retracing of the graph to fail with:
113-
114-
E RuntimeError: isDifferentiableType(variable.scalar_type()) INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/autograd/functions/utils.h":74, please report a bug to PyTorch.
115-
E
116-
E While executing %aten_convolution_default : [num_users=1] = call_function[target=executorch.exir.dialects.edge._ops.aten.convolution.default](args = (%quantized_decomposed_quantize_per_tensor_default, %b__frozen_param0, %p__param_constant1, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
117-
E Original traceback:
118-
E File "/Users/perast01/src/executorch/backends/arm/test/ops/test_conv2d.py", line 110, in forward
119-
E x = conv(x)
120-
"""
121-
if arg.op == "placeholder":
122-
arg.meta["val"].requires_grad = False
123108

124109
arg_quant_params = None
125110
if arg.target == dq_op:

backends/arm/test/ops/test_cat.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
2-
# Copyright 2024 Arm Limited and/or its affiliates.
2+
# Copyright 2024-2025 Arm Limited and/or its affiliates.
33
# All rights reserved.
44
#
55
# This source code is licensed under the BSD-style license found in the
@@ -33,6 +33,8 @@ class Cat(torch.nn.Module):
3333
),
3434
-1,
3535
),
36+
((torch.randn(1, 2, 4, 4), torch.randn(1, 2, 4, 1)), 3),
37+
((torch.randn(1, 2, 4, 4), torch.randn(1, 2, 4, 4)), 0),
3638
((torch.randn(2, 2, 4, 4), torch.randn(2, 2, 4, 1)), 3),
3739
(
3840
(
@@ -47,8 +49,8 @@ class Cat(torch.nn.Module):
4749
def __init__(self):
4850
super().__init__()
4951

50-
def forward(self, tensors: tuple[torch.Tensor, ...], dim: int) -> torch.Tensor:
51-
return torch.cat(tensors, dim=dim)
52+
def forward(self, t: tuple[torch.Tensor, ...], dim: int) -> torch.Tensor:
53+
return torch.cat(t, dim=dim)
5254

5355
def _test_cat_tosa_MI_pipeline(
5456
self, module: torch.nn.Module, test_data: Tuple[tuple[torch.Tensor, ...], int]
@@ -134,22 +136,38 @@ def test_cat_tosa_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
134136
test_data = (operands, dim)
135137
self._test_cat_tosa_BI_pipeline(self.Cat(), test_data)
136138

137-
# Mismatch in provided number of inputs and model signature, MLETORCH 519
138-
@parameterized.expand(Cat.test_parameters)
139+
@parameterized.expand(Cat.test_parameters[:-3])
139140
@pytest.mark.corstone_fvp
140-
@conftest.expectedFailureOnFVP
141141
def test_cat_u55_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
142142
test_data = (operands, dim)
143143
self._test_cat_ethosu_BI_pipeline(
144144
self.Cat(), common.get_u55_compile_spec(), test_data
145145
)
146146

147-
# Mismatch in provided number of inputs and model signature, MLETORCH 519
148-
@parameterized.expand(Cat.test_parameters)
147+
# MLETORCH-630 Cat does not work on FVP with batch>1
148+
@parameterized.expand(Cat.test_parameters[-3:])
149149
@pytest.mark.corstone_fvp
150150
@conftest.expectedFailureOnFVP
151+
def test_cat_u55_BI_xfails(self, operands: tuple[torch.Tensor, ...], dim: int):
152+
test_data = (operands, dim)
153+
self._test_cat_ethosu_BI_pipeline(
154+
self.Cat(), common.get_u55_compile_spec(), test_data
155+
)
156+
157+
@parameterized.expand(Cat.test_parameters[:-3])
158+
@pytest.mark.corstone_fvp
151159
def test_cat_u85_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
152160
test_data = (operands, dim)
153161
self._test_cat_ethosu_BI_pipeline(
154162
self.Cat(), common.get_u85_compile_spec(), test_data
155163
)
164+
165+
# MLETORCH-630 Cat does not work on FVP with batch>1
166+
@parameterized.expand(Cat.test_parameters[-3:])
167+
@pytest.mark.corstone_fvp
168+
@conftest.expectedFailureOnFVP
169+
def test_cat_u85_BI_xfails(self, operands: tuple[torch.Tensor, ...], dim: int):
170+
test_data = (operands, dim)
171+
self._test_cat_ethosu_BI_pipeline(
172+
self.Cat(), common.get_u85_compile_spec(), test_data
173+
)

backends/arm/test/ops/test_expand.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ class Expand(torch.nn.Module):
3737
test_parameters = [
3838
(torch.rand(1), (2,)),
3939
(torch.randn(1, 4), (1, -1)),
40-
(torch.rand(1, 1, 2, 2), (4, 3, -1, 2)),
4140
(torch.randn(1), (2, 2, 4)),
42-
(torch.rand(3, 2, 4, 1), (-1, -1, -1, 3)),
41+
(torch.randn(1, 1, 1, 5), (1, 4, -1, -1)),
4342
(torch.randn(1, 1, 192), (1, -1, -1)),
43+
(torch.randn(1, 1), (1, 2, 2, 4)),
44+
(torch.randn(1, 1), (2, 2, 2, 4)),
4445
(torch.randn(10, 1, 1, 97), (-1, 4, -1, -1)),
46+
(torch.rand(1, 1, 2, 2), (4, 3, -1, 2)),
4547
]
4648

47-
def forward(self, x: torch.Tensor, multiples: Sequence):
48-
return x.expand(multiples)
49+
def forward(self, x: torch.Tensor, m: Sequence):
50+
return x.expand(m)
4951

5052
def _test_expand_tosa_MI_pipeline(self, module: torch.nn.Module, test_data: Tuple):
5153
(
@@ -113,20 +115,34 @@ def test_expand_tosa_MI(self, test_input, multiples):
113115
def test_expand_tosa_BI(self, test_input, multiples):
114116
self._test_expand_tosa_BI_pipeline(self.Expand(), (test_input, multiples))
115117

116-
# Mismatch in provided number of inputs and model signature, MLETORCH 519
117-
@parameterized.expand(Expand.test_parameters)
118+
@parameterized.expand(Expand.test_parameters[:-3])
118119
@pytest.mark.corstone_fvp
119-
@conftest.expectedFailureOnFVP
120120
def test_expand_u55_BI(self, test_input, multiples):
121121
self._test_expand_ethosu_BI_pipeline(
122122
common.get_u55_compile_spec(), self.Expand(), (test_input, multiples)
123123
)
124124

125-
# Mismatch in provided number of inputs and model signature, MLETORCH 519
126-
@parameterized.expand(Expand.test_parameters)
125+
# MLETORCH-629: Expand does not work on FVP with batch>1
126+
@parameterized.expand(Expand.test_parameters[-3:])
127127
@pytest.mark.corstone_fvp
128128
@conftest.expectedFailureOnFVP
129+
def test_expand_u55_BI_xfails(self, test_input, multiples):
130+
self._test_expand_ethosu_BI_pipeline(
131+
common.get_u55_compile_spec(), self.Expand(), (test_input, multiples)
132+
)
133+
134+
@parameterized.expand(Expand.test_parameters[:-3])
135+
@pytest.mark.corstone_fvp
129136
def test_expand_u85_BI(self, test_input, multiples):
130137
self._test_expand_ethosu_BI_pipeline(
131138
common.get_u85_compile_spec(), self.Expand(), (test_input, multiples)
132139
)
140+
141+
# MLETORCH-629: Expand does not work on FVP with batch>1
142+
@parameterized.expand(Expand.test_parameters[-3:])
143+
@pytest.mark.corstone_fvp
144+
@conftest.expectedFailureOnFVP
145+
def test_expand_u85_BI_xfails(self, test_input, multiples):
146+
self._test_expand_ethosu_BI_pipeline(
147+
common.get_u85_compile_spec(), self.Expand(), (test_input, multiples)
148+
)

backends/arm/test/ops/test_full.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,16 @@ def test_full_tosa_MI(self, test_tensor: Tuple):
143143
def test_full_tosa_BI(self, test_tensor: Tuple):
144144
self._test_full_tosa_BI_pipeline(self.AddVariableFull(), test_tensor)
145145

146-
# Mismatch in provided number of inputs and model signature, MLETORCH 519
147146
@parameterized.expand(AddVariableFull.test_parameters)
148147
@pytest.mark.corstone_fvp
149-
@conftest.expectedFailureOnFVP
150148
def test_full_u55_BI(self, test_tensor: Tuple):
151149
self._test_full_tosa_u55_pipeline(
152150
self.AddVariableFull(),
153151
test_tensor,
154152
)
155153

156-
# Mismatch in provided number of inputs and model signature, MLETORCH 519
157154
@parameterized.expand(AddVariableFull.test_parameters)
158155
@pytest.mark.corstone_fvp
159-
@conftest.expectedFailureOnFVP
160156
def test_full_u85_BI(self, test_tensor: Tuple):
161157
self._test_full_tosa_u85_pipeline(
162158
self.AddVariableFull(),

backends/arm/test/runner_utils.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,7 @@ def get_input_names(program: ExportedProgram) -> list[str]:
6565
Returns:
6666
A list of strings with the names of the model input.
6767
"""
68-
input_names = []
69-
70-
# E.g. bias and weights are 'placeholders' as well. This is used to
71-
# get only the use inputs.
72-
usr_inputs = program.graph_signature.user_inputs
73-
for node in program.graph.nodes:
74-
if node.op == "placeholder" and node.name in usr_inputs:
75-
input_names.append(node.name)
76-
77-
return input_names
68+
return [spec.arg.name for spec in program.graph_signature.input_specs]
7869

7970

8071
def get_input_quantization_params(
@@ -334,13 +325,16 @@ def run_corstone(
334325

335326

336327
def prep_data_for_save(
337-
data: torch.Tensor,
328+
data,
338329
input_name: str,
339330
quant_param: Optional[QuantizationParams] = None,
340331
):
341-
data_np = np.array(data.detach(), order="C").astype(
342-
torch_to_numpy_dtype_dict[data.dtype]
343-
)
332+
if isinstance(data, torch.Tensor):
333+
data_np = np.array(data.detach(), order="C").astype(
334+
torch_to_numpy_dtype_dict[data.dtype]
335+
)
336+
else:
337+
data_np = np.array(data)
344338
if quant_param is not None:
345339
assert quant_param.node_name in input_name, (
346340
f"The quantization params name '{quant_param.node_name}' does not "

backends/qualcomm/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) Qualcomm Innovation Center, Inc.
2+
# Copyright 2025 Arm Limited and/or its affiliates.
23
# All rights reserved
34
#
45
# This source code is licensed under the BSD-style license found in the
@@ -199,11 +200,6 @@ target_link_libraries(
199200
#
200201
target_link_options_shared_lib(qnn_executorch_backend)
201202

202-
#
203-
# add compile option
204-
#
205-
target_compile_options(executorch PUBLIC -DET_EVENT_TRACER_ENABLED)
206-
207203
#
208204
# add sources
209205
#

0 commit comments

Comments
 (0)