Skip to content

Commit b4443e8

Browse files
chong-chen01Jiseong-oh
authored andcommitted
Add test cases for samsung enn backend in ci
Currently, support to delegate to EnnBackend for several models. Enable basic float model like ic3, resnet, etc. Co-authored-by: chong-chen <[email protected]>
1 parent 6870437 commit b4443e8

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# Copyright (c) Samsung Electronics Co. LTD
4+
# All rights reserved.
5+
#
6+
# This source code is licensed under the BSD-style license found in the
7+
# LICENSE file in the root directory of this source tree.
8+
9+
set -ex
10+
11+
12+
download_ai_lite_core() {
13+
AI_LITE_CORE_VERSION=$1
14+
_exynos_ai_lite_core_url="https://ko.ai-studio-farm.com:26310/api/v1/buckets/lite-core/objects/download?prefix=05/ubuntu2204/exynos-ai-litecore-v0.5.0,tar.gz"
15+
16+
_exynos_lite_core_dir=/tmp/exynos_ai_lite_core
17+
mkdir -p ${_exynos_lite_core_dir}
18+
19+
_tmp_archive="/tmp/exynos-ai-litecore-v0.5.0.tar.gz"
20+
21+
curl --silent --show-error --location --fail --retry 3 \
22+
--output "${_tmp_archive}" "${_exynos_ai_lite_core_url}"
23+
24+
tar -C "${_exynos_lite_core_dir}" --strip-components=1 -xzvf "${_tmp_archive}"
25+
26+
export EXYNOS_AI_LITECORE_ROOT=${_exynos_lite_core_dir}
27+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${EXYNOS_AI_LITECORE_ROOT}/lib/x86_64-linux
28+
}
29+
30+
install_enn_backend() {
31+
# Please export ANDROID_NDK_ROOT if enable on-device test
32+
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
33+
34+
# Remove --build and add --ndk parameter if enable on-device test
35+
bash backends/samsung/build.sh --build x86_64
36+
export PYTHONPATH=${PYTHONPATH}:${EXECUTORCH_ROOT}/..
37+
}
38+
39+
AI_LITE_CORE_VERSION=0.5.0
40+
41+
download_ai_lite_core ${AI_LITE_CORE_VERSION}
42+
install_enn_backend

.github/workflows/pull.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,38 @@ jobs:
864864
PYTHON_EXECUTABLE=python bash examples/nxp/run_aot_example.sh
865865
866866
867+
test-samsung-models-linux:
868+
name: test-samsung-models-linux
869+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
870+
permissions:
871+
id-token: write
872+
contents: read
873+
with:
874+
runner: linux.2xlarge
875+
docker-image: ci-image:executorch-ubuntu-22.04-clang12
876+
submodules: 'recursive'
877+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
878+
timeout: 90
879+
script: |
880+
set -eux
881+
882+
# The generic Linux job chooses to use base env, not the one setup by the image
883+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
884+
conda activate "${CONDA_ENV}"
885+
886+
# Setup python
887+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "cmake"
888+
889+
# Setup Samsung SDK (AI Lite Core) and install enn backend
890+
source .ci/scripts/setup-samsung-linux-deps.sh
891+
892+
# Test models serially
893+
models="mv2 ic3 resnet18 resnet50"
894+
for model in $models; do
895+
python -m executorch.examples.samsung.aot_compiler --model_name=$model -c E9955
896+
done
897+
898+
867899
test-vulkan-models-linux:
868900
name: test-vulkan-models-linux
869901
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main

0 commit comments

Comments
 (0)