Skip to content

Introducing NXP Neutron runtime #10563

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
30 changes: 30 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,36 @@ jobs:
exit 1
fi

nxp-build-test:
name: nxp-build-test
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-arm-sdk
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
# 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
cmake -DEXECUTORCH_BUILD_NXP_NEUTRON=ON -Bcmake-out .
cmake --build cmake-out --target executorch_delegate_neutron --config Release

# Build check for the neutron backend library
lib_neutron="cmake-out/backends/nxp/libexecutorch_delegate_neutron.a"
if [ -f $lib_neutron ]; then
echo "Neutron backend library built."
else
echo "Neutron backend library not found!"
exit 1
fi

test-coreml-delegate:
name: test-coreml-delegate
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ if(EXECUTORCH_BUILD_CADENCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/cadence)
endif()

if(EXECUTORCH_BUILD_NXP_NEUTRON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/nxp)
endif()

if(EXECUTORCH_BUILD_COREML)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/apple/coreml)
endif()
Expand Down
18 changes: 18 additions & 0 deletions backends/nxp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 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(
_common_include_directories
${CMAKE_CURRENT_SOURCE_DIR}/../../..
${CMAKE_CURRENT_SOURCE_DIR}/../../runtime/core/portable_type/c10
)
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)

set(_neutron_sources ${CMAKE_CURRENT_SOURCE_DIR}/runtime/NeutronBackend.cpp )

add_library(executorch_delegate_neutron STATIC ${_neutron_sources})
target_include_directories(
executorch_delegate_neutron PUBLIC ${_common_include_directories}
)
Loading
Loading