Skip to content

Fix of the test-arm-backend-delegation flow #2143

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

Closed
wants to merge 6 commits into from
Closed
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
51 changes: 29 additions & 22 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,31 @@ jobs:
# Test selective build
PYTHON_EXECUTABLE=python bash examples/portable/scripts/test_demo_backend_delegation.sh "${BUILD_TOOL}"

# TODO(Jerry-Ge): Enable this back https://github.com/pytorch/executorch/issues/1947
# test-arm-backend-delegation:
# name: test-arm-backend-delegation
# uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
# with:
# runner: linux.2xlarge
# docker-image: executorch-ubuntu-22.04-arm-sdk
# submodules: 'true'
# ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
# 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}"

# source .ci/scripts/utils.sh
# install_flatc_from_source
# install_executorch

# # Test selective build
# source /opt/arm-sdk/setup_path.sh
# PYTHON_EXECUTABLE=python bash examples/arm/run.sh /opt/arm-sdk buck2
test-arm-backend-delegation:
name: test-arm-backend-delegation
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.2xlarge
docker-image: executorch-ubuntu-22.04-arm-sdk
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
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}"

source .ci/scripts/utils.sh
install_flatc_from_source
install_executorch

# Setup arm example environment (including TOSA tools)
git config --global user.email "[email protected]"
git config --global user.name "Github Executorch"
bash examples/arm/setup.sh --i-agree-to-the-contained-eula

# Test ethos-u delegate examples with run.sh
source examples/arm/ethos-u-scratch/setup_path.sh
PYTHON_EXECUTABLE=python bash examples/arm/run.sh examples/arm/ethos-u-scratch/ buck2

test-arm-reference-delegation:
name: test-arm-reference-delegation
Expand All @@ -176,13 +180,16 @@ jobs:
install_flatc_from_source
install_executorch

# Setup arm example environment (including TOSA tools)
git config --global user.email "[email protected]"
git config --global user.name "Github Executorch"
bash examples/arm/setup.sh --i-agree-to-the-contained-eula

source /opt/arm-sdk/setup_path.sh
# Test tosa_reference flow
source examples/arm/ethos-u-scratch/setup_path.sh
PYTHON_EXECUTABLE=python bash backends/arm/test/run_tosa_reference.sh

# Run Arm specific unit-tests
# Run pytest only on specified folders. These test should migrate into
# the _unittest.yml once that test env is fixed
pytest -c /dev/null -v -n auto --cov=./ --cov-report=xml backends/arm/test/ops/ backends/arm/test/models
Expand Down
2 changes: 1 addition & 1 deletion examples/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ include(${EXECUTORCH_ROOT}/build/Codegen.cmake)
gen_selected_ops("" "${EXECUTORCH_SELECT_OPS_LIST}" "")
generate_bindings_for_kernels(
${EXECUTORCH_ROOT}/kernels/portable/functions.yaml "")
gen_operators_lib("portable_ops_lib" portable_kernels executorch)
gen_operators_lib("arm_portable_ops_lib" portable_kernels executorch)
2 changes: 1 addition & 1 deletion examples/arm/executor_runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ set_property(TARGET executorch_delegate_ethos_u PROPERTY IMPORTED_LOCATION

add_library(portable_ops_lib STATIC IMPORTED)
set_property(TARGET portable_ops_lib PROPERTY IMPORTED_LOCATION
"${ET_BUILD_DIR_PATH}/examples/arm/libportable_ops_lib.a")
"${ET_BUILD_DIR_PATH}/examples/arm/libarm_portable_ops_lib.a")

add_library(portable_kernels STATIC IMPORTED)
set_property(TARGET portable_kernels PROPERTY IMPORTED_LOCATION
Expand Down
14 changes: 12 additions & 2 deletions examples/arm/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function setup_tosa_reference_model() {
n=1
fi

make -j"$(n)"
make -j"${n}"
cd reference_model
tosa_bin_path=`pwd`
echo "export PATH=\${PATH}:${tosa_bin_path}" >> "${setup_path_script}"
Expand All @@ -219,7 +219,17 @@ function setup_vela() {
patch_repo
fi
cd "${root_dir}/ethos-u-vela"
pip3 install . --user

# different command for conda vs venv
VNV=$(python3 -c "import sys; print('venv') if (sys.prefix != sys.base_prefix) else print('not_venv')")
if [ ${VNV} == "venv" ]; then
pip install .
else
# if not venv, we need the site-path where the vela
vela_path=$(python -c "import site; print(site.USER_BASE+'/bin')")
echo "export PATH=\${PATH}:${vela_path}" >> ${setup_path_script}
pip install . --user
fi
}

########
Expand Down