Skip to content

Commit a6ae057

Browse files
committed
Merge branch 'main' of https://github.com/iree-org/torch-mlir into integrate/20250117
2 parents 2debe15 + f42c7e4 commit a6ae057

File tree

40 files changed

+359
-277
lines changed

40 files changed

+359
-277
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"

.github/workflows/RollPyTorch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
git pull origin main
128128
129129
- name: Create pull request
130-
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
130+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
131131
with:
132132
author: Roll PyTorch Action <[email protected]>
133133
branch: rollpytorch

.github/workflows/bazelBuildAndTest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
103103
- name: Send mail
104104
if: failure()
105-
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
105+
uses: dawidd6/action-send-mail@611879133a9569642c41be66f4a323286e9b8a3b # v4
106106
with:
107107
server_address: ${{ secrets.SMTP_SERVER }}
108108
server_port: ${{ secrets.SMTP_PORT }}

.github/workflows/buildRelease.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Upload Release Assets (if requested)
4949
if: github.event.inputs.release_id != ''
5050
id: upload-release-assets
51-
uses: dwenegar/upload-release-assets@v1
51+
uses: dwenegar/upload-release-assets@v3
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
5454
with:
@@ -75,7 +75,7 @@ jobs:
7575
#
7676
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
7777
- name: Store the binary wheel
78-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
78+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
7979
with:
8080
name: wheels
8181
path: dist
@@ -116,7 +116,7 @@ jobs:
116116
- name: Upload Release Assets (if requested)
117117
if: github.event.inputs.release_id != ''
118118
id: upload-release-assets
119-
uses: dwenegar/upload-release-assets@v1
119+
uses: dwenegar/upload-release-assets@v3
120120
env:
121121
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
122122
with:
@@ -143,7 +143,7 @@ jobs:
143143
#
144144
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
145145
- name: Store the binary wheel
146-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
146+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
147147
with:
148148
name: wheels
149149
path: dist
@@ -176,7 +176,7 @@ jobs:
176176
- name: Upload Release Assets (if requested)
177177
if: github.event.inputs.release_id != ''
178178
id: upload-release-assets
179-
uses: dwenegar/upload-release-assets@v1
179+
uses: dwenegar/upload-release-assets@v3
180180
env:
181181
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
182182
with:
@@ -203,7 +203,7 @@ jobs:
203203
#
204204
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
205205
- name: Store the binary wheel
206-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
206+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
207207
with:
208208
name: wheels
209209
path: dist
@@ -239,7 +239,7 @@ jobs:
239239
- name: Upload Release Assets (if requested)
240240
if: github.event.inputs.release_id != ''
241241
id: upload-release-assets
242-
uses: dwenegar/upload-release-assets@v1
242+
uses: dwenegar/upload-release-assets@v3
243243
env:
244244
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
245245
with:
@@ -267,7 +267,7 @@ jobs:
267267
#
268268
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
269269
- name: Store the binary wheel
270-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
270+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
271271
with:
272272
name: wheels
273273
path: dist

.github/workflows/ci.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,49 @@ jobs:
2323
matrix:
2424
torch-version: [nightly, stable]
2525
name: Build and Test (Linux, torch-${{ matrix.torch-version }}, assertions)
26-
runs-on: torch-mlir-cpubuilder-manylinux-x86-64
26+
runs-on: torch-mlir-cpubuilder-linux-x86-64-scale
2727
env:
2828
CACHE_DIR: ${{ github.workspace }}/.container-cache
2929
steps:
30-
- name: Configure local git mirrors
31-
run: |
32-
# Our stock runners have access to certain local git caches. If these
33-
# files are available, it will prime the cache and configure git to
34-
# use them. Practically, this eliminates network/latency for cloning
35-
# llvm.
36-
if [[ -x /gitmirror/scripts/trigger_update_mirrors.sh ]]; then
37-
/gitmirror/scripts/trigger_update_mirrors.sh
38-
/gitmirror/scripts/git_config.sh
39-
fi
4030
- name: "Checking out repository"
41-
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4232
with:
4333
submodules: true
4434

4535
- name: Enable cache
46-
uses: actions/cache/restore@v3
36+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
4737
with:
4838
path: ${{ env.CACHE_DIR }}
4939
key: build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2-${{ github.sha }}
5040
restore-keys: |
5141
build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2-
5242
43+
- name: "Setting up Python"
44+
run: |
45+
sudo apt update
46+
sudo apt install software-properties-common -y
47+
sudo add-apt-repository ppa:deadsnakes/ppa -y
48+
sudo apt install python3.11 python3-pip -y
49+
sudo apt-get install python3.11-dev python3.11-venv build-essential -y
50+
5351
- name: Install python deps (torch-${{ matrix.torch-version }})
5452
run: |
5553
export cache_dir="${{ env.CACHE_DIR }}"
5654
bash build_tools/ci/install_python_deps.sh ${{ matrix.torch-version }}
5755
56+
- name: ccache
57+
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16
58+
with:
59+
key: ${{ github.job }}-${{ matrix.torch-version }}
60+
save: ${{ needs.setup.outputs.write-caches == 1 }}
61+
5862
- name: Build project
5963
run: |
6064
export cache_dir="${{ env.CACHE_DIR }}"
6165
bash build_tools/ci/build_posix.sh
6266
6367
- name: Save cache
64-
uses: actions/cache/save@v3
68+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6569
if: ${{ !cancelled() }}
6670
with:
6771
path: ${{ env.CACHE_DIR }}

