Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1fbf17d
feat: split pytorch requirements into stable and nightly
Apr 12, 2023
6101852
fix: add true to tests to see full output
Apr 17, 2023
5567c2c
Merge branch 'main' into add_stable_pytorch_tests
Apr 17, 2023
fbc8496
refactor: add comments to explain true statement
Apr 17, 2023
47c8e29
Merge remote-tracking branch 'origin/main' into add_stable_pytorch_tests
May 8, 2023
c93354a
feat: move some tests to experimental mode
May 8, 2023
e6906d2
Merge remote-tracking branch 'origin/main' into add_stable_pytorch_tests
May 8, 2023
8597919
lib/Conversion/TorchToTosa/TosaLegalizeUtils.cpp: bf16 casts
mgehre-amd May 11, 2023
05efc84
[TOSA] Add torch.prim.NumToTensor.Scalar float support (#1802)
Apr 18, 2023
00cba87
Fixes for bf16
mgehre-amd May 11, 2023
d091717
Add support for aten.split.Tensor followed by prim.ListUnpack
mgehre-amd May 5, 2023
b66ab03
[tosa] support lowering basic torch binary ops with mixed dtypes
tatwaichong May 16, 2023
d6f1d9b
Merge remote-tracking branch 'xlnx/matthias.bf16_tosa' into mixed_types
mgehre-amd May 16, 2023
c9b7bb2
.gitmodules: Move llvm-project to xilinx/llvm-project
mgehre-amd May 16, 2023
6f4d02b
externals/llvm-project: Fix mul fold
mgehre-amd May 16, 2023
47a9745
Update workflow
mgehre-amd May 16, 2023
ca73133
gitmodules: use https
mgehre-amd May 16, 2023
4fa4154
Revert llvm-project changes
mgehre-amd May 16, 2023
5812370
refactor: refactor pipeline into more fine grained difference
May 16, 2023
f3aa805
Merge remote-tracking branch 'origin/main' into add_stable_pytorch_tests
May 16, 2023
80a0a59
Remove a100
mgehre-amd May 16, 2023
28206ad
Don't run macos/windows
mgehre-amd May 16, 2023
1d6ef09
fix
mgehre-amd May 16, 2023
7eaf5dc
fix token?
mgehre-amd May 16, 2023
e35c96e
Revert "Revert llvm-project changes"
mgehre-amd May 16, 2023
70c8839
Workflow update
mgehre-amd May 17, 2023
ff24581
Elevate permissions
mgehre-amd May 17, 2023
9919d2c
Fix test failure
mgehre-amd May 17, 2023
0f054b5
Push to current branch name
mgehre-amd May 17, 2023
ed394fb
More permissions
mgehre-amd May 17, 2023
aaef91b
Merge remote-tracking branch 'upstream/main' into misc_fixes
mgehre-amd May 17, 2023
3c63f53
More bf16 fixes
mgehre-amd May 17, 2023
3f01668
Add torch_mlir.do function
mgehre-amd May 17, 2023
31085ad
.github: Fix release flow
mgehre-amd May 17, 2023
ec44d15
python/torch_mlir/__init__.py: Fix wrapper for single tuple return
mgehre-amd May 17, 2023
30eb097
Tooling to build wheels
mgehre-amd May 17, 2023
70ef112
bf16: fix tests
mgehre-amd May 17, 2023
5ffa57d
build fixes
mgehre-amd May 17, 2023
1ea3632
Fix workflow
May 16, 2023
cd7bc7c
fix wrapper
mgehre-amd May 17, 2023
0364ee4
Add all legal checks from tosa spec to the check of to.dtype operator
May 17, 2023
3f621e7
Merge remote-tracking branch 'xlnx/misc_fixes' into ferdinand.fix_to_…
mgehre-amd May 19, 2023
6e279d2
Update tests
mgehre-amd May 19, 2023
4e40ff1
Merge remote-tracking branch 'upstream/main' into mgehre.bump_torch
mgehre-amd May 19, 2023
c2f166d
.github/workflows/buildAndTest.yml: Also build PRs to branch misc_fixes
mgehre-amd May 19, 2023
e2b9716
Merge pull request #10 from Xilinx/ferdinand.fix_to_dtype_illegal_casts
mgehre-amd May 19, 2023
bd87b53
Make sure that we have ccache entries for misc_fixes
mgehre-amd May 19, 2023
d69263d
Merge pull request #12 from Xilinx/mgehre.ci_for_misc_fixes
mgehre-amd May 19, 2023
328231f
Merge remote-tracking branch 'origin/misc_fixes' into mgehre.bump_torch
mgehre-amd May 19, 2023
010e594
Remove deep_copy
mgehre-amd May 19, 2023
a05004f
Print version
mgehre-amd May 19, 2023
23ff2a3
Merge branch 'add_stable_pytorch_tests' into mgehre.stable_torch
mgehre-amd May 19, 2023
960492c
Build wheels from stable torch
mgehre-amd May 19, 2023
a1abb1c
Merge pull request #11 from Xilinx/mgehre.bump_torch
mgehre-amd May 19, 2023
c536652
SliceCopyMax_Module: Fix crash in attached test case
mgehre-amd May 19, 2023
e36e3eb
Merge pull request #16 from Xilinx/mgehre.version
mgehre-amd May 19, 2023
7fdb269
Merge pull request #13 from Xilinx/mgehre.negative_idx
mgehre-amd May 19, 2023
b4ad592
Merge pull request #15 from Xilinx/mgehre.remove_deepcopy
mgehre-amd May 19, 2023
6efa91b
Exclude some tests for stable versions
mgehre-amd May 19, 2023
915398b
Merge pull request #14 from Xilinx/mgehre.stable_torch
mgehre-amd May 21, 2023
ebf7534
Support aten.pow.scalar
mgehre-amd May 22, 2023
cd3713c
Don't crash when the input to aten.copy is unranked
mgehre-amd May 22, 2023
5e066c1
Add torch-to-tosa legalization for torch.aten.sqrt
ttjost May 19, 2023
d0fec7c
Support aten.sign
mgehre-amd May 22, 2023
c12f76a
Merge pull request #18 from Xilinx/tiagot.legalize_sqrt_to_tosa
mgehre-amd May 22, 2023
f450421
TorchToTosa: Support more cast from f64
mgehre-amd May 22, 2023
6bf21cc
Merge branch 'matthias.aten_split' into mgehre.split_tensor
mgehre-amd May 22, 2023
d996586
e2e_testing/xfail_sets.py: TOSA: Add a tests that pass now
mgehre-amd May 22, 2023
6676e7c
Mark ElementwiseGe as PASS for tosa
mgehre-amd May 22, 2023
e91e2a8
Print name of the backend when tests fail to help debugging issues in CI
mgehre-amd May 22, 2023
b2db85c
Merge pull request #23 from Xilinx/mgehre.help_e2e_reporting
mgehre-amd May 22, 2023
c2fb24e
Use dyn_cast
mgehre-amd May 22, 2023
3984b96
Merge pull request #17 from Xilinx/mgehre.aten.power.scalar
mgehre-amd May 22, 2023
5c401ba
split.tensor: Ignore in LTC backend
mgehre-amd May 22, 2023
2b728ec
Merge pull request #19 from Xilinx/mgehre.fix_crash_decompose_copy_un…
mgehre-amd May 22, 2023
e981d0f
Merge remote-tracking branch 'origin/misc_fixes' into matthias.suppor…
mgehre-amd May 22, 2023
064d817
Merge pull request #20 from Xilinx/matthias.support_aten.sign
mgehre-amd May 22, 2023
116eb05
Mark split as XFAIL for LTC
mgehre-amd May 22, 2023
a2f46e5
Merge pull request #22 from Xilinx/mgehre.split_tensor
mgehre-amd May 22, 2023
331ef78
Add f64 -> f16
mgehre-amd May 22, 2023
feba6b1
Merge pull request #21 from Xilinx/mgehre.f64_todtype
mgehre-amd May 22, 2023
5cec79a
Merge remote-tracking branch 'origin/misc_fixes' into mgehre.f64_todtype
mgehre-amd May 22, 2023
5fd8c58
Fix test failures
mgehre-amd May 22, 2023
d5f7b92
Merge branch 'feature/misc_fixes' into mgehre.f64_todtype
mgehre-amd May 23, 2023
a89d371
Update CI
mgehre-amd May 23, 2023
89b42c5
Merge pull request #21 from Xilinx/mgehre.f64_todtype
mgehre-amd May 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ inputs:
but the content is irrelevant.
required: false
default: ''
torch-version:
description: |
Additional string to determine wether to test against a stable
torch release or against the nightly build
required: true
default: 'nightly'

runs:
using: "composite"
Expand All @@ -26,13 +32,15 @@ runs:

- name: Install PyTorch nightly depends
run: |
python -m pip install -r pytorch-requirements.txt
python -m pip install -r pytorch-${{ inputs.torch-version }}-requirements.txt
python -m pip install -r build-requirements.txt
shell: bash

- name: Install prerequisites (Linux)
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get install --yes ccache ninja-build
run: |
sudo apt-get update
sudo apt-get install --yes ccache ninja-build
shell: bash

- name: Install prerequisites (macOS)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/RollPyTorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
# Read the version from the downloaded whl file without extracting it
PT_RELEASE=$(unzip -p torch-*.whl 'torch-*/METADATA' | grep "^Version:" | awk '{ print $2 }' | sed 's/\([^+]*\).*/\1/')
echo "Found torch release ${PT_RELEASE}"
printf -- "-f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html\n--pre\ntorch==%s\n" "${PT_RELEASE}" > pytorch-requirements.txt
printf -- "-f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html\n--pre\ntorchvision==%s\n" "${VISION_RELEASE}" > torchvision-requirements.txt
printf -- "-f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html\n--pre\ntorch==%s\n" "${PT_RELEASE}" > pytorch-nightly-requirements.txt
printf -- "-f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html\n--pre\ntorchvision==%s\n" "${VISION_RELEASE}" > torchvision-nightly-requirements.txt

# Read the commit hash from the downloaded whl file without extracting it
PT_HASH=$(unzip -p torch-"${PT_RELEASE}"*.whl torch/version.py | grep git_version | awk '{ print $3 }' | tr -d "'")
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and Test

on:
pull_request:
branches: [ main ]
branches: [ feature/misc_fixes ]
push:
branches: [ main ]
branches: [ feature/misc_fixes ]
workflow_dispatch:

# Ensure that only a single job or workflow using the same
Expand All @@ -25,9 +25,10 @@ jobs:
strategy:
fail-fast: true
matrix:
os-arch: [ubuntu-x86_64, macos-arm64, windows-x86_64]
llvm-build: [in-tree, out-of-tree]
torch-binary: [ON, OFF]
os-arch: [ubuntu-x86_64]
llvm-build: [in-tree]
torch-binary: [ON]
torch-version: [nightly, stable]
exclude:
# Exclude llvm in-tree and pytorch source
- llvm-build: in-tree
Expand All @@ -38,17 +39,11 @@ jobs:
# Exclude macos-arm64 and llvm out-of-tree altogether
- os-arch: macos-arm64
llvm-build: out-of-tree
- os-arch: windows-x86_64
llvm-build: out-of-tree
include:
# Specify OS versions
- os-arch: ubuntu-x86_64
os: a100
- os-arch: macos-arm64
os: macos-latest
torch-version: stable
- os-arch: windows-x86_64
os: windows-latest
runs-on: ${{ matrix.os }}
llvm-build: out-of-tree
runs-on: ubuntu-latest

steps:

Expand All @@ -75,6 +70,7 @@ jobs:
uses: ./.github/actions/setup-build
with:
cache-suffix: 'build-${{ matrix.llvm-build }}'
torch-version: ${{ matrix.torch-version }}

- name: Set up Visual Studio shell
if: ${{ matrix.os-arch == 'windows-x86_64' }}
Expand All @@ -98,6 +94,7 @@ jobs:
TM_PACKAGES="${{ matrix.llvm-build }}" \
TM_USE_PYTORCH_BINARY="${{ matrix.torch-binary }}" \
TM_PYTORCH_INSTALL_WITHOUT_REBUILD="${{ steps.cache-pytorch.outputs.cache-hit }}" \
TORCH_VERSION="${{ matrix.torch-version }}" \
./build_tools/python_deploy/build_linux_packages.sh

- name: Configure os-arch='macos-arm64' llvm-build='in-tree' torch-binary='${{ matrix.torch-binary }}'
Expand Down
159 changes: 20 additions & 139 deletions .github/workflows/buildRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ on:
jobs:
build_linux:
name: Manylinux Build
runs-on: a100
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
packages: write
strategy:
matrix:
package: [ torch-mlir, torch-mlir-core ]
py_version: [ cp38-cp38, cp310-cp310, cp311-cp311 ]
package: [ torch-mlir ]
py_version: [ cp38-cp38 ]
torch-version: [stable] # nightly
exclude:
- package: torch-mlir-core
py_version: cp38-cp38
Expand Down Expand Up @@ -47,7 +52,11 @@ jobs:
python -m pip install wheel
TM_PACKAGE_VERSION=${{ github.event.inputs.python_package_version }}
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
TM_SKIP_TESTS=ON \
TM_PYTHON_VERSIONS=${{ matrix.py_version }} \
TM_PACKAGES=${{ matrix.package }} \
TORCH_VERSION="${{ matrix.torch-version }}" \
./build_tools/python_deploy/build_linux_packages.sh

# If we were given a release_id, then upload the package we just built
# to the github releases page.
Expand All @@ -56,67 +65,7 @@ jobs:
id: upload-release-assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
assets_path: ./build_tools/python_deploy/wheelhouse/torch*.whl
# Publishing is necessary to make the release visible to `pip`
# on the github releases page.
- name: Publish Release (if requested)
if: github.event.inputs.release_id != ''
id: publish_release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
- name: Create dist directory
if: github.event.inputs.release_id != ''
run: mkdir dist
- name: Copy releases to publish to dist directory
if: github.event.inputs.release_id != ''
run: cp build_tools/python_deploy/wheelhouse/torch_mlir*.whl dist/

# Wheels must be published from a linux environment.
#
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
- name: Store the binary wheel
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

build_macos:
name: MacOS Build
runs-on: macos-latest
strategy:
matrix:
package: [ torch-mlir, torch-mlir-core ]
steps:
- name: Get torch-mlir
uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/setup-build
with:
cache-suffix: 'release'
- name: Build Python wheels and smoke test.
run: |
cd $GITHUB_WORKSPACE
python -m pip install wheel
TM_PACKAGE_VERSION=${{ github.event.inputs.python_package_version }}
printf "TORCH_MLIR_PYTHON_PACKAGE_VERSION=%s\n" $TM_PACKAGE_VERSION > ./torch_mlir_package_version
sudo ./build_tools/python_deploy/install_macos_deps.sh
packages=${{ matrix.package }} TORCH_MLIR_PYTHON_VERSIONS="3.11" ./build_tools/python_deploy/build_macos_packages.sh

# If we were given a release_id, then upload the package we just built
# to the github releases page.
- name: Upload Release Assets (if requested)
if: github.event.inputs.release_id != ''
id: upload-release-assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
assets_path: ./build_tools/python_deploy/wheelhouse/torch*.whl
Expand All @@ -127,7 +76,7 @@ jobs:
id: publish_release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
- name: Create dist directory
Expand All @@ -146,82 +95,14 @@ jobs:
name: wheels
path: dist

build_windows:
name: Windows Build
runs-on: windows-latest
strategy:
matrix:
package: [ torch-mlir, torch-mlir-core ]
steps:
- name: Get torch-mlir
uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/setup-build
with:
cache-suffix: 'release'
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Build Python wheels and smoke test.
shell: pwsh
run: |
if ( "${{ matrix.package }}" -eq "torch-mlir-core" )
{
$env:TORCH_MLIR_ENABLE_JIT_IR_IMPORTER='0'
$env:TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS='1'
} else {
$env:TORCH_MLIR_ENABLE_JIT_IR_IMPORTER='1'
$env:TORCH_MLIR_ENABLE_ONLY_MLIR_PYTHON_BINDINGS='0'
}
$env:TORCH_MLIR_PYTHON_PACKAGE_VERSION = '${{ github.event.inputs.python_package_version }}'
./build_tools/python_deploy/build_windows.ps1

# If we were given a release_id, then upload the package we just built
# to the github releases page.
- name: Upload Release Assets (if requested)
if: github.event.inputs.release_id != ''
id: upload-release-assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
assets_path: ./wheelhouse/torch*.whl
# Publishing is necessary to make the release visible to `pip`
# on the github releases page.
- name: Publish Release (if requested)
if: github.event.inputs.release_id != ''
id: publish_release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
- name: Create dist directory
if: github.event.inputs.release_id != ''
run: mkdir dist
continue-on-error: true
- name: Copy releases to publish to dist directory
if: github.event.inputs.release_id != ''
run: cp ./wheelhouse/torch_mlir*.whl dist/

# Wheels must be published from a linux environment.
#
# See https://github.com/pypa/gh-action-pypi-publish/discussions/15
- name: Store the binary wheel
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

publish_releases:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
packages: write
needs:
- build_linux
- build_macos
- build_windows

# Publish even if one of the builds failed
if: ${{ always() }}
Expand All @@ -231,7 +112,7 @@ jobs:
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Publish releases page
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

# Wheels must be published from a linux environment.
#
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ jobs:
scrape_and_publish_releases:
name: "Scrape and publish releases"
runs-on: ubuntu-latest
permissions:
contents: write

# Don't run this in everyone's forks.
if: github.repository == 'llvm/torch-mlir'
if: github.repository == 'xilinx/torch-mlir'

steps:
- name: Prepare workspace
Expand All @@ -20,10 +22,8 @@ jobs:
sudo rm -rf $GITHUB_WORKSPACE/*
- name: Checking out repository
uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
- name: Run scrape releases script
run: python ./build_tools/scrape_releases.py llvm torch-mlir > /tmp/index.html
run: python ./build_tools/scrape_releases.py xilinx torch-mlir > /tmp/index.html
shell: bash
- run: git fetch --all
- run: git switch github-pages
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/oneshotSnapshotPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ jobs:
name: "Tag snapshot release"
runs-on: ubuntu-latest
# Don't run this in everyone's forks.
if: github.repository == 'llvm/torch-mlir'
#if: github.repository == 'llvm/torch-mlir'
steps:
- name: Prepare workspace
run: |
# Clear the workspace directory so that we don't run into errors about
# existing lock files.
sudo rm -rf $GITHUB_WORKSPACE/*

- name: Checking out repository
- name: Checkout torch-mlir
uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
submodules: 'true'
fetch-depth: 0

- name: Compute version
run: |
Expand Down
Loading