-
Notifications
You must be signed in to change notification settings - Fork 709
Add MediaTek backend CI #7120
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
cccclai
merged 18 commits into
pytorch:main
from
neuropilot-captain:add_ci_for_mtk_backend
Jun 12, 2025
Merged
Add MediaTek backend CI #7120
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7e74895
add MTK ci
MediaTek-ai 37eafe8
Merge branch 'pytorch:main' into add_ci_for_mtk_backend
neuropilot-captain 07b3514
Add test
6375007
Fix install package version
MediaTek-ai 10ec29f
Add to run install android script
MediaTek-ai e86eb62
Merge branch 'main' into add_ci_for_mtk_backend
neuropilot-captain da6648a
fix typo
MediaTek-ai 1d75ff8
Merge branch 'pytorch:main' into add_ci_for_mtk_backend
neuropilot-captain 08e8722
Merge branch 'main' into add_ci_for_mtk_backend
neuropilot-captain 6cc833a
remove android setup
MediaTek-ai 28b063c
Merge remote-tracking branch 'upstream/main' into add_ci_for_mtk_backend
neuropilot-captain 9a5ad98
Merge branch 'main' into add_ci_for_mtk_backend
neuropilot-captain fa1da75
Set python path and update for Express SDK
neuropilot-captain b6dd256
Install executorch
neuropilot-captain 6d61dd8
Install executorch
neuropilot-captain 5f17d5f
Merge branch 'main' into add_ci_for_mtk_backend
neuropilot-captain 85d2426
Install Executorch
neuropilot-captain de7f99e
Merge branch 'main' into add_ci_for_mtk_backend
neuropilot-captain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
| # Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| # All rights reserved. | ||
| # | ||
| # 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 | ||
|
|
||
| build_neuron_backend() { | ||
| echo "Start building neuron backend." | ||
| export ANDROID_NDK=/opt/ndk | ||
| export MEDIATEK_SDK_ROOT=/tmp/neuropilot | ||
| export NEURON_BUFFER_ALLOCATOR_LIB=${MEDIATEK_SDK_ROOT}/libneuron_buffer_allocator.so | ||
| export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
|
|
||
|
|
||
| cd ${EXECUTORCH_ROOT} | ||
| ./backends/mediatek/scripts/mtk_build.sh | ||
| } | ||
|
|
||
| build_neuron_backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/bin/bash | ||
| # Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| # All rights reserved. | ||
| # | ||
| # 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 | ||
|
|
||
| MEDIATEK_INSTALLATION_DIR=/tmp/neuropilot | ||
| EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
|
|
||
| install_neuropilot() { | ||
| echo "Start installing neuropilot." | ||
| mkdir -p "${MEDIATEK_INSTALLATION_DIR}" | ||
|
|
||
| curl -Lo /tmp/neuropilot-express-sdk-8.0.4-build20241016.tar.gz "https://s3.ap-southeast-1.amazonaws.com/mediatek.neuropilot.com/8c1ff4e4-4256-47ed-9e24-67818b4cc4b9.gz" | ||
| echo "Finishing downloading neuropilot sdk." | ||
| tar zxvf /tmp/neuropilot-express-sdk-8.0.4-build20241016.tar.gz --strip-components=1 --directory "${MEDIATEK_INSTALLATION_DIR}" | ||
| echo "Finishing unzip neuropilot sdk." | ||
|
|
||
| # Print the content for manual verification | ||
| ls -lah "${MEDIATEK_INSTALLATION_DIR}" | ||
| } | ||
|
|
||
| install_android() { | ||
| cp ${EXECUTORCH_ROOT}/.ci/docker/common/install_android.sh install_android.sh | ||
| ANDROID_NDK_VERSION=r27b ./install_android.sh | ||
| rm install_android.sh | ||
| } | ||
|
|
||
| setup_neuropilot() { | ||
| pip3 install -r ${EXECUTORCH_ROOT}/backends/mediatek/requirements.txt | ||
| pip3 install ${MEDIATEK_INSTALLATION_DIR}/mtk_neuron-8.2.13-py3-none-linux_x86_64.whl | ||
| pip3 install ${MEDIATEK_INSTALLATION_DIR}/mtk_converter-8.9.1_public_packages/mtk_converter-8.9.1+public-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | ||
| } | ||
|
|
||
| setup_calibration_data() { | ||
| curl -Lo /tmp/imagenette2-160.tgz https://s3.amazonaws.com/fast-ai-imageclas/imagenette2-160.tgz | ||
| tar zxvf /tmp/imagenette2-160.tgz --strip-components=1 --directory "${MEDIATEK_INSTALLATION_DIR}" | ||
| } | ||
|
|
||
| install_android | ||
| install_neuropilot | ||
| setup_neuropilot | ||
| setup_calibration_data | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.