Skip to content

Commit 2c5ee5f

Browse files
committed
Update
[ghstack-poisoned]
2 parents 9f49022 + dd30cfa commit 2c5ee5f

File tree

172 files changed

+2049
-1959
lines changed

Some content is hidden

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

172 files changed

+2049
-1959
lines changed

.ci/docker/ci_commit_pins/pytorch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
295f2ed4d103017f7e19a7b8263ece606cd629db
1+
7ae0ce6360b6e4f944906502d20da24c04debee5

.ci/scripts/unittest-linux.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ if [[ "$BUILD_TOOL" == "cmake" ]]; then
2121
source .ci/scripts/setup-vulkan-linux-deps.sh
2222

2323
PYTHON_EXECUTABLE=python \
24-
EXECUTORCH_BUILD_PYBIND=ON \
25-
CMAKE_ARGS="-DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
24+
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
2625
.ci/scripts/setup-linux.sh "$@"
2726

2827
# Install llama3_2_vision dependencies.

.ci/scripts/unittest-macos.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ trap 'rm -rfv ${TMP_DIR}' EXIT
2121

2222
# Setup MacOS dependencies as there is no Docker support on MacOS atm
2323
PYTHON_EXECUTABLE=python \
24-
EXECUTORCH_BUILD_PYBIND=ON \
25-
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
24+
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
2625
${CONDA_RUN} --no-capture-output \
2726
.ci/scripts/setup-macos.sh "$@"
2827

.ci/scripts/wheel/envvar_base.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
# should typically only contain shell variable assignments. Be sure to export
99
# any variables so that subprocesses will see them.
1010

11-
# Enable pybindings so that users can execute ExecuTorch programs from python.
12-
export EXECUTORCH_BUILD_PYBIND=1
13-
1411
# Ensure that CMAKE_ARGS is defined before referencing it. Defaults to empty
1512
# if not defined.
1613
export CMAKE_ARGS="${CMAKE_ARGS:-}"
1714

1815
# Link the XNNPACK backend into the pybindings runtime so that users can execute
1916
# ExecuTorch programs that delegate to it.
20-
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_XNNPACK=ON"
17+
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON"

.github/workflows/pull.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ jobs:
365365
# build module for executorch.extension.pybindings.portable_lib
366366
BUILD_TOOL="cmake"
367367
PYTHON_EXECUTABLE=python \
368-
EXECUTORCH_BUILD_XNNPACK=ON \
369-
EXECUTORCH_BUILD_PYBIND=ON \
368+
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
370369
bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
371370
372371
# see if we can import the module successfully
@@ -504,7 +503,7 @@ jobs:
504503
505504
# Setup MacOS dependencies as there is no Docker support on MacOS atm
506505
PYTHON_EXECUTABLE=python \
507-
EXECUTORCH_BUILD_PYBIND=ON \
506+
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON" \
508507
EXECUTORCH_BUILD_ARM_BAREMETAL=ON \
509508
.ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
510509

.github/workflows/trunk.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ jobs:
261261
262262
# build module for executorch.extension.pybindings.portable_lib
263263
BUILD_TOOL=${{ matrix.build-tool }}
264-
EXECUTORCH_BUILD_PYBIND=ON PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
264+
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON" PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
265265
266266
# see if we can import the module successfully
267267
${CONDA_RUN} python -c "from executorch.extension.pybindings import portable_lib; print('success!')"
@@ -536,8 +536,9 @@ jobs:
536536
git clone https://github.com/huggingface/optimum-executorch
537537
cd optimum-executorch
538538
# There is no release yet, for CI stability, always test from the same commit on main
539-
git checkout 1907349524b5f2d61f9c04d2e985da826d4308ba
540-
pip install .[tests]
539+
git checkout 6a7e83f3eee2976fa809335bfb78a45b1ea1cb25
540+
pip install .
541+
pip install accelerate sentencepiece
541542
pip list
542543
echo "::endgroup::"
543544

backends/arm/operator_support/convolution_support.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _is_node_supported_u55(self, node: fx.Node):
5555

5656
C_in = shape_in[1]
5757
C_out = shape_out[1]
58-
if (C_in == group) and (C_out % C_in) == 0:
58+
if (C_in == group) and (C_out % C_in) == 0 and len(shape_in) <= 4:
5959
# Depthwise convolution
6060
for dim in shape_in[1:]:
6161
if not 1 <= dim <= 65536:
@@ -74,13 +74,19 @@ def _is_node_supported_u55(self, node: fx.Node):
7474

7575
kernel_w = kernel[2]
7676
kernel_h = kernel[3] if len(kernel) > 3 else 1
77+
kernel_z = kernel[4] if len(kernel) > 4 else 1
7778
# Kernel condition misses constraint on sum of absolute weights
7879
if not 1 <= kernel_h <= 64 or not 1 <= kernel_w * kernel_h <= 4096:
7980
self.reporter.report_reject(
8081
node,
8182
f"Convolution needs to have kernel_y<=64, kernel_x*kernel_y<=4096, got kernel ({kernel_w}, {kernel_h})",
8283
)
8384
return False
85+
if kernel_z != 1:
86+
self.reporter.report_reject(
87+
node, f"Convolution3d needs to have kernel_z==1, got {kernel_z}."
88+
)
89+
return False
8490

8591
if not self._stride_condition(node):
8692
self.reporter.report_reject(
@@ -107,6 +113,14 @@ def _stride_condition(self, node: fx.Node) -> bool:
107113
if len(strides) == 1:
108114
strides = [strides[0]] * 2
109115

116+
if len(strides) > 2:
117+
stride_z = strides[2]
118+
if stride_z > 1:
119+
self.reporter.report_reject(
120+
node, f"Convolution3d only supports stride_z<=1, got {stride_z}."
121+
)
122+
return False
123+
110124
for stride, dilation in zip(strides, dilations):
111125
stride_condition = 1 <= stride <= 3
112126
dilation_condition = (not has_padding) and (dilation == 1)

backends/arm/test/models/test_llama.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def prepare_model(self):
5252
params_file, str
5353
), "invalid input for --llama_inputs"
5454
else:
55-
logging.warning(
55+
logger.warning(
5656
"Skipping Llama test because of lack of input. To run use --llama_inputs <.pt> <.json>"
5757
)
5858
return None, None, None
@@ -61,6 +61,8 @@ def prepare_model(self):
6161
params_file
6262
), "Invalid file paths"
6363

64+
logger.info("Running test_llama.py")
65+
6466
# TODO: Enable key value cache
6567
args = [
6668
"--disable_dynamic_shape",
@@ -112,9 +114,11 @@ def test_llama_tosa_MI(self):
112114
)
113115
.export()
114116
.to_edge_transform_and_lower()
115-
.check_count({"torch.ops.higher_order.executorch_call_delegate": 14})
117+
.check_count({"torch.ops.higher_order.executorch_call_delegate": 26})
116118
.to_executorch()
117119
.run_method_and_compare_outputs(
118-
inputs=llama_inputs, atol=1.8, rtol=0.01 # TODO: decrease tolerance
120+
inputs=llama_inputs,
121+
atol=4.3,
122+
rtol=1.1, # TODO: MLETORCH-825 decrease tolerance
119123
)
120124
)

backends/arm/test/ops/test_conv2d.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
import torch
1010
from executorch.backends.arm.test import common
11-
from executorch.backends.arm.test.tester.arm_tester import ArmTester
1211
from executorch.backends.arm.test.tester.test_pipeline import (
1312
EthosU55PipelineBI,
1413
EthosU85PipelineBI,
14+
OpNotSupportedPipeline,
1515
TosaPipelineBI,
1616
TosaPipelineMI,
1717
)
@@ -34,9 +34,9 @@ def __init__(
3434
in_channels: Union[List, int, None] = None,
3535
out_channels: Union[List, int, None] = None,
3636
kernel_size: Union[List, Tuple, None] = None,
37-
stride: Union[List, Tuple, None] = None,
38-
padding: Union[List, Tuple, None] = None,
39-
dilation: Union[List, Tuple, None] = None,
37+
stride: Union[List, Tuple, int, None] = None,
38+
padding: Union[List, Tuple, int, None] = None,
39+
dilation: Union[List, Tuple, int, None] = None,
4040
groups: Union[List, int, None] = None,
4141
bias: Union[List, bool, None] = None,
4242
padding_mode: Union[List, str, None] = None,
@@ -446,17 +446,9 @@ def test_convolution_2d_u85_BI_on_fvp(test_module):
446446
def test_reject_convolution_2d_u55_BI(
447447
module: Conv2d,
448448
):
449-
(
450-
ArmTester(
451-
module,
452-
example_inputs=module.get_inputs(),
453-
compile_spec=common.get_u55_compile_spec(),
454-
)
455-
.quantize()
456-
.export()
457-
.check_count({"torch.ops.aten.conv2d.default": 1})
458-
.check(["torch.ops.quantized_decomposed"])
459-
.to_edge_transform_and_lower()
460-
.check(["executorch_exir_dialects_edge__ops_aten_convolution_default"])
461-
.check_count({"torch.ops.higher_order.executorch_call_delegate": 0})
462-
)
449+
OpNotSupportedPipeline(
450+
module,
451+
module.get_inputs(),
452+
"TOSA-0.80+BI+u55",
453+
{"executorch_exir_dialects_edge__ops_aten_convolution_default": 1},
454+
).run()

0 commit comments

Comments
 (0)