Skip to content

Commit ca1297e

Browse files
authored
Promote linux aarch64 to tier 1 support (Qiskit#13737)
* Promote linux aarch64 to tier 1 support With native linux aarch64 runners available from github now available [1] we can run tests on every PR on the platform and promote it to tier 1 support [2]. This commit adds a github action test job that runs on PRs to test that the platform works on every commit. Then the wheel job is promoted to the tier 1 job which includes PGO which will improve the performance on the wheels we publish for the platform. While there is a larger effort to migrate our entire CI to github actions in Qiskit#13474 expanding our test matrix prior to that won't cause a conflict as we can easily expand the test matrix in that PR if this merges first. [1]: https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ [2]: https://docs.quantum.ibm.com/guides/install-qiskit#operating-system-support * Update job name for test job * Try latest manylinux image for arm * Use url for image path * Try without explicit latest tag * Tweak rust install script * Revert "Try without explicit latest tag" This reverts commit d39b6ee. * Split out aarch64 tier 1 job to separate job The aarch64 wheel builds are failing with PGO on latest stable (and stable - 1). This is likely either an issue in rustc or the llvm tools component from rustup on the later releases. But it seems to build fine with our MSRV. We build with latest stable for release jobs typically to enable the improvements from the latest compiler for what we publish. But PGO has enough benefit that using our MSRV is fine if that is what's necessary. * Remove duplicate tier 1 arm job * Try different target string to fix profile version mismatch * Tweak msrv install again * Only install a single rust toolchain in aarch64 env * Deduplicate job definitions * Add comment about msrv location * Remove stale comment * Fix release notes typo * Adjust run script * Set rust toolchain to msrv in build
1 parent d59e0c2 commit ca1297e

File tree

7 files changed

+38
-41
lines changed

7 files changed

+38
-41
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@ concurrency:
1313
jobs:
1414
tests:
1515
if: github.repository_owner == 'Qiskit'
16-
name: macOS-arm64-tests-Python-${{ matrix.python-version }}
17-
runs-on: macOS-14
16+
name: ${{ matrix.os }}-arm64-tests-Python-${{ matrix.python-version }}
17+
runs-on: ${{ matrix.os }}
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
# Normally we test min and max version but we can't run python
22-
# 3.9 on arm64 until actions/setup-python#808 is resolved
23-
python-version: ["3.10", "3.13"]
21+
python-version: ["3.9", "3.13"]
22+
os: ["macOS-14", "ubuntu-24.04-arm"]
2423
steps:
2524
- uses: actions/checkout@v4
26-
- name: Install Rust toolchain
27-
uses: dtolnay/[email protected]
28-
if: matrix.python-version == '3.10'
2925
- name: Set up Python ${{ matrix.python-version }}
3026
uses: actions/setup-python@v5
3127
with:
@@ -36,7 +32,7 @@ jobs:
3632
python -m pip install -U -r requirements.txt -c constraints.txt
3733
python -m pip install -U -r requirements-dev.txt -c constraints.txt
3834
python -m pip install -c constraints.txt -e .
39-
if: matrix.python-version == '3.10'
35+
if: matrix.python-version == '3.9'
4036
env:
4137
QISKIT_NO_CACHE_GATES: 1
4238
- name: 'Install dependencies'
@@ -49,6 +45,6 @@ jobs:
4945
run: |
5046
python -m pip install -r requirements-optional.txt -c constraints.txt
5147
python tools/report_numpy_state.py
52-
if: matrix.python-version == '3.10'
48+
if: matrix.python-version == '3.9'
5349
- name: 'Run tests'
5450
run: stestr run

.github/workflows/wheels-build.yml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ on:
4343
default: "default"
4444
required: false
4545

46-
wheels-linux-aarch64:
47-
description: >-
48-
The action to take for Linux AArch64 wheels.
49-
Choose from 'default', 'build' or 'skip'.
50-
type: string
51-
default: "default"
52-
required: false
53-
5446
artifact-prefix:
5547
description: "A prefix to give all artifacts uploaded with 'actions/upload-artifact'."
5648
type: string
@@ -85,12 +77,12 @@ jobs:
8577
# Used for the ARM builds.
8678
- macos-14
8779
- windows-latest
80+
- ubuntu-24.04-arm
8881
steps:
8982
- uses: actions/checkout@v4
9083
- uses: actions/setup-python@v5
9184
with:
9285
python-version: ${{ inputs.python-version }}
93-
architecture: ${{ matrix.os == 'macos-14' && 'arm64' || 'x64' }}
9486
- uses: dtolnay/rust-toolchain@stable
9587
with:
9688
components: llvm-tools-preview
@@ -108,12 +100,19 @@ jobs:
108100
run: |
109101
set -e
110102
mkdir -p "$PGO_WORK_DIR"
111-
103+
if [[ `uname -m` == "aarch64" ]] ; then
104+
INSTALL_RUST_PATH=tools/install_rust_msrv.sh
105+
RUST_TOOLCHAIN=1.79
106+
else
107+
INSTALL_RUST_PATH=tools/install_rust.sh
108+
RUST_TOOLCHAIN=stable
109+
fi
112110
cat >>"$GITHUB_ENV" <<EOF
111+
CIBW_BEFORE_ALL_LINUX=yum install -y wget && {package}/$INSTALL_RUST_PATH
113112
CIBW_BEFORE_BUILD=bash ./tools/build_pgo.sh $PGO_WORK_DIR $PGO_OUT_PATH
114113
CIBW_ENVIRONMENT=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
115114
CIBW_ENVIRONMENT_MACOS=MACOSX_DEPLOYMENT_TARGET='10.12' RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
116-
CIBW_ENVIRONMENT_LINUX=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function' PATH="\$PATH:\$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI="true"
115+
CIBW_ENVIRONMENT_LINUX=RUSTUP_TOOLCHAIN=$RUST_TOOLCHAIN RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function' PATH="\$PATH:\$HOME/.cargo/bin" CARGO_NET_GIT_FETCH_WITH_CLI="true"
117116
EOF
118117
env:
119118
PGO_WORK_DIR: ${{ github.workspace }}/pgo-data
@@ -123,7 +122,6 @@ jobs:
123122
with:
124123
path: ./wheelhouse/*.whl
125124
name: ${{ inputs.artifact-prefix }}wheels-tier-1-${{ matrix.os }}
126-
127125
wheels-linux-s390x:
128126
name: "Wheels / Linux s390x"
129127
if: (inputs.wheels-linux-s390x == 'default' && inputs.default-action || inputs.wheels-linux-s390x) == 'build'
@@ -170,22 +168,6 @@ jobs:
170168
path: ./wheelhouse/*.whl
171169
name: ${{ inputs.artifact-prefix }}wheels-linux-ppc64le
172170

173-
wheels-linux-aarch64:
174-
name: "Wheels / Linux AArch64"
175-
if: (inputs.wheels-linux-aarch64 == 'default' && inputs.default-action || inputs.wheels-linux-aarch64) == 'build'
176-
runs-on: ubuntu-24.04-arm
177-
steps:
178-
- uses: actions/checkout@v4
179-
- uses: actions/setup-python@v5
180-
with:
181-
python-version: ${{ inputs.python-version }}
182-
- uses: dtolnay/rust-toolchain@stable
183-
- uses: pypa/[email protected]
184-
- uses: actions/upload-artifact@v4
185-
with:
186-
path: ./wheelhouse/*.whl
187-
name: ${{ inputs.artifact-prefix }}wheels-linux-aarch64
188-
189171
sdist:
190172
name: "sdist"
191173
if: (inputs.sdist == 'default' && inputs.default-action || inputs.sdist) == 'build'

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resolver = "2"
55
[workspace.package]
66
version = "2.0.0"
77
edition = "2021"
8-
rust-version = "1.79" # Keep in sync with README.md and rust-toolchain.toml.
8+
rust-version = "1.79" # Keep in sync with README.md, rust-toolchain.toml, and tools/install_rust_msrv.sh
99
license = "Apache-2.0"
1010

1111
# Shared dependencies that can be inherited. This just helps a little with

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ target-version = ['py39', 'py310', 'py311']
165165

166166
[tool.cibuildwheel]
167167
manylinux-x86_64-image = "manylinux2014"
168-
manylinux-i686-image = "manylinux2014"
168+
manylinux-aarch64-image = "quay.io/pypa/manylinux2014_aarch64:latest"
169169
skip = "pp* cp36-* cp37-* cp38-* *musllinux* *win32 *i686 cp38-macosx_arm64"
170170
test-skip = "*win32 *linux_i686"
171171
test-command = "cp -r {project}/test . && QISKIT_PARALLEL=FALSE stestr --test-path test/python run --abbreviate"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
features:
3+
- |
4+
Support for the Linux aarch64 platform has been promoted to tier 1 support as documented in:
5+
6+
https://docs.quantum.ibm.com/guides/install-qiskit#operating-system-support
7+
8+
from its previous support level of tier 2 in the 1.x release series.

tools/install_rust.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
if [ ! -d rust-installer ]; then
33
mkdir rust-installer
44
wget https://sh.rustup.rs -O rust-installer/rustup.sh
5-
sh rust-installer/rustup.sh -y -c llvm-tools-preview
5+
sh rust-installer/rustup.sh -y -c llvm-tools
66
fi
7+
. "$HOME/.cargo/env"

tools/install_rust_msrv.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
if [ ! -d rust-installer ]; then
3+
mkdir rust-installer
4+
wget https://sh.rustup.rs -O rust-installer/rustup.sh
5+
sh rust-installer/rustup.sh -y -c llvm-tools
6+
rustup default 1.79
7+
rustup component add llvm-tools
8+
rustup uninstall stable
9+
fi
10+
. "$HOME/.cargo/env"

0 commit comments

Comments
 (0)