Skip to content

Commit eeb84b3

Browse files
NXP backend: Enable initial unit tests workflow
Initial workflow definition for running unit tests for Neutron (NXP) backend. Co-authored-by: Lukas Sztefek <lukas.sztefek@nxp.com>
1 parent 6f44a79 commit eeb84b3

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

.github/workflows/trunk.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,3 +718,32 @@ jobs:
718718
build-mode: Release
719719
build-tool: cmake
720720
docker-image: executorch-ubuntu-22.04-clang12
721+
722+
unittest-nxp-neutron:
723+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
724+
permissions:
725+
id-token: write
726+
contents: read
727+
with:
728+
runner: linux.2xlarge
729+
docker-image: executorch-ubuntu-22.04-clang12
730+
submodules: 'recursive'
731+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
732+
timeout: 90
733+
script: |
734+
set -eux
735+
736+
# The generic Linux job chooses to use base env, not the one setup by the image
737+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
738+
conda activate "${CONDA_ENV}"
739+
740+
# Build and install Executorch
741+
PYTHON_EXECUTABLE=python \
742+
CMAKE_ARGS="-DEXECUTORCH_BUILD_NXP_NEUTRON=ON" \
743+
.ci/scripts/setup-linux.sh --build-tool "cmake"
744+
745+
# Install test requirements
746+
pip install -r backends/nxp/requirements-tests.txt
747+
748+
# Run pytest
749+
PYTHON_EXECUTABLE=python bash backends/nxp/run_unittests.sh

backends/nxp/requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ tensorflow==2.18.0
33
pytest-mock
44
tflite
55
GvGen
6-
neutron-converter_SDK_25_03
6+
neutron_converter_SDK_25_03

backends/nxp/run_unittests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Copyright 2025 NXP
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
set -eux
7+
8+
SCRIPT_DIR=$(dirname $(readlink -fm $0))
9+
EXECUTORCH_DIR=$(dirname $(dirname $SCRIPT_DIR))
10+
11+
cd $EXECUTORCH_DIR
12+
13+
# '-c /dev/null' is used to ignore root level pytest.ini.
14+
PYTHONPATH=`cd ..; pwd` pytest -c /dev/null backends/nxp/tests/

examples/nxp/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
set -u
88

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

0 commit comments

Comments
 (0)