Skip to content
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

Promote linux aarch64 to tier 1 support #13737

Merged
merged 21 commits into from
Feb 24, 2025
Merged

Conversation

mtreinish
Copy link
Member

Summary

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 #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.

Details and comments

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
@mtreinish mtreinish added type: qa Issues and PRs that relate to testing and code quality Changelog: New Feature Include in the "Added" section of the changelog ci: test wheels Run the wheel-build scripts as an additional CI run for this PR labels Jan 26, 2025
@mtreinish mtreinish requested a review from a team as a code owner January 26, 2025 02:04
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Jan 26, 2025

Pull Request Test Coverage Report for Build 13474441452

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 10 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.002%) to 88.119%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 91.98%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 13469145802: -0.002%
Covered Lines: 78394
Relevant Lines: 88964

💛 - Coveralls

@mtreinish mtreinish added this to the 2.0.0 milestone Jan 30, 2025
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.
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for the giant slog getting this to a point where the PGO finally passes. I'm excited to get AArch64 up to Tier 1.

edit: I posted this review pretty immediately in excitement when I saw the PGO pass - sorry if I jumped the gun and you hadn't had time to do any tidy up you were planning.

@mtreinish
Copy link
Member Author

mtreinish commented Feb 24, 2025

This should be ready to go now.

For those following along, the issue seems to be a build issue in the llvm-tools libraries bundled with rustup on aarch64 linux in both 1.84.x and 1.85. It is trying to find non-portable symbols when linking the libraries used for PGO. The MSRV version works fine so for the time being this PR opts to use that. I'm working on bisecting the failure a bit more locally on an rpi 5 (which is quite slow for repeated compilations) but plan to report it upstream once I get a few more details.

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for all the work - this looks good to me to merge now. I'll approve, but we need to take care with the branch protection rules. We either need to:

  • temporarily disable the macOS-arm64-tests-Python-3.* requirements for branch protection until this has merged, then enable protection on the four new test names
  • immediately switch the protection rules over, hold the queue so this merges clean first, then update pending PRs so they get the new test runs

I need to leave now, so I'll leave it up to you to do whichever you want.

Comment on lines +103 to 116
if [[ `uname -m` == "aarch64" ]] ; then
INSTALL_RUST_PATH=tools/install_rust_msrv.sh
RUST_TOOLCHAIN=1.79
else
INSTALL_RUST_PATH=tools/install_rust.sh
RUST_TOOLCHAIN=stable
fi
cat >>"$GITHUB_ENV" <<EOF
CIBW_BEFORE_ALL_LINUX=yum install -y wget && {package}/$INSTALL_RUST_PATH
CIBW_BEFORE_BUILD=bash ./tools/build_pgo.sh $PGO_WORK_DIR $PGO_OUT_PATH
CIBW_ENVIRONMENT=RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
CIBW_ENVIRONMENT_MACOS=MACOSX_DEPLOYMENT_TARGET='10.12' RUSTUP_TOOLCHAIN=stable RUSTFLAGS='-Cprofile-use=$PGO_OUT_PATH -Cllvm-args=-pgo-warn-missing-function'
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"
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"
EOF
Copy link
Member

Choose a reason for hiding this comment

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

This is really nice - the logic's super clear to me now.

Comment on lines +16 to +17
name: ${{ matrix.os }}-arm64-tests-Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
Copy link
Member

Choose a reason for hiding this comment

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

We branch-protect on these names - we'll need to update them in the protection settings before this can merge.

@mtreinish mtreinish added this pull request to the merge queue Feb 24, 2025
Merged via the queue into Qiskit:main with commit ca1297e Feb 24, 2025
26 checks passed
@mtreinish mtreinish deleted the linux-arm-tier1 branch February 24, 2025 19:45
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Mar 13, 2025
This commit attempts to build the aarch64 linux wheels with rust 1.83.
When we made aarch64 linux a tier 1 supported platform Qiskit#13737 there
were packaging issues with the official distrubtions for Rust 1.85 and
1.84 on the platform which were preventing PGO builds from succeeding.
At the time we we determined that our MSRV of 1.79 was able to build
successfully. However, during the 2.0.0rc1 pre-release the wheel build
job failed because of reported LLVM bug when combining LTO and PGO which
we do for the release jobs. Local debugging determined these errors
should be been fixed if built with Rust 1.85. Since we know we're not
able to build with Rust 1.85 or 1.84 this commit tries building with
1.83 to see if this can work. If this does not work, follow up commits
will walk backwards to see if 1.82, 1.81, or 1.80 can build successfully
with LTO+PGO.

Related to: Qiskit#13983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog ci: test wheels Run the wheel-build scripts as an additional CI run for this PR type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants