Skip to content

Commit ce885dc

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

File tree

6 files changed

+91
-4
lines changed

6 files changed

+91
-4
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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@d4l3k/conda_no_capture
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
44+
runner: linux.arm64.r7g.12xlarge.memory

build_ncclx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function build_third_party {
134134
build_fb_oss_library "https://github.com/fastfloat/fast_float.git" "v8.0.2" fast_float "-DFASTFLOAT_INSTALL=ON"
135135
build_fb_oss_library "https://github.com/libevent/libevent.git" "release-2.1.12-stable" event
136136
build_fb_oss_library "https://github.com/google/double-conversion.git" "v3.3.1" double-conversion
137-
build_fb_oss_library "https://github.com/facebook/folly.git" "$third_party_tag" folly "-DUSE_STATIC_DEPS_ON_UNIX=ON"
137+
build_fb_oss_library "https://github.com/facebook/folly.git" "$third_party_tag" folly "-DUSE_STATIC_DEPS_ON_UNIX=ON -DOPENSSL_USE_STATIC_LIBS=ON"
138138
else
139139
if [[ -z "${NCCL_SKIP_CONDA_INSTALL}" ]]; then
140140
DEPS=(

scripts/_build_wheel.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ set -ex
1010
dnf config-manager --set-enabled powertools
1111
dnf install -y almalinux-release-devel
1212
dnf install -y openssl-static ninja-build cmake
13-
14-
# Install older openssl which is compatible with manylinux2.28 system openssl.
15-
conda install -y openssl==3.0.18
13+
conda install -y -c conda-forge libopenssl-static
1614

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

scripts/_emulate_build_wheel.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,35 @@
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
25+
26+
# Python 3.10
1427
#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
28+
29+
# Python 3.13
1530
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
1631

32+
# Python 3.13t
33+
#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 python-freethreading -c conda-forge
34+
1735
CONDA_RUN="conda run --no-capture-output -p ${CONDA_ENV}"
1836

1937
${CONDA_RUN} pip install torch --pre --index-url https://download.pytorch.org/whl/nightly/cu128
2038

39+
# Uncomment to debug the build w/ docker exec
40+
#${CONDA_RUN} bash -c "sleep 10000000000000"
41+
2142
${CONDA_RUN} bash scripts/_build_wheel.sh
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

scripts/docker_build_wheel.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
set -ex
1010

11+
docker stop torchcomms || true
12+
docker rm torchcomms || true
13+
1114
docker run --name torchcomms \
1215
--net=host \
1316
-i \

0 commit comments

Comments
 (0)