Skip to content

Commit b2027fe

Browse files
committed
Merge commit '8107ba31e' into matthias.update_to_torch_2.6.0
2 parents ab84fc2 + 8107ba3 commit b2027fe

File tree

63 files changed

+2064
-802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2064
-802
lines changed

.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 <torch-mlir@users.noreply.github.com>
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
@@ -56,7 +56,7 @@ jobs:
5656
- name: Upload Release Assets (if requested)
5757
if: github.event.inputs.release_id != ''
5858
id: upload-release-assets
59-
uses: dwenegar/upload-release-assets@v1
59+
uses: dwenegar/upload-release-assets@v3
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
with:
@@ -83,7 +83,7 @@ jobs:
8383
#
8484
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
8585
- name: Store the binary wheel
86-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
86+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
8787
with:
8888
name: wheels
8989
path: dist
@@ -125,7 +125,7 @@ jobs:
125125
- name: Upload Release Assets (if requested)
126126
if: github.event.inputs.release_id != ''
127127
id: upload-release-assets
128-
uses: dwenegar/upload-release-assets@v1
128+
uses: dwenegar/upload-release-assets@v3
129129
env:
130130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131131
with:
@@ -152,7 +152,7 @@ jobs:
152152
#
153153
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
154154
- name: Store the binary wheel
155-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
155+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
156156
with:
157157
name: wheels
158158
path: dist
@@ -186,7 +186,7 @@ jobs:
186186
- name: Upload Release Assets (if requested)
187187
if: github.event.inputs.release_id != ''
188188
id: upload-release-assets
189-
uses: dwenegar/upload-release-assets@v1
189+
uses: dwenegar/upload-release-assets@v3
190190
env:
191191
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192192
with:
@@ -213,7 +213,7 @@ jobs:
213213
#
214214
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
215215
- name: Store the binary wheel
216-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
216+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
217217
with:
218218
name: wheels
219219
path: dist
@@ -250,7 +250,7 @@ jobs:
250250
- name: Upload Release Assets (if requested)
251251
if: github.event.inputs.release_id != ''
252252
id: upload-release-assets
253-
uses: dwenegar/upload-release-assets@v1
253+
uses: dwenegar/upload-release-assets@v3
254254
env:
255255
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
256256
with:
@@ -278,7 +278,7 @@ jobs:
278278
#
279279
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
280280
- name: Store the binary wheel
281-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
281+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
282282
with:
283283
name: wheels
284284
path: dist

.github/workflows/ci.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,8 @@ jobs:
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

@@ -48,25 +38,39 @@ jobs:
4838
sudo apt-get install -y ccache clang
4939
5040
- name: Enable cache
51-
uses: actions/cache/restore@v3
41+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5242
with:
5343
path: ${{ env.CACHE_DIR }}
5444
key: build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2-${{ github.sha }}
5545
restore-keys: |
5646
build-test-cpp-asserts-manylinux-${{ matrix.torch-version }}-v2-
5747
48+
- name: "Setting up Python"
49+
run: |
50+
sudo apt update
51+
sudo apt install software-properties-common -y
52+
sudo add-apt-repository ppa:deadsnakes/ppa -y
53+
sudo apt install python3.11 python3-pip -y
54+
sudo apt-get install python3.11-dev python3.11-venv build-essential -y
55+
5856
- name: Install python deps (torch-${{ matrix.torch-version }})
5957
run: |
6058
export cache_dir="${{ env.CACHE_DIR }}"
6159
bash build_tools/ci/install_python_deps.sh ${{ matrix.torch-version }}
6260
61+
- name: ccache
62+
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16
63+
with:
64+
key: ${{ github.job }}-${{ matrix.torch-version }}
65+
save: ${{ needs.setup.outputs.write-caches == 1 }}
66+
6367
- name: Build project
6468
run: |
6569
export cache_dir="${{ env.CACHE_DIR }}"
6670
bash build_tools/ci/build_posix.sh
6771
6872
- name: Save cache
69-
uses: actions/cache/save@v3
73+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
7074
if: ${{ !cancelled() }}
7175
with:
7276
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
@@ -36,15 +36,15 @@ jobs:
3636
git tag "${tag_name}"
3737
3838
- name: Pushing changes
39-
uses: ad-m/github-push-action@v0.6.0
39+
uses: ad-m/github-push-action@v0.8.0
4040
with:
4141
github_token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
4242
branch: ${{ github.ref_name }}
4343
tags: true
4444

4545
- name: Create Release
4646
id: create_release
47-
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
47+
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
4848
with:
4949
tag: ${{ env.tag_name }}
5050
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
@@ -41,15 +41,15 @@ jobs:
4141
git tag "${tag_name}"
4242
4343
- name: Pushing changes
44-
uses: ad-m/github-push-action@v0.6.0
44+
uses: ad-m/github-push-action@v0.8.0
4545
with:
4646
github_token: ${{ secrets.GITHUB_TOKEN }}
4747
branch: ${{ env.BRANCH_NAME }}
4848
tags: true
4949

5050
- name: Create Release
5151
id: create_release
52-
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
52+
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
5353
with:
5454
tag: ${{ env.tag_name }}
5555
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" \

build_tools/ci/install_python_deps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repo_root="$(cd $this_dir/../.. && pwd)"
77
torch_version="${1:-unknown}"
88

99
echo "::group::installing llvm python deps"
10-
python -m pip install --no-cache-dir -r $repo_root/externals/llvm-project/mlir/python/requirements.txt
10+
python3 -m pip install --no-cache-dir -r $repo_root/externals/llvm-project/mlir/python/requirements.txt
1111
echo "::endgroup::"
1212

1313
case $torch_version in
@@ -30,5 +30,5 @@ case $torch_version in
3030
esac
3131

3232
echo "::group::installing test requirements"
33-
python -m pip install --no-cache-dir -r $repo_root/test-requirements.txt
33+
python3 -m pip install --no-cache-dir -r $repo_root/test-requirements.txt
3434
echo "::endgroup::"

0 commit comments

Comments
 (0)