Skip to content

Commit 6f85281

Browse files
authored
Move CIs to use docker builds
Now that #1234 has landed and anyone can run CI / Release builds locally move GHA to use the same flow.
1 parent 9f061ea commit 6f85281

File tree

1 file changed

+3
-108
lines changed

1 file changed

+3
-108
lines changed

.github/workflows/buildAndTest.yml

Lines changed: 3 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -58,59 +58,10 @@ jobs:
5858
cache-suffix: ${{ matrix.os-arch }}-${{ matrix.llvm-build }}-${{ matrix.torch-binary }}
5959

6060
- name: Configure os-arch='ubuntu-x86_64' llvm-build='in-tree' torch-binary='${{ matrix.torch-binary }}'
61-
# Fastest build, most used dev flow
62-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
63-
run: |
64-
cmake -GNinja -Bbuild \
65-
-DCMAKE_BUILD_TYPE=Release \
66-
-DCMAKE_C_COMPILER=clang \
67-
-DCMAKE_CXX_COMPILER=clang++ \
68-
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
69-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
70-
-DCMAKE_LINKER=lld \
71-
-DLLVM_ENABLE_ASSERTIONS=ON \
72-
-DLLVM_ENABLE_PROJECTS=mlir \
73-
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \
74-
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$GITHUB_WORKSPACE" \
75-
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="${GITHUB_WORKSPACE}/externals/llvm-external-projects/torch-mlir-dialects" \
76-
-DLLVM_TARGETS_TO_BUILD=host \
77-
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
78-
-DTORCH_MLIR_USE_INSTALLED_PYTORCH="${{ matrix.torch-binary }}" \
79-
-DPython3_EXECUTABLE="$(which python)" \
80-
$GITHUB_WORKSPACE/externals/llvm-project/llvm
81-
82-
- name: Configure os-arch='ubuntu-x86_64' llvm-build='out-of-tree' torch-binary='${{ matrix.torch-binary }}'
83-
# Most elaborate build, but cached
84-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'out-of-tree' }}
61+
if: ${{ matrix.os-arch == 'ubuntu-x86_64' }}
8562
run: |
86-
cmake -GNinja -Bllvm-build \
87-
-DCMAKE_BUILD_TYPE=Release \
88-
-DCMAKE_C_COMPILER=clang \
89-
-DCMAKE_CXX_COMPILER=clang++ \
90-
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
91-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
92-
-DCMAKE_LINKER=lld \
93-
-DLLVM_ENABLE_ASSERTIONS=ON \
94-
-DLLVM_ENABLE_PROJECTS=mlir \
95-
-DLLVM_TARGETS_TO_BUILD=host \
96-
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
97-
-DPython3_EXECUTABLE="$(which python)" \
98-
$GITHUB_WORKSPACE/externals/llvm-project/llvm
99-
cmake --build llvm-build
100-
101-
cmake -GNinja -Bbuild \
102-
-DCMAKE_C_COMPILER=clang \
103-
-DCMAKE_CXX_COMPILER=clang++ \
104-
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
105-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
106-
-DCMAKE_LINKER=lld \
107-
-DLLVM_DIR="$GITHUB_WORKSPACE/llvm-build/lib/cmake/llvm/" \
108-
-DMLIR_DIR="$GITHUB_WORKSPACE/llvm-build/lib/cmake/mlir/" \
109-
-DMLIR_ENABLE_BINDINGS_PYTHON=OFF \
110-
-DTORCH_MLIR_USE_INSTALLED_PYTORCH="${{ matrix.torch-binary }}" \
111-
-DPython3_EXECUTABLE="$(which python)" \
112-
$GITHUB_WORKSPACE
113-
63+
cd $GITHUB_WORKSPACE
64+
TM_PACKAGES="${{ matrix.llvm-build }}" TM_USE_PYTORCH_BINARY="${{ matrix.torch-binary }}" ./build_tools/python_deploy/build_linux_packages.sh
11465
- name: Configure os-arch='macos-arm64' llvm-build='in-tree' torch-binary='${{ matrix.torch-binary }}'
11566
# cross compile, can't test arm64
11667
if: ${{ matrix.os-arch == 'macos-arm64' && matrix.llvm-build == 'in-tree' }}
@@ -139,63 +90,7 @@ jobs:
13990
-DMACOSX_DEPLOYMENT_TARGET=12.0 \
14091
-DPython3_EXECUTABLE="$(which python)" \
14192
$GITHUB_WORKSPACE/externals/llvm-project/llvm
142-
143-
- name: Build torch-mlir
144-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' }}
145-
run: |
146-
cmake --build build
147-
14893
- name: Build torch-mlir (cross-compile)
14994
if: ${{ matrix.os-arch == 'macos-arm64' }}
15095
run: |
15196
cmake --build build_arm64
152-
153-
- name: Run torch-mlir unit tests
154-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' }}
155-
run: |
156-
cmake --build build --target check-torch-mlir-all
157-
158-
- name: Ensure generated files are up to date
159-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
160-
run: |
161-
./build_tools/update_torch_ods.sh
162-
./build_tools/update_shape_lib.sh
163-
if ! git diff --quiet; then
164-
echo "#######################################################"
165-
echo "Generated files are not up to date (see diff below)"
166-
echo ">>> Please run ./build_tools/update_torch_ods.sh and ./build_tools/update_shape_lib.sh <<<"
167-
echo "#######################################################"
168-
git diff --color=always
169-
exit 1
170-
fi
171-
172-
- name: Run refbackend e2e integration tests
173-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
174-
run: |
175-
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
176-
python -m e2e_testing.main --config=refbackend -v
177-
178-
- name: Run eager_mode e2e integration tests
179-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
180-
run: |
181-
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
182-
python -m e2e_testing.main --config=eager_mode -v
183-
184-
- name: Run mhlo e2e integration tests
185-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
186-
run: |
187-
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
188-
python -m e2e_testing.main --config=mhlo -v
189-
190-
- name: Run tosa e2e integration tests
191-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
192-
run: |
193-
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
194-
python -m e2e_testing.main --config=tosa -v
195-
196-
- name: Run lazy_tensor_core e2e integration tests
197-
if: ${{ matrix.os-arch == 'ubuntu-x86_64' && matrix.llvm-build == 'in-tree' }}
198-
run: |
199-
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
200-
echo "LTC tests disabled temporarily. https://github.com/llvm/torch-mlir/pull/1292"
201-
# python -m e2e_testing.main --config=lazy_tensor_core -v

0 commit comments

Comments
 (0)