Skip to content

NXP backend: Enable initial unit tests workflow #11396

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

Merged
Merged
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
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-clang12
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to install the NXP sdk here? See my PR with retries, I am on phone so can't look it up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. The test requirements are installed in the trunk.yaml:

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


# '-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