From 8d6cdfe7b0505169d04eba1f98766750e3b6ca54 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Thu, 6 Nov 2025 11:59:08 +0000 Subject: [PATCH 1/3] Add an Arm job This is required to build wheels for Arm. --- .github/workflows/buildReleaseAndPublish.yml | 4 +- .../workflows/buildReleaseAndPublishArm.yml | 73 +++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/buildReleaseAndPublishArm.yml diff --git a/.github/workflows/buildReleaseAndPublish.yml b/.github/workflows/buildReleaseAndPublish.yml index e60d0a9..e664009 100644 --- a/.github/workflows/buildReleaseAndPublish.yml +++ b/.github/workflows/buildReleaseAndPublish.yml @@ -1,4 +1,4 @@ -name: Build Release and Publish +name: Build Release and Publish (X86) on: workflow_dispatch: @@ -17,7 +17,7 @@ concurrency: jobs: build_linux: name: Linux x86_64 Build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 # Elevates permissions for `GITHUB_TOKEN`'s content scope (to allow this action to make a release) permissions: contents: write diff --git a/.github/workflows/buildReleaseAndPublishArm.yml b/.github/workflows/buildReleaseAndPublishArm.yml new file mode 100644 index 0000000..c23a5a7 --- /dev/null +++ b/.github/workflows/buildReleaseAndPublishArm.yml @@ -0,0 +1,73 @@ +name: Build Release and Publish (Arm) + +on: + workflow_dispatch: + schedule: + # Runs at 11:00 AM UTC, which is 3:00 AM PST (UTC-8) + - cron: '0 11 * * *' + +# Ensure that only a single job or workflow using the same +# concurrency group will run at a time. This would cancel +# any in-progress jobs in the same github workflow and github +# ref (e.g. refs/heads/main or refs/pull//merge). +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_linux: + name: Linux Arm Build + runs-on: ubuntu-24.04-arm + # Elevates permissions for `GITHUB_TOKEN`'s content scope (to allow this action to make a release) + permissions: + contents: write + # Don't run this in everyone's forks on schedule but allow to run via dispatch. + if: ${{ github.repository_owner == 'llvm' || github.event_name != 'schedule' }} + strategy: + matrix: + package: [torch-mlir] + py_version: [cp310-cp310, cp311-cp311, cp312-cp312] + + steps: + - name: Checkout torch-mlir + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + repository: llvm/torch-mlir + ref: refs/heads/main + submodules: 'true' + + - name: Setup workspace + uses: ./.github/actions/setup-build + + - name: Build Python wheels and smoke test + run: | + cd $GITHUB_WORKSPACE + tm_package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')" + echo "tm_package_version=${tm_package_version}" >> $GITHUB_ENV + printf "TORCH_MLIR_PYTHON_PACKAGE_VERSION=%s\n" ${tm_package_version} > ./torch_mlir_package_version + TM_PYTHON_VERSIONS=${{ matrix.py_version }} TM_PACKAGES=${{ matrix.package }} ./build_tools/python_deploy/build_linux_packages.sh + + - name: Make assets available in dist + run: | + mkdir dist + cp build_tools/python_deploy/wheelhouse/torch*.whl dist/ + + - name: Upload python wheels + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + if-no-files-found: error + name: snapshot-${{ matrix.package }}-${{ matrix.py_version }}-${{ env.tm_package_version }} + path: dist + + - name: Release python wheels + uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v.1.18.0 + with: + artifacts: dist/*.whl + token: "${{ secrets.GITHUB_TOKEN }}" + tag: "dev-wheels" + name: "dev-wheels" + body: "Automatic snapshot release of torch-mlir python wheels." + removeArtifacts: false + allowUpdates: true + replacesArtifacts: true + makeLatest: true From 05174e9c831472e53eebe88b1c751d9ec68ea1f4 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 8 Nov 2025 18:13:48 +0000 Subject: [PATCH 2/3] Merge X86 and Arm workflow files, update README --- .github/workflows/buildReleaseAndPublish.yml | 8 +- .../workflows/buildReleaseAndPublishArm.yml | 73 ------------------- README.md | 7 +- 3 files changed, 10 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/buildReleaseAndPublishArm.yml diff --git a/.github/workflows/buildReleaseAndPublish.yml b/.github/workflows/buildReleaseAndPublish.yml index e664009..e0aba59 100644 --- a/.github/workflows/buildReleaseAndPublish.yml +++ b/.github/workflows/buildReleaseAndPublish.yml @@ -1,4 +1,4 @@ -name: Build Release and Publish (X86) +name: Build Release and Publish (x86_64 + AArch64) on: workflow_dispatch: @@ -16,8 +16,7 @@ concurrency: jobs: build_linux: - name: Linux x86_64 Build - runs-on: ubuntu-24.04 + name: Linux Build # Elevates permissions for `GITHUB_TOKEN`'s content scope (to allow this action to make a release) permissions: contents: write @@ -27,6 +26,9 @@ jobs: matrix: package: [torch-mlir] py_version: [cp310-cp310, cp311-cp311, cp312-cp312] + arch: [x64_64, AArch64] + + runs-on: ${{ matrix.arch == 'AArch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} steps: - name: Checkout torch-mlir diff --git a/.github/workflows/buildReleaseAndPublishArm.yml b/.github/workflows/buildReleaseAndPublishArm.yml deleted file mode 100644 index c23a5a7..0000000 --- a/.github/workflows/buildReleaseAndPublishArm.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Build Release and Publish (Arm) - -on: - workflow_dispatch: - schedule: - # Runs at 11:00 AM UTC, which is 3:00 AM PST (UTC-8) - - cron: '0 11 * * *' - -# Ensure that only a single job or workflow using the same -# concurrency group will run at a time. This would cancel -# any in-progress jobs in the same github workflow and github -# ref (e.g. refs/heads/main or refs/pull//merge). -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_linux: - name: Linux Arm Build - runs-on: ubuntu-24.04-arm - # Elevates permissions for `GITHUB_TOKEN`'s content scope (to allow this action to make a release) - permissions: - contents: write - # Don't run this in everyone's forks on schedule but allow to run via dispatch. - if: ${{ github.repository_owner == 'llvm' || github.event_name != 'schedule' }} - strategy: - matrix: - package: [torch-mlir] - py_version: [cp310-cp310, cp311-cp311, cp312-cp312] - - steps: - - name: Checkout torch-mlir - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - repository: llvm/torch-mlir - ref: refs/heads/main - submodules: 'true' - - - name: Setup workspace - uses: ./.github/actions/setup-build - - - name: Build Python wheels and smoke test - run: | - cd $GITHUB_WORKSPACE - tm_package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')" - echo "tm_package_version=${tm_package_version}" >> $GITHUB_ENV - printf "TORCH_MLIR_PYTHON_PACKAGE_VERSION=%s\n" ${tm_package_version} > ./torch_mlir_package_version - TM_PYTHON_VERSIONS=${{ matrix.py_version }} TM_PACKAGES=${{ matrix.package }} ./build_tools/python_deploy/build_linux_packages.sh - - - name: Make assets available in dist - run: | - mkdir dist - cp build_tools/python_deploy/wheelhouse/torch*.whl dist/ - - - name: Upload python wheels - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - if-no-files-found: error - name: snapshot-${{ matrix.package }}-${{ matrix.py_version }}-${{ env.tm_package_version }} - path: dist - - - name: Release python wheels - uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v.1.18.0 - with: - artifacts: dist/*.whl - token: "${{ secrets.GITHUB_TOKEN }}" - tag: "dev-wheels" - name: "dev-wheels" - body: "Automatic snapshot release of torch-mlir python wheels." - removeArtifacts: false - allowUpdates: true - replacesArtifacts: true - makeLatest: true diff --git a/README.md b/README.md index 087d81b..866e961 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Torch MLIR Build and Release Automation +[![Build Release and Publish Windows Wheels](https://github.com/llvm/torch-mlir-release/actions/workflows/buildReleaseAndPublishWindows.yml/badge.svg)](https://github.com/llvm/torch-mlir-release/actions/workflows/buildReleaseAndPublishWindows.yml) +[![Build Release and Publish Linux Wheels](https://github.com/llvm/torch-mlir-release/actions/workflows/buildReleaseAndPublish.yml/badge.svg)](https://github.com/llvm/torch-mlir-release/actions/workflows/buildReleaseAndPublish.yml) + This repository houses release automation for torch-mlir. It is isolated from the main repository so that we can more strictly control people with write access. -### Python Releases (x86 linux and windows) +### Python Releases Python wheels for torch-mlir are auto-generated every night and made available at [this release page](https://github.com/llvm/torch-mlir-release/releases/tag/dev-wheels). To install via `pip`, run: @@ -18,4 +21,4 @@ or add this to `requirements.txt`: torch-mlir ``` -At the moment only linux and windows x86_64 builds are published, but this may be updated if the need arises (and we find appropriate owners to maintain the automation). +At the moment only Linux (x86_64 + AArch64) and Windows (x86_64) builds are published. If you are interested in other configurations, please send a PR. From 17135a1a67c5871370e3584742b99af97763c88c Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Tue, 11 Nov 2025 17:41:53 +0000 Subject: [PATCH 3/3] Shorten the name --- .github/workflows/buildReleaseAndPublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildReleaseAndPublish.yml b/.github/workflows/buildReleaseAndPublish.yml index e0aba59..3392525 100644 --- a/.github/workflows/buildReleaseAndPublish.yml +++ b/.github/workflows/buildReleaseAndPublish.yml @@ -1,4 +1,4 @@ -name: Build Release and Publish (x86_64 + AArch64) +name: Build Release and Publish on: workflow_dispatch: