Skip to content

NXP backend: Add docker image for nxp backend tests #11473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .ci/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ case "${IMAGE_NAME}" in
CLANG_VERSION=12
ANDROID_NDK_VERSION=r27b
;;
executorch-ubuntu-22.04-nxp-sdk)
LINTRUNNER=""
NXP_SDK=yes
CLANG_VERSION=12
;;
executorch-ubuntu-22.04-clang12-android)
LINTRUNNER=""
CLANG_VERSION=12
Expand Down
2 changes: 2 additions & 0 deletions .ci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,7 @@ ARG QNN_SDK

ARG MEDIATEK_SDK

ARG NXP_SDK

USER ci-user
CMD ["bash"]
1 change: 1 addition & 0 deletions .github/workflows/docker-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
executorch-ubuntu-22.04-arm-sdk,
executorch-ubuntu-22.04-qnn-sdk,
executorch-ubuntu-22.04-mediatek-sdk,
executorch-ubuntu-22.04-nxp-sdk,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have anything special to install in the docker image right? If yes, I guess we can continue to use the base image? What are your thoughts?

@cccclai - what was the rationale for suggesting a new docker image?

Copy link
Collaborator Author

@robert-kalmar robert-kalmar Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't. At least not at this moment.
Looking at the docker file nobody (arm, qnn, mediatek) really does https://github.com/pytorch/executorch/blob/79e53ebd00d07bef28975b1a089ce87a074c9ab7/.ci/docker/ubuntu/Dockerfile .
Although Arm in early day installed the Arm SDK on docker-image https://github.com/pytorch/executorch/pull/1111/files#diff-f271c3ed0c135590409465f4ad55c570c418d2c0509bbf1b1352ebdd1e6611d1

+1 for the rationale @cccclai

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huydhn to share, as @kirklandsign is out.

executorch-ubuntu-22.04-clang12-android
]
include:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,32 @@ jobs:
build-mode: Release
build-tool: cmake
docker-image: executorch-ubuntu-22.04-clang12

unittest-nxp-neutron:
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
id-token: write
contents: read
with:
runner: linux.2xlarge
docker-image: executorch-ubuntu-22.04-nxp-sdk
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
set -eux

# The generic Linux job chooses to use base env, not the one setup by the image
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"

# Build and install Executorch
PYTHON_EXECUTABLE=python \
CMAKE_ARGS="-DEXECUTORCH_BUILD_NXP_NEUTRON=ON" \
.ci/scripts/setup-linux.sh --build-tool "cmake"

# Install test requirements
pip install -r backends/nxp/requirements-tests.txt

# Run pytest
PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh
2 changes: 1 addition & 1 deletion backends/nxp/requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ tensorflow==2.18.0
pytest-mock
tflite
GvGen
neutron-converter_SDK_25_03
neutron_converter_SDK_25_03
14 changes: 14 additions & 0 deletions backends/nxp/run_unittests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Copyright 2025 NXP
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
set -eux

SCRIPT_DIR=$(dirname $(readlink -fm $0))
EXECUTORCH_DIR=$(dirname $(dirname $SCRIPT_DIR))

cd $EXECUTORCH_DIR

# '-c /dev/null' is used to ignore root level pytest.ini.
PYTHONPATH=`cd ..; pwd` pytest -c /dev/null backends/nxp/tests/
2 changes: 1 addition & 1 deletion examples/nxp/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
set -u

# Install neutron-converter
pip install --extra-index-url https://eiq.nxp.com/repository neutron-converter_SDK_25_03
pip install --extra-index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_03
Loading