From 8cb5d5628bea4a64e41831fe9281cb0bda6b37df Mon Sep 17 00:00:00 2001 From: Chizkiyahu Raful Date: Thu, 4 Sep 2025 17:51:12 +0300 Subject: [PATCH 1/4] Add GitHub Actions workflow for building Aarch64 Linux wheels --- .../workflows/build-wheels-aarch64-linux.yml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build-wheels-aarch64-linux.yml diff --git a/.github/workflows/build-wheels-aarch64-linux.yml b/.github/workflows/build-wheels-aarch64-linux.yml new file mode 100644 index 00000000000..8d047d468a2 --- /dev/null +++ b/.github/workflows/build-wheels-aarch64-linux.yml @@ -0,0 +1,66 @@ +# From https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows +name: Build Aarch64 Linux Wheels + +on: + pull_request: + paths: + - .ci/**/* + - .github/workflows/build-wheels-aarch64-linux.yml + - examples/**/* + - pyproject.toml + - setup.py + tags: + - ciflow/binaries/* + push: + branches: + - nightly + - release/* + tags: + # NOTE: Binary build pipelines should only get triggered on release candidate builds + # Release candidate tags look like: v1.11.0-rc1 + - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ + - ciflow/binaries/* + workflow_dispatch: + +jobs: + generate-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: wheel + os: linux-aarch64 + test-infra-repository: pytorch/test-infra + test-infra-ref: main + with-cuda: disabled + with-rocm: disabled + python-versions: '["3.10", "3.11", "3.12"]' + + build: + needs: generate-matrix + permissions: + id-token: write + contents: read + strategy: + fail-fast: false + matrix: + include: + - repository: pytorch/executorch + pre-script: .ci/scripts/wheel/pre_build_script.sh + post-script: .ci/scripts/wheel/post_build_script.sh + smoke-test-script: .ci/scripts/wheel/test_linux.py + package-name: executorch + name: ${{ matrix.repository }} + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main + with: + repository: ${{ matrix.repository }} + ref: "" + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + submodules: recursive + env-var-script: .ci/scripts/wheel/envvar_linux.sh + pre-script: ${{ matrix.pre-script }} + post-script: ${{ matrix.post-script }} + package-name: ${{ matrix.package-name }} + smoke-test-script: ${{ matrix.smoke-test-script }} + trigger-event: ${{ github.event_name }} + architecture: aarch64 From 59f9568f3f9f2ae24eeb1ca6eb83b1c9d2b44743 Mon Sep 17 00:00:00 2001 From: Chizkiyahu Raful Date: Fri, 5 Sep 2025 12:51:11 +0300 Subject: [PATCH 2/4] add missing include in inmemory_filesystem.cpp for aarch64 build --- .../apple/coreml/runtime/inmemoryfs/inmemory_filesystem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/apple/coreml/runtime/inmemoryfs/inmemory_filesystem.cpp b/backends/apple/coreml/runtime/inmemoryfs/inmemory_filesystem.cpp index ec2f0459a47..c5671b1e6c4 100644 --- a/backends/apple/coreml/runtime/inmemoryfs/inmemory_filesystem.cpp +++ b/backends/apple/coreml/runtime/inmemoryfs/inmemory_filesystem.cpp @@ -7,9 +7,11 @@ #include "inmemory_filesystem.hpp" +#include #include #include #include +#include #include #if __has_include() From 488bdbf758695c2ca6950bbb2bc28587c0431e61 Mon Sep 17 00:00:00 2001 From: Chizkiyahu Raful Date: Mon, 8 Sep 2025 11:33:47 +0300 Subject: [PATCH 3/4] install: add libatomic installation for aarch64 support in pre_build_script.sh --- .ci/scripts/wheel/pre_build_script.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.ci/scripts/wheel/pre_build_script.sh b/.ci/scripts/wheel/pre_build_script.sh index 424529af864..e49b3f715b6 100755 --- a/.ci/scripts/wheel/pre_build_script.sh +++ b/.ci/scripts/wheel/pre_build_script.sh @@ -15,3 +15,8 @@ set -euxo pipefail # able to see the installed torch package. "${GITHUB_WORKSPACE}/${REPOSITORY}/install_requirements.sh" --example + +# On aarch64, we need to install libatomic explicitly for meta-pytorch/tokenizers to work. +if [[ "$(uname -m)" == "aarch64" ]]; then + sudo dnf install -y libatomic +fi From 12fd120b59095f5b10f0b6e7908216bb3e6a8b69 Mon Sep 17 00:00:00 2001 From: Mergen Nachin Date: Mon, 8 Sep 2025 11:53:18 -0400 Subject: [PATCH 4/4] Test with new change in tokenizers --- extension/llm/tokenizers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/llm/tokenizers b/extension/llm/tokenizers index 4ed91cc545e..4d8a9a009c8 160000 --- a/extension/llm/tokenizers +++ b/extension/llm/tokenizers @@ -1 +1 @@ -Subproject commit 4ed91cc545e9ed7098e53747656eb7eff24eb305 +Subproject commit 4d8a9a009c8a0468739da1c11a54550da5d801ff