Skip to content

Commit 13beffa

Browse files
authored
Merge branch 'main' into coreml-op-skip
2 parents 8d61700 + 18e5eca commit 13beffa

File tree

80 files changed

+3933
-3050
lines changed

Some content is hidden

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

80 files changed

+3933
-3050
lines changed

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,7 @@ jobs:
386386
echo "::endgroup::"
387387
388388
echo "::group::Build ExecuTorch iOS frameworks"
389-
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
390-
scripts/build_apple_frameworks.sh --Release --Debug --coreml --custom --mps --optimized --portable --quantized --xnnpack
389+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
391390
echo "::endgroup::"
392391
393392
# NB: Although exported models can be copied to this directory and bundled together with the

.github/workflows/apple.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ jobs:
173173
backends/apple/mps/install_requirements.sh
174174
175175
# Build iOS Frameworks
176-
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
177-
scripts/build_apple_frameworks.sh --Release --Debug --coreml --custom --mps --optimized --portable --quantized --xnnpack
176+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
178177
179178
# Bundle iOS Frameworks
180179
for FRAMEWORK in "${FRAMEWORKS[@]}"; do (
@@ -314,8 +313,7 @@ jobs:
314313
echo "::endgroup::"
315314
316315
echo "::group::Build ExecuTorch iOS frameworks"
317-
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \
318-
scripts/build_apple_frameworks.sh --Release --Debug --coreml --custom --mps --optimized --portable --quantized --xnnpack
316+
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output scripts/build_apple_frameworks.sh
319317
echo "::endgroup::"
320318
321319
echo "::group::Build ExecuTorch benchmark app"

.github/workflows/build-presets.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,30 @@ jobs:
6666
./install_requirements.sh > /dev/null
6767
cmake --preset ${{ matrix.preset }}
6868
cmake --build cmake-out -j$(( $(nproc) - 1 ))
69+
70+
windows:
71+
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
preset: [pybind]
76+
with:
77+
job-name: build
78+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
79+
submodules: recursive
80+
timeout: 90
81+
script: |
82+
set -eux
83+
conda init powershell
84+
powershell -Command "& {
85+
\$ErrorActionPreference = 'Stop'
86+
Set-PSDebug -Trace 1
87+
88+
conda create --yes --quiet -n et python=3.12
89+
conda activate et
90+
91+
python install_requirements.py
92+
cmake --preset ${{ matrix.preset }}
93+
\$numCores = [System.Environment]::GetEnvironmentVariable('NUMBER_OF_PROCESSORS') - 1
94+
cmake --build cmake-out -j \$numCores
95+
}"

.github/workflows/trunk.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -692,29 +692,3 @@ jobs:
692692
build-mode: Release
693693
build-tool: cmake
694694
docker-image: executorch-ubuntu-22.04-clang12
695-
696-
unittest-nxp-neutron:
697-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
698-
permissions:
699-
id-token: write
700-
contents: read
701-
with:
702-
runner: linux.2xlarge
703-
docker-image: executorch-ubuntu-22.04-clang12
704-
submodules: 'true'
705-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
706-
timeout: 90
707-
script: |
708-
set -eux
709-
710-
# The generic Linux job chooses to use base env, not the one setup by the image
711-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
712-
conda activate "${CONDA_ENV}"
713-
714-
# Build and install Executorch
715-
PYTHON_EXECUTABLE=python \
716-
CMAKE_ARGS="-DEXECUTORCH_BUILD_NXP_NEUTRON=ON" \
717-
.ci/scripts/setup-linux.sh --build-tool "cmake"
718-
719-
# Run pytest
720-
PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@
6767
[submodule "shim"]
6868
path = shim
6969
url = https://github.com/facebook/buck2-shims-meta
70+
[submodule "third-party/json"]
71+
path = third-party/json
72+
url = https://github.com/nlohmann/json.git

backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@
925925
"$(SRCROOT)/../include/executorch/runtime/core/portable_type/c10",
926926
"$(SRCROOT)/../sdk",
927927
"$(SRCROOT)/../util",
928-
"$(SRCROOT)/../../third-party/nlohmann_json/single_include",
928+
"$(SRCROOT)/../../../../../third-party/json/single_include",
929929
"$(SRCROOT)/../../third-party/coremltools/deps/protobuf/src",
930930
);
931931
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
@@ -957,7 +957,7 @@
957957
"$(SRCROOT)/../include/executorch/runtime/core/portable_type/c10",
958958
"$(SRCROOT)/../sdk",
959959
"$(SRCROOT)/../util",
960-
"$(SRCROOT)/../../third-party/nlohmann_json/single_include",
960+
"$(SRCROOT)/../../../../../third-party/json/single_include",
961961
"$(SRCROOT)/../../third-party/coremltools/deps/protobuf/src",
962962
);
963963
IPHONEOS_DEPLOYMENT_TARGET = 16.0;

backends/apple/coreml/scripts/install_requirements.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ mkdir "$COREMLTOOLS_DIR_PATH/build"
4949
cmake -S "$COREMLTOOLS_DIR_PATH" -B "$COREMLTOOLS_DIR_PATH/build"
5050
cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel --target mlmodel
5151

52-
echo "${green}ExecuTorch: Cloning nlohmann."
53-
git clone https://github.com/nlohmann/json.git "$COREML_DIR_PATH/third-party/nlohmann_json"
54-
STATUS=$?
55-
if [ $STATUS -ne 0 ]; then
56-
echo "${red}ExecuTorch: Failed to clone nlohmann."
57-
exit 1
58-
fi
59-
6052
echo "${green}ExecuTorch: Copying protobuf files."
6153
mkdir -p "$COREML_DIR_PATH/runtime/sdk/format/"
6254
cp -rf "$PROTOBUF_FILES_DIR_PATH" "$COREML_DIR_PATH/runtime/sdk/format/"

backends/cadence/aot/TARGETS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ python_unittest(
388388
"//caffe2:torch",
389389
"//executorch/backends/cadence/aot:compiler",
390390
"//executorch/backends/cadence/aot:fuse_ops",
391+
"//executorch/backends/cadence/aot:graph_builder",
391392
"//executorch/backends/cadence/aot:ops_registrations",
392393
"//executorch/backends/cadence/aot:pass_utils",
393394
"//executorch/backends/cadence/aot:reorder_ops",

backends/cadence/aot/pass_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ def nodes_not_connected_in_gm(
144144
return True
145145

146146

147+
# Returns the position of the first entry of a node of a given kind in the graph.
148+
def get_node_pos(
149+
graph_module: torch.fx.GraphModule,
150+
target: torch.fx.Node,
151+
) -> int:
152+
pos = 0
153+
for node in graph_module.graph.nodes:
154+
if node.target == target:
155+
return pos
156+
pos += 1
157+
return -1
158+
159+
147160
# Returns true if there is no instance of a node with target succ_target
148161
# positioned immediately after a node with target pred_target in the graph
149162
def nodes_not_adjacent_in_gm(

0 commit comments

Comments
 (0)