-
Notifications
You must be signed in to change notification settings - Fork 505
85 lines (74 loc) · 2.77 KB
/
buildAndTestTcp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Build and Test (TCP)
on:
pull_request:
branches: [ mlir-tcp ]
push:
branches: [ mlir-tcp ]
workflow_dispatch:
# 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/<pr_number>/merge).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Provisioned Jobs:
# ubuntu/docker - x86_64 - llvm in-tree - pytorch binary - build+test # most used dev flow and fastest signal
jobs:
build-test:
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]
torch-version: [nightly, stable]
exclude:
# Exclude pytorch source
- torch-binary: OFF
# Exclude llvm out-of-tree
- llvm-build: out-of-tree
# Exclude macos-arm64
- os-arch: macos-arm64
# Exclude windows-x86_64
- os-arch: windows-x86_64
include:
# Specify OS versions
- os-arch: ubuntu-x86_64
os: a100
runs-on: ${{ matrix.os }}
steps:
- name: Prepare workspace
if: ${{ matrix.os-arch == 'ubuntu-x86_64' }}
run: |
# Clear the workspace directory so that we don't run into errors about
# existing lock files.
sudo rm -rf $GITHUB_WORKSPACE/*
- name: Checkout torch-mlir
uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: 0
- name: Fetch PyTorch commit hash
if: ${{ matrix.os-arch != 'windows-x86_64' }}
run: |
PT_HASH="$(cat ${GITHUB_WORKSPACE}/pytorch-hash.txt)"
echo "PT_HASH=${PT_HASH}" >> ${GITHUB_ENV}
- name: Setup ccache
uses: ./.github/actions/setup-build
with:
cache-suffix: 'build-${{ matrix.llvm-build }}-${{ matrix.torch-version }}'
torch-version: ${{ matrix.torch-version }}
- name: Build and Test os-arch='ubuntu-x86_64' llvm-build='${{ matrix.llvm-build }}' torch-binary='${{ matrix.torch-binary }}'
if: ${{ matrix.os-arch == 'ubuntu-x86_64' }}
run: |
cd $GITHUB_WORKSPACE
TORCH_MLIR_SRC_PYTORCH_BRANCH="$(cat pytorch-hash.txt)" \
TM_PACKAGES="${{ matrix.llvm-build }}" \
TM_USE_PYTORCH_BINARY="${{ matrix.torch-binary }}" \
TM_PYTORCH_INSTALL_WITHOUT_REBUILD="${{ steps.cache-pytorch.outputs.cache-hit }}" \
TM_TORCH_VERSION="${{ matrix.torch-version }}" \
./build_tools/python_deploy/build_linux_packages.sh
- name: Print ccache configuration and statistics
shell: bash
run: ccache --show-config --show-stats --print-stats