Skip to content

Commit 56ec087

Browse files
authored
Merge branch 'main' into Add-sign-decomposition-pass-and-test
2 parents 78d1879 + 29858b4 commit 56ec087

File tree

71 files changed

+1450
-855
lines changed

Some content is hidden

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

71 files changed

+1450
-855
lines changed

.ci/scripts/test_model.sh

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,6 @@ test_model_with_qnn() {
188188
EXPORT_SCRIPT=edsr
189189
# Additional deps for edsr
190190
pip install piq
191-
elif [[ "${MODEL_NAME}" == "cvt" ]]; then
192-
EXPORT_SCRIPT=cvt
193-
elif [[ "${MODEL_NAME}" == "dit" ]]; then
194-
EXPORT_SCRIPT=dit
195-
elif [[ "${MODEL_NAME}" == "efficientnet" ]]; then
196-
EXPORT_SCRIPT=efficientnet
197-
elif [[ "${MODEL_NAME}" == "focalnet" ]]; then
198-
EXPORT_SCRIPT=focalnet
199-
elif [[ "${MODEL_NAME}" == "mobilevit_v1" ]]; then
200-
EXPORT_SCRIPT=mobilevit_v1
201-
elif [[ "${MODEL_NAME}" == "mobilevit_v2" ]]; then
202-
EXPORT_SCRIPT=mobilevit_v2
203-
elif [[ "${MODEL_NAME}" == "pvt" ]]; then
204-
EXPORT_SCRIPT=pvt
205-
elif [[ "${MODEL_NAME}" == "swin" ]]; then
206-
EXPORT_SCRIPT=swin_transformer
207191
elif [[ "${MODEL_NAME}" == "albert" ]]; then
208192
EXPORT_SCRIPT=albert
209193
elif [[ "${MODEL_NAME}" == "bert" ]]; then
@@ -212,8 +196,6 @@ test_model_with_qnn() {
212196
EXPORT_SCRIPT=distilbert
213197
elif [[ "${MODEL_NAME}" == "eurobert" ]]; then
214198
EXPORT_SCRIPT=eurobert
215-
elif [[ "${MODEL_NAME}" == "roberta" ]]; then
216-
EXPORT_SCRIPT=roberta
217199
else
218200
echo "Unsupported model $MODEL_NAME"
219201
exit 1
@@ -228,13 +210,10 @@ test_model_with_qnn() {
228210
"dl3"|"mv3"|"mv2"|"ic4"|"ic3"|"vit"|"mb"|"w2l")
229211
SCRIPT_FOLDER=scripts
230212
;;
231-
"cvt"|"dit"|"focalnet"|"mobilevit_v2"|"pvt"|"swin")
232-
SCRIPT_FOLDER=oss_scripts
233-
;;
234-
"albert"|"bert"|"distilbert"|"roberta"|"efficientnet"|"mobilevit_v1")
213+
"albert"|"bert"|"distilbert")
235214
pip install evaluate
236215
SCRIPT_FOLDER=oss_scripts
237-
# 16bit models will encounter op validation fail on some operations,
216+
# Bert models running in 16bit will encounter op validation fail on some operations,
238217
# which requires CHIPSET >= SM8550.
239218
QNN_CHIPSET=SM8550
240219
;;

