Skip to content

Commit 8769c9f

Browse files
committed
ci: build wheels for linux-aarch64
1 parent f9a45be commit 8769c9f

File tree

4 files changed

+79
-2
lines changed

4 files changed

+79
-2
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build Linux Aarch64 Wheels
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- nightly
9+
workflow_dispatch:
10+
11+
jobs:
12+
generate-matrix:
13+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
14+
with:
15+
package-type: wheel
16+
os: linux-aarch64
17+
test-infra-repository: pytorch/test-infra
18+
test-infra-ref: main
19+
with-cuda: enable
20+
with-rocm: disable
21+
with-cpu: disable
22+
# TODO: Python free threading builds are broken due to newer openssl
23+
# requirements.
24+
python-versions: '["3.10","3.11","3.12","3.13","3.14"]'
25+
build:
26+
needs: generate-matrix
27+
name: ${{ matrix.repository }}
28+
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
29+
with:
30+
repository: meta-pytorch/torchcomms
31+
ref: ""
32+
pre-script: ""
33+
post-script: ""
34+
build-platform: "python-build-package"
35+
build-command: "scripts/_build_wheel.sh"
36+
smoke-test-script: "scripts/smoke_test.py"
37+
package-name: torchcomms
38+
test-infra-repository: pytorch/test-infra
39+
test-infra-ref: main
40+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
41+
trigger-event: ${{ github.event_name }}
42+
architecture: aarch64
43+
#setup-miniconda: false

scripts/_build_wheel.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ dnf config-manager --set-enabled powertools
1111
dnf install -y almalinux-release-devel
1212
dnf install -y openssl-static ninja-build cmake
1313

14-
# Install older openssl which is compatible with manylinux2.28 system openssl.
15-
conda install -y openssl==3.0.18
14+
if [ "$(uname -m)" != "aarch64" ]; then
15+
# Install older openssl which is compatible with manylinux2.28 system openssl.
16+
conda install -y openssl==3.0.18
17+
fi
1618

1719
# Nuke conda cmake, ninja and libstdc++ we want to install to use system libraries.
1820
rm -f "$CONDA_PREFIX/lib/libstdc"* || true

scripts/_emulate_build_wheel.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@
88

99
set -ex
1010

11+
if [ "$(uname -m)" = "aarch64" ]; then
12+
echo "Building for aarch64"
13+
curl -L -o /mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
14+
chmod +x /mambaforge.sh
15+
/mambaforge.sh -b -p /opt/conda
16+
rm /mambaforge.sh
17+
source /opt/conda/etc/profile.d/conda.sh
18+
fi
19+
1120
cd /torchcomms
1221

22+
23+
1324
CONDA_ENV=/tmp/conda_env
1425
#conda create --yes --quiet --prefix "$CONDA_ENV" python=3.10 cmake=3.31.2 ninja=1.12.1 pkg-config=0.29 wheel=0.37
1526
conda create --yes --quiet --prefix "$CONDA_ENV" python=3.13 cmake=3.31.2 ninja=1.12.1 pkg-config=0.29 wheel=0.37
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
4+
# DO NOT DELETE
5+
# This script is used to build manylinux releases of torchcomms. The output from
6+
# this script should be able to be used on most modern OSes as long as the
7+
# Python version and CUDA version match.
8+
9+
set -ex
10+
11+
docker stop torchcomms || true
12+
docker rm torchcomms || true
13+
14+
docker run --name torchcomms \
15+
--arch=aarch64 \
16+
--net=host \
17+
-i \
18+
-t \
19+
-v ".:/torchcomms" \
20+
pytorch/manylinuxaarch64-builder:cuda12.9 \
21+
bash /torchcomms/scripts/_emulate_build_wheel.sh

0 commit comments

Comments
 (0)