.github/workflows/gh-pages-releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- run: git diff --cached --exit-code || git commit -m "Update releases."
3838

3939
- name: GitHub Push
40-
uses: ad-m/github-push-action@v0.6.0
40+
uses: ad-m/github-push-action@v0.8.0
4141
with:
4242
github_token: ${{ secrets.GITHUB_TOKEN }}
4343
branch: github-pages

.github/workflows/oneshotSnapshotPackage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ jobs:
3535
git tag "${tag_name}"
3636
3737
- name: Pushing changes
38-
uses: ad-m/github-push-action@v0.6.0
38+
uses: ad-m/github-push-action@v0.8.0
3939
with:
4040
github_token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
4141
branch: ${{ github.ref_name }}
4242
tags: true
4343

4444
- name: Create Release
4545
id: create_release
46-
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
46+
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
4747
with:
4848
tag: ${{ env.tag_name }}
4949
name: torch-mlir snapshot ${{ env.tag_name }}

.github/workflows/releaseSnapshotPackage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
git tag "${tag_name}"
3939
4040
- name: Pushing changes
41-
uses: ad-m/github-push-action@v0.6.0
41+
uses: ad-m/github-push-action@v0.8.0
4242
with:
4343
github_token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
4444
branch: main
4545
tags: true
4646

4747
- name: Create Release
4848
id: create_release
49-
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
49+
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
5050
with:
5151
tag: ${{ env.tag_name }}
5252
name: torch-mlir snapshot ${{ env.tag_name }}

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ option(TORCH_MLIR_ENABLE_STABLEHLO "Add stablehlo dialect" ON)
4343
if(TORCH_MLIR_ENABLE_STABLEHLO)
4444
add_definitions(-DTORCH_MLIR_ENABLE_STABLEHLO)
4545
endif()
46+
# It is possible that both stablehlo and torch_mlir projects are used in some compiler project.
47+
# In this case, we don't want to use stablehlo that is downloaded by torch_mlir (in external/stablehlo)
48+
# folder but instead want to use stablehlo that is part of top level compiler project.
49+
# With TORCH_MLIR_USE_EXTERNAL_STABLEHLO enables, it is assumed that top level compiler project makes
50+
# stablehlo targets AND includes available (for example with `add_subdirectory` and `include_directories`).
51+
option(TORCH_MLIR_USE_EXTERNAL_STABLEHLO "Use stablehlo from top level project" OFF)
4652

4753
option(TORCH_MLIR_OUT_OF_TREE_BUILD "Specifies an out of tree build" OFF)
4854

@@ -142,7 +148,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
142148

143149
function(torch_mlir_target_includes target)
144150
set(_dirs
145-
$<BUILD_INTERFACE:${MLIR_INCLUDE_DIRS}>
151+
$<BUILD_INTERFACE:${MLIR_INCLUDE_DIR}>
152+
$<BUILD_INTERFACE:${MLIR_GENERATED_INCLUDE_DIR}>
146153
$<BUILD_INTERFACE:${TORCH_MLIR_SOURCE_DIR}/include>
147154
$<BUILD_INTERFACE:${TORCH_MLIR_BINARY_DIR}/include>
148155
)
@@ -232,7 +239,8 @@ endif()
232239
# Getting this wrong results in building large parts of the stablehlo
233240
# project that we don't actually depend on. Further some of those parts
234241
# do not even compile on all platforms.
235-
if (TORCH_MLIR_ENABLE_STABLEHLO)
242+
# Only configure StableHLO if it isn't provided from a top-level project
243+
if (TORCH_MLIR_ENABLE_STABLEHLO AND NOT TORCH_MLIR_USE_EXTERNAL_STABLEHLO)
236244
set(STABLEHLO_BUILD_EMBEDDED ON)
237245
set(STABLEHLO_ENABLE_BINDINGS_PYTHON ON)
238246
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/externals/stablehlo

build_tools/ci/build_posix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ echo "Caching to ${cache_dir}"
2020
mkdir -p "${cache_dir}/ccache"
2121
mkdir -p "${cache_dir}/pip"
2222

23-
python="$(which python)"
23+
python="$(which python3)"
2424
echo "Using python: $python"
2525

2626
export CMAKE_TOOLCHAIN_FILE="$this_dir/linux_default_toolchain.cmake"
@@ -40,7 +40,7 @@ echo "::group::CMake configure"
4040
cmake -S "$repo_root/externals/llvm-project/llvm" -B "$build_dir" \
4141
-GNinja \
4242
-DCMAKE_BUILD_TYPE=Release \
43-
-DPython3_EXECUTABLE="$(which python)" \
43+
-DPython3_EXECUTABLE="$(which python3)" \
4444
-DLLVM_ENABLE_ASSERTIONS=ON \
4545
-DTORCH_MLIR_ENABLE_WERROR_FLAG=ON \
4646
-DCMAKE_INSTALL_PREFIX="$install_dir" \

0 commit comments

Comments
 (0)