Skip to content

Commit 5ce2618

Browse files
authored
Merge branch 'main' into export-D70903186
2 parents 4eb9361 + 2d73b33 commit 5ce2618

File tree

37 files changed

+370
-434
lines changed

37 files changed

+370
-434
lines changed

.buckconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@
3939

4040
[buck2]
4141
restarter=true
42+
43+
[oss]
44+
folly_cxx_tests = False

.ci/scripts/gather_test_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"dl3": "linux.4xlarge.memory",
3131
"emformer_join": "linux.4xlarge.memory",
3232
"emformer_predict": "linux.4xlarge.memory",
33+
"phi-4-mini": "linux.4xlarge.memory",
3334
}
3435
}
3536

.ci/scripts/unittest-buck2.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ set -eux
88

99
# TODO: expand this to //...
1010
# TODO: can't query cadence & vulkan backends
11+
# TODO: can't query //kernels/prim_ops because of a cpp_unittest and
12+
# broken code in shim to read oss.folly_cxx_tests. Sending fix but it
13+
# needs to propagate and we need a submodule update.
1114
buck2 query "//backends/apple/... + //backends/example/... + \
1215
//backends/mediatek/... + //backends/test/... + //backends/transforms/... + \
13-
//backends/xnnpack/... + //configurations/... + //kernels/portable/cpu/... + \
14-
//runtime/... + //schema/... + //test/... + //util/..."
16+
//backends/xnnpack/... + //configurations/... + //kernels/aten/... + \
17+
//kernels/optimized/... + //kernels/portable/... + //kernels/quantized/... + \
18+
//kernels/test/... + //runtime/... + //schema/... + //test/... + //util/..."
1519

1620
# TODO: expand the covered scope of Buck targets.
1721
# //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH.
1822
# //runtime/test/... requires Python torch, which we don't have in our OSS buck setup.
19-
buck2 build //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/...
20-
buck2 test //runtime/backend/... //runtime/core/... //runtime/executor: //runtime/kernel/... //runtime/platform/...
23+
buck2 test //kernels/portable/... //runtime/backend/... //runtime/core/... \
24+
//runtime/executor: //runtime/kernel/... //runtime/platform/...

.github/workflows/doc-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
cp -rf docs/_build/html/* "${RUNNER_DOCS_DIR}"
8484
8585
mv docs/_build/html "${RUNNER_ARTIFACT_DIR}"
86+
cp -rf "${RUNNER_DOCS_DIR}"/javadoc "${RUNNER_ARTIFACT_DIR}"/html
8687
8788
ls -R "${RUNNER_ARTIFACT_DIR}"/*/*.html
8889

backends/arm/test/passes/test_fuse_constant_ops_pass.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# LICENSE file in the root directory of this source tree.
55

66
import operator
7+
import unittest
78
from typing import Tuple
89

910
import torch
@@ -107,6 +108,7 @@ def test_fuse_batchnorm_tosa_MI(module):
107108
pipeline.run()
108109

109110

111+
@unittest.skip("Test failing on internal CI")
110112
@common.parametrize("module", modules)
111113
def test_fuse_batchnorm_tosa_BI(module):
112114
pipeline = TosaPipelineBI[input_t](

backends/cadence/fusion_g3/operators/op_mean.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Tensor& mean_out(
118118
for (int i = 0; i < kNnlibMaxDim; i++) {
119119
out_shape[i] = 1;
120120
inp_shape[i] = 1;
121-
p_axis[i] = 1;
121+
p_axis[i] = -1;
122122
}
123123

124124
int num_axis_dims = prepare_data(
@@ -135,20 +135,10 @@ Tensor& mean_out(
135135
num_out_dims = 1;
136136
}
137137

138-
int inp_shape_max = inp_shape[p_axis[0]];
139-
for (int i = 1; i < num_axis_dims; i++) {
140-
if (inp_shape[p_axis[i]] > inp_shape_max) {
141-
inp_shape_max = inp_shape[p_axis[i]];
142-
}
138+
if ((out.dim() == 0) && (out.numel())) {
139+
num_out_dims = 1;
143140
}
144141

145-
int scratch_size = in.numel() / inp_shape_max;
146-
147-
executorch::runtime::Result<void*> temp_mem =
148-
ctx.allocate_temp(scratch_size * sizeof(float));
149-
150-
void* __restrict__ p_scratch_in = (void* __restrict__)(temp_mem.get());
151-
152142
XT_KERNEL_CHECK(
153143
ctx,
154144
out,
@@ -160,8 +150,7 @@ Tensor& mean_out(
160150
inp_shape,
161151
num_inp_dims,
162152
p_axis,
163-
num_axis_dims,
164-
p_scratch_in);
153+
num_axis_dims);
165154
} else {
166155
ET_KERNEL_CHECK(
167156
ctx,

backends/transforms/test/test_create_delete_constant_placeholder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class EmptyNetwork(torch.nn.Module):
18-
1918
def forward(self, x: torch.Tensor) -> torch.Tensor:
2019
return x
2120

@@ -30,7 +29,7 @@ def _test_create_delete(kind: InputKind, persistent_buffer: bool = None):
3029
# Toy network with two nodes, input and output
3130
# The result should be 0 = 0
3231
module = EmptyNetwork()
33-
exported_program = export(module, args=module.test_data)
32+
exported_program = export(module, args=module.test_data, strict=True)
3433
exported_program = to_edge(exported_program).exported_program()
3534
graph = exported_program.graph_module.graph
3635
assert len(graph.nodes) == 2

backends/xnnpack/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# cmake-format -i CMakeLists.txt
1111
# ~~~
1212

13-
cmake_minimum_required(VERSION 3.19)
13+
cmake_minimum_required(VERSION 3.24)
1414

1515
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1616

@@ -124,6 +124,10 @@ else()
124124
list(APPEND xnn_executor_runner_libs portable_ops_lib)
125125
endif()
126126

127+
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
128+
list(APPEND xnn_executor_runner_libs $<LINK_LIBRARY:WHOLE_ARCHIVE,custom_ops>)
129+
endif()
130+
127131
list(APPEND xnn_executor_runner_libs xnnpack_backend executorch)
128132

129133
# ios can only build library but not binary

build/build_android_library.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ build_android_native_library() {
4040
EXECUTORCH_BUILD_NEURON=OFF
4141
fi
4242

43+
EXECUTORCH_BUILD_VULKAN="${EXECUTORCH_BUILD_VULKAN:-OFF}"
44+
4345
cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
4446
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
4547
-DANDROID_ABI="${ANDROID_ABI}" \
@@ -60,6 +62,7 @@ build_android_native_library() {
6062
-DNEURON_BUFFER_ALLOCATOR_LIB="${NEURON_BUFFER_ALLOCATOR_LIB}" \
6163
-DEXECUTORCH_BUILD_QNN="${EXECUTORCH_BUILD_QNN}" \
6264
-DQNN_SDK_ROOT="${QNN_SDK_ROOT}" \
65+
-DEXECUTORCH_BUILD_VULKAN="${EXECUTORCH_BUILD_VULKAN}" \
6366
-DCMAKE_BUILD_TYPE="${EXECUTORCH_CMAKE_BUILD_TYPE}" \
6467
-B"${CMAKE_OUT}"
6568

@@ -168,6 +171,7 @@ collect_artifacts_to_be_uploaded() {
168171
MINIBENCH_APP_DIR="${ARTIFACTS_DIR_NAME}/minibench"
169172
mkdir -p "${MINIBENCH_APP_DIR}"
170173
cp extension/benchmark/android/benchmark/app/build/outputs/apk/debug/*.apk "${MINIBENCH_APP_DIR}"
174+
cp extension/benchmark/android/benchmark/app/build/outputs/apk/androidTest/debug/*.apk "${MINIBENCH_APP_DIR}"
171175
# Collect Java library test
172176
JAVA_LIBRARY_TEST_DIR="${ARTIFACTS_DIR_NAME}/library_test_dir"
173177
mkdir -p "${JAVA_LIBRARY_TEST_DIR}"

0 commit comments

Comments
 (0)