Skip to content

Commit 32cf04c

Browse files
snadampalpytorchmergebot
authored andcommitted
CI: add aarch64 linux workflow (#121284)
aarch64 linux workflow is triggered for ciflow/aarch64 tags. Pull Request resolved: #121284 Approved by: https://github.com/atalman, https://github.com/malfet
1 parent ae13c7e commit 32cf04c

8 files changed

Lines changed: 75 additions & 4 deletions

File tree

.ci/docker/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ case "$image" in
306306
DB=yes
307307
VISION=yes
308308
CONDA_CMAKE=yes
309+
# snadampal: skipping sccache due to the following issue
310+
# https://github.com/pytorch/pytorch/issues/121559
311+
SKIP_SCCACHE_INSTALL=yes
312+
# snadampal: skipping llvm src build install because the current version
313+
# from pytorch/llvm:9.0.1 is x86 specific
314+
SKIP_LLVM_SRC_BUILD_INSTALL=yes
309315
;;
310316
*)
311317
# Catch-all for builds that are not hardcoded.
@@ -399,6 +405,8 @@ DOCKER_BUILDKIT=1 docker build \
399405
--build-arg "EXECUTORCH=${EXECUTORCH}" \
400406
--build-arg "BASEKIT_VERSION=${BASEKIT_VERSION}" \
401407
--build-arg "ACL=${ACL:-}" \
408+
--build-arg "SKIP_SCCACHE_INSTALL=${SKIP_SCCACHE_INSTALL:-}" \
409+
--build-arg "SKIP_LLVM_SRC_BUILD_INSTALL=${SKIP_LLVM_SRC_BUILD_INSTALL:-}" \
402410
-f $(dirname ${DOCKERFILE})/Dockerfile \
403411
-t "$tmp_tag" \
404412
"$@" \

.ci/docker/requirements-ci.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,11 @@ unittest-xml-reporting<=3.2.0,>=2.0.0
263263
#Pinned versions:
264264
#test that import:
265265

266-
#wheel not found on aarch64, and source build requires rust
267266
lintrunner==0.10.7 ; platform_machine == "x86_64"
267+
#lintrunner is supported on aarch64-linux only from 0.12.4 version
268+
lintrunner==0.12.5 ; platform_machine == "aarch64"
268269
#Description: all about linters!
269-
#Pinned versions: 0.10.7
270+
#Pinned versions: 0.10.7 on x86 and 0.12.5 on aarch64
270271
#test that import:
271272

272273
rockset==1.0.3

.ci/docker/ubuntu/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ RUN rm install_acl.sh
169169
ENV INSTALLED_ACL ${ACL}
170170

171171
# Install ccache/sccache (do this last, so we get priority in PATH)
172+
ARG SKIP_SCCACHE_INSTALL
172173
COPY ./common/install_cache.sh install_cache.sh
173174
ENV PATH /opt/cache/bin:$PATH
174-
RUN bash ./install_cache.sh && rm install_cache.sh
175+
RUN if [ -z "${SKIP_SCCACHE_INSTALL}" ]; then bash ./install_cache.sh; fi
176+
RUN rm install_cache.sh
175177

176178
# Add jni.h for java host build
177179
COPY ./common/install_jni.sh install_jni.sh
@@ -188,7 +190,9 @@ ARG BUILD_ENVIRONMENT
188190
ENV BUILD_ENVIRONMENT ${BUILD_ENVIRONMENT}
189191

190192
# Install LLVM dev version (Defined in the pytorch/builder github repository)
193+
ARG SKIP_LLVM_SRC_BUILD_INSTALL
191194
COPY --from=pytorch/llvm:9.0.1 /opt/llvm /opt/llvm
195+
RUN if [ -n "${SKIP_LLVM_SRC_BUILD_INSTALL}" ]; then set -eu; rm -rf /opt/llvm; fi
192196

193197
# AWS specific CUDA build guidance
194198
ENV TORCH_CUDA_ARCH_LIST Maxwell