.github/workflows/trunk.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,36 @@ jobs:
271271
exit 1
272272
fi
273273
274+
nxp-build-test:
275+
name: nxp-build-test
276+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
277+
permissions:
278+
id-token: write
279+
contents: read
280+
with:
281+
runner: linux.2xlarge
282+
docker-image: executorch-ubuntu-22.04-arm-sdk
283+
submodules: 'recursive'
284+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
285+
timeout: 90
286+
script: |
287+
# The generic Linux job chooses to use base env, not the one setup by the image
288+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
289+
conda activate "${CONDA_ENV}"
290+
291+
# Build
292+
cmake -DEXECUTORCH_BUILD_NXP_NEUTRON=ON -Bcmake-out .
293+
cmake --build cmake-out --target executorch_delegate_neutron --config Release
294+
295+
# Build check for the neutron backend library
296+
lib_neutron="cmake-out/backends/nxp/libexecutorch_delegate_neutron.a"
297+
if [ -f $lib_neutron ]; then
298+
echo "Neutron backend library built."
299+
else
300+
echo "Neutron backend library not found!"
301+
exit 1
302+
fi
303+
274304
test-coreml-delegate:
275305
name: test-coreml-delegate
276306
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
@@ -470,7 +500,7 @@ jobs:
470500
docker-image: executorch-ubuntu-22.04-qnn-sdk
471501
submodules: 'recursive'
472502
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
473-
timeout: 90
503+
timeout: 900
474504
script: |
475505
# The generic Linux job chooses to use base env, not the one setup by the image
476506
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
@@ -489,14 +519,14 @@ jobs:
489519
strategy:
490520
matrix:
491521
dtype: [fp32]
492-
model: [cvt, dit, efficientnet, focalnet, mobilevit_v1, mobilevit_v2, pvt, swin, albert, bert, distilbert, roberta] # eurobert requires transfomer >= 4.48.0, skip for now
522+
model: [albert, bert, distilbert] # eurobert requires transfomer >= 4.48.0, skip for now
493523
fail-fast: false
494524
with:
495525
runner: linux.2xlarge
496526
docker-image: executorch-ubuntu-22.04-qnn-sdk
497527
submodules: 'recursive'
498528
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
499-
timeout: 90
529+
timeout: 900
500530
script: |
501531
# The generic Linux job chooses to use base env, not the one setup by the image
502532
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,12 @@ install(
449449
FILES_MATCHING
450450
PATTERN "*.h"
451451
)
452+
install(
453+
DIRECTORY runtime/executor/
454+
DESTINATION include/executorch/runtime/executor
455+
FILES_MATCHING
456+
PATTERN "*.h"
457+
)
452458
install(
453459
DIRECTORY runtime/kernel/
454460
DESTINATION include/executorch/runtime/kernel
@@ -496,6 +502,10 @@ if(EXECUTORCH_BUILD_CADENCE)
496502
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/cadence)
497503
endif()
498504

505+
if(EXECUTORCH_BUILD_NXP_NEUTRON)
506+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/nxp)
507+
endif()
508+
499509
if(EXECUTORCH_BUILD_COREML)
500510
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/apple/coreml)
501511
endif()
@@ -542,6 +552,12 @@ endif()
542552

543553
if(EXECUTORCH_BUILD_EXTENSION_MODULE)
544554
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/module)
555+
install(
556+
DIRECTORY extension/module/
557+
DESTINATION include/executorch/extension/module
558+
FILES_MATCHING
559+
PATTERN "*.h"
560+
)
545561
endif()
546562

547563
if(EXECUTORCH_BUILD_EXTENSION_LLM)

backends/arm/_passes/decompose_linear_pass.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def call(self, graph_module):
8888
op_target=exir_ops.edge.aten.view_copy.default,
8989
args=(conv, list(output_shape)),
9090
kwargs={},
91+
from_node=node,
9192
)
9293

9394
node.replace_all_uses_with(output)

backends/arm/operator_support/tosa_supported_operators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ class CheckProperQuantization(OperatorSupportBase):
328328
exir_ops.edge.aten.upsample_bilinear2d.vec,
329329
exir_ops.edge.aten.upsample_nearest2d.vec,
330330
torch.ops.aten.scalar_tensor.default,
331+
exir_ops.edge.aten.mean.dim,
331332
*TableOps.included_ops(),
332333
)
333334

backends/nxp/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 NXP
2+
#
3+
# This source code is licensed under the BSD-style license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
set(
7+
_common_include_directories
8+
${CMAKE_CURRENT_SOURCE_DIR}/../../..
9+
${CMAKE_CURRENT_SOURCE_DIR}/../../runtime/core/portable_type/c10
10+
)
11+
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
12+
13+
set(_neutron_sources ${CMAKE_CURRENT_SOURCE_DIR}/runtime/NeutronBackend.cpp )
14+
15+
add_library(executorch_delegate_neutron STATIC ${_neutron_sources})
16+
target_include_directories(
17+
executorch_delegate_neutron PUBLIC ${_common_include_directories}
18+
)

0 commit comments

Comments
 (0)