Skip to content

Arm build and runner CI #1111

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 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b98ba52
add a docker config
kirklandsign Oct 30, 2023
1c2da64
add a workflow to trigger it
kirklandsign Oct 30, 2023
f575b59
comment out
kirklandsign Oct 31, 2023
fb5e1da
need to add to workflow
kirklandsign Oct 31, 2023
6e5c1eb
fix lintrunner
kirklandsign Oct 31, 2023
1f0bc6c
dockerfile
kirklandsign Oct 31, 2023
0259e64
sh
kirklandsign Oct 31, 2023
37e574e
set up sdk
kirklandsign Oct 31, 2023
c78399c
temp run
kirklandsign Oct 31, 2023
5572a94
trigger pull
kirklandsign Oct 31, 2023
f663e7b
build tool
kirklandsign Oct 31, 2023
a5b8db4
fix sdk path
kirklandsign Oct 31, 2023
3b9da88
fix buck2
kirklandsign Oct 31, 2023
9657c5a
fix path
kirklandsign Oct 31, 2023
10038e9
fix path
kirklandsign Oct 31, 2023
6a6478d
fix path
kirklandsign Oct 31, 2023
77cc058
path
kirklandsign Oct 31, 2023
404481a
fix
kirklandsign Oct 31, 2023
678ac63
sh path
kirklandsign Oct 31, 2023
010f4c7
mkdir -p
kirklandsign Oct 31, 2023
5295146
chown fix
kirklandsign Oct 31, 2023
7ef54d5
chown fix
kirklandsign Oct 31, 2023
181fa12
run as user
kirklandsign Oct 31, 2023
5fc0f15
Revert "run as user"
kirklandsign Oct 31, 2023
1d2e724
copy stuff
kirklandsign Oct 31, 2023
5e43b99
copy stuff
kirklandsign Oct 31, 2023
c1e4233
print dir
kirklandsign Oct 31, 2023
ab6e335
refresh
kirklandsign Oct 31, 2023
1388e36
setup git
kirklandsign Oct 31, 2023
170eb22
remove arm
kirklandsign Oct 31, 2023
e4c9e77
CI caught an issue
kirklandsign Oct 31, 2023
65e0424
clean up
kirklandsign Oct 31, 2023
e1aab58
update docker image name
kirklandsign Oct 31, 2023
cf47270
update path
kirklandsign Oct 31, 2023
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
9 changes: 8 additions & 1 deletion .ci/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ case "${IMAGE_NAME}" in
executorch-ubuntu-22.04-linter)
LINTRUNNER=yes
;;
executorch-ubuntu-22.04-arm-sdk)
ARM_SDK=yes
;;
*)
echo "Invalid image name ${IMAGE_NAME}"
exit 1
Expand All @@ -41,6 +44,9 @@ BUILD_DOCS=1
# Copy requirements-lintrunner.txt from root to here
cp ../../requirements-lintrunner.txt ./

# Copy arm setup script from root to here
cp -r ../../examples/arm/ ./arm
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW how do we trigger an image build if examples/arm changes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only should need setup.sh and patches FWIW. But your question is valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's harder to copy the specific files than the entire dir :p


docker build \
--no-cache \
--progress=plain \
Expand All @@ -52,8 +58,9 @@ docker build \
--build-arg "TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION}.${NIGHTLY}" \
--build-arg "TORCHVISION_VERSION=${TORCHVISION_VERSION}.${NIGHTLY}" \
--build-arg "BUCK2_VERSION=${BUCK2_VERSION}" \
--build-arg "LINTRUNNER=${LINTRUNNER}" \
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
--build-arg "ARM_SDK=${ARM_SDK:-}" \
-f "${OS}"/Dockerfile \
"$@" \
.
5 changes: 5 additions & 0 deletions .ci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,10 @@ COPY ./requirements-lintrunner.txt requirements-lintrunner.txt
RUN if [ -n "${LINTRUNNER}" ]; then bash ./install_linter.sh; fi
RUN rm install_linter.sh utils.sh requirements-lintrunner.txt

ARG ARM_SDK
COPY --chown=ci-user:ci-user ./arm /opt/arm
# Set up ARM SDK if needed
RUN if [ -n "${ARM_SDK}" ]; then git config --global user.email "[email protected]"; git config --global user.name "OSS CI"; bash /opt/arm/setup.sh --i-agree-to-the-contained-eula /opt/arm-sdk; chown -R ci-user:ci-user /opt/arm-sdk; fi

USER ci-user
CMD ["bash"]
1 change: 1 addition & 0 deletions .github/workflows/docker-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
include:
- docker-image-name: executorch-ubuntu-22.04-clang12
- docker-image-name: executorch-ubuntu-22.04-linter
- docker-image-name: executorch-ubuntu-22.04-arm-sdk
env:
DOCKER_IMAGE: 308535385114.dkr.ecr.us-east-1.amazonaws.com/executorch/${{ matrix.docker-image-name }}
steps:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ jobs:
# Test selective build
PYTHON_EXECUTABLE=python bash examples/portable/scripts/test_demo_backend_delegation.sh "${BUILD_TOOL}"

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}"

PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh cmake
# Test selective build
source /opt/arm-sdk/setup_path.sh
PYTHON_EXECUTABLE=python bash examples/arm/run.sh /opt/arm-sdk buck2

test-coreml-delegate:
name: test-coreml-delegate
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
Expand Down
4 changes: 1 addition & 3 deletions backends/arm/arm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ def vela_compile(tosa_fb):
# Add a block for scratch, inputs and outputs; scratch shape is a 1 element
# array giving us size in bytes so extract this and add a block of 0's.
# Currently we preallocated this on the host to provide SRAM for computation.
if len(data["scratch_shape"][0]) != 1:
raise RuntimeError("Expected scratch to be single array")
block_length = data["scratch_shape"][0].item()
block_length = int(data["scratch_shape"][0])
bin_blocks["scratch_data"] = b"\x00" * block_length

# Capture inputs and outputs
Expand Down