.ci/pytorch/build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,4 +376,8 @@ if [[ "$BUILD_ENVIRONMENT" != *libtorch* && "$BUILD_ENVIRONMENT" != *bazel* ]];
376376
python tools/stats/export_test_times.py
377377
fi
378378

379-
print_sccache_stats
379+
# snadampal: skipping it till sccache support added for aarch64
380+
# https://github.com/pytorch/pytorch/issues/121559
381+
if [[ "$BUILD_ENVIRONMENT" != *aarch64* ]]; then
382+
print_sccache_stats
383+
fi

.ci/pytorch/test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ if [[ "$BUILD_ENVIRONMENT" != *-bazel-* ]] ; then
181181
export PATH="$HOME/.local/bin:$PATH"
182182
fi
183183

184+
if [[ "$BUILD_ENVIRONMENT" == *aarch64* ]]; then
185+
# TODO: revisit this once the CI is stabilized on aarch64 linux
186+
export VALGRIND=OFF
187+
fi
188+
184189
install_tlparse
185190

186191
# DANGER WILL ROBINSON. The LD_PRELOAD here could cause you problems

.github/pytorch-probot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ciflow_push_tags:
88
- ciflow/binaries_wheel
99
- ciflow/inductor
1010
- ciflow/inductor-perf-compare
11+
- ciflow/linux-aarch64
1112
- ciflow/mps
1213
- ciflow/nightly
1314
- ciflow/periodic
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: linux-aarch64
2+
3+
on:
4+
# For testing purposes, removeme later
5+
pull_request:
6+
push:
7+
tags:
8+
- ciflow/linux-aarch64/*
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} but found ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
linux-jammy-aarch64-py3_10-build:
17+
name: linux-jammy-aarch64-py3.10
18+
uses: ./.github/workflows/_linux-build.yml
19+
with:
20+
build-environment: linux-jammy-aarch64-py3.10
21+
docker-image-name: pytorch-linux-jammy-aarch64-py3.10-gcc11
22+
runner: linux.arm64.2xlarge
23+
test-matrix: |
24+
{ include: [
25+
{ config: "default", shard: 1, num_shards: 1, runner: "linux.arm64.2xlarge" },
26+
]}
27+
28+
linux-jammy-aarch64-py3_10-test:
29+
name: linux-jammy-aarch64-py3.10
30+
uses: ./.github/workflows/_linux-test.yml
31+
needs: linux-jammy-aarch64-py3_10-build
32+
permissions:
33+
id-token: write
34+
contents: read
35+
with:
36+
build-environment: linux-jammy-aarch64-py3.10
37+
docker-image: ${{ needs.linux-jammy-aarch64-py3_10-build.outputs.docker-image }}
38+
test-matrix: ${{ needs.linux-jammy-aarch64-py3_10-build.outputs.test-matrix }}

test/run_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
from torch.testing._internal.common_utils import (
2727
FILE_SCHEMA,
2828
get_report_path,
29+
IS_ARM64,
2930
IS_CI,
31+
IS_LINUX,
3032
IS_MACOS,
3133
parser as common_parser,
3234
retry_shell,
@@ -265,6 +267,10 @@ def __contains__(self, item):
265267
"test_torch",
266268
]
267269

270+
# A subset of the TEST list for aarch64 linux platform
271+
ARM64_LINUX_TEST_LIST = [
272+
"test_modules",
273+
]
268274

269275
# if a test file takes longer than 5 min, we add it to TARGET_DET_LIST
270276
SLOW_TEST_THRESHOLD = 300
@@ -1298,6 +1304,10 @@ def can_run_in_pytest(test):
12981304

12991305

13001306
def get_selected_tests(options) -> List[str]:
1307+
if IS_ARM64 and IS_LINUX:
1308+
selected_tests = ARM64_LINUX_TEST_LIST
1309+
return selected_tests
1310+
13011311
selected_tests = options.include
13021312

13031313
# filter if there's JIT only and distributed only test options

0 commit comments

Comments
 (0)