torch-mlir/.github/workflows/bazelBuildAndTest.yml

111 lines
3.7 KiB
YAML
Raw Normal View History

name: Bazel Build and Test
on:
# TODO: Fix bazel build after US holidays of 2023-Nov-23 and re-enable.
# push:
# branches: [ main ]
workflow_dispatch:
[Build] Add concurrency groups to address long queue times (#1219) We're seeing large CI queue times ([example](https://discord.com/channels/636084430946959380/742573221882364009/1007631811184164944)) especially with MacOS VMs on GHA. Part of the problem is follow-on commits to the same branch which trigger new runs while the previous runs are still in-progress, hogging on the scarce VMs. This PR adds concurrency groups to the GHA workflow which ensures 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`). As discussed on discord [thread](https://discord.com/channels/636084430946959380/1007787336848912386/1007787338895740928), once this lands we may have to closely monitor the workflows to see this didn't introduce unintended consequences. If so, we could either revert, or decide to selectively cancel particular runs (e.g. macos only which is the main bottleneck right now) instead of entire workflow. This will also require some expectation management. As in, if you see an ❌ on the main branch, it may not necessarily mean things broke, it could mean the run was killed by a more recent run. Making it a bit harder to traceback a failure to a commit in a sequence of commits (requiring to run those builds again). Thanks @powderluv for the proposal and pointer to this! It should help with the scarce VMs on GHA and save on queue time. References: * https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow * https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
2022-08-13 08:38:48 +08:00
# 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
jobs:
Simplify matrix configuration for CI workflows (#1213) Addresses https://github.com/llvm/torch-mlir/issues/1207. #### Provisioned jobs: ``` # ubuntu - x86_64 - llvm in-tree - pytorch binary - build+test # most used dev flow and fastest signal # ubuntu - x86_64 - llvm out-of-tree - pytorch source - build+test # most elaborate build # macos - arm64 - llvm in-tree - pytorch source - build only # cross compile, can't test arm64 ``` #### Main changes - [x] Spawn macos builds from a separate matrix (in the same workflow). It made sense to do this as they are fairly different from ubuntu (cross compile, use a different cmake configuration). This simplifies the matrix configuration and exclusions quite a bit, and makes the workflow a bit more tractable and maintenance friendly. - [x] Remove the submodule md5sum step for ccache config. This was [broken](https://github.com/llvm/torch-mlir/runs/7779288734?check_suite_focus=true#step:3:145) for a while now. - [x] Removes unused matrix options - `os`, `targetarch`, `python-version`, `llvmtype`. - [x] Address ZSTD [comment](https://github.com/llvm/torch-mlir/pull/1204#discussion_r942349282) on @powderluv's cross compile [PR](https://github.com/llvm/torch-mlir/pull/1204). #### Further improvements (to be addressed in follow-on): * ubuntu-x86_64 out-of-tree integration tests fail ([error](https://github.com/sjain-stanford/torch-mlir/runs/7781264029?check_suite_focus=true)); only run unit tests for now (tests are excluded in current CI too) #### Passing workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/2840676309 ![image](https://user-images.githubusercontent.com/19234106/184194535-f3807991-401a-4cb9-b030-0ee8c334eba3.png)
2022-08-12 07:35:15 +08:00
ubuntu-build:
name: ubuntu-x86_64
CI script improvements (#1547) * ci: update versions of external actions Node.js 12 actions are deprecated and will eventually go away, so this patch bumps the old actions to their latest versions that use Node.js 16. * ci: replace deprecated action with bash commands The llvm/actions/install-ninja action uses Node.js 12, which is deprecated. Since that action is not updated to work with Node.js 16, this patch replaces that action with equivalent bash commands to install Ninja. * ci: use smaller ccache artifacts to reduce evictions Over time, our ccache sizes have grown quite large (some as large as 1.3 GB), which results in us routinely exceeding GitHub's limits, thus triggering frequent cache evictions. As a result, cache downloads and uploads take unnecessary long, in addition to fewer cache entries being available. Based on experiments on a clean cache state, it appears that we need less than 300 MB of (compressed) ccache artifacts for each build type. Anything larger than that will accrue changes from the past that aren't needed. To alleviate the cache burden, this patch sets the maximum ccache size to be 300 MB. This change should not affect the success or failure of our builds. I will monitor the build times to check whether this change causes any performance degradation. * ci: use consistent platform identifiers Prior to this patch, some of our builds ran on `ubuntu-latest`, while some others ran on `ubuntu-20.04` and others ran on `ubuntu-22.04`, with similar situations for macOS and windows. This patch instead sets all Linux builds to run on `ubuntu-latest`, all macOS builds to run on `macos-latest`, and all Windows builds to run on `windows-latest`, to make debugging future CI failures a little easier.
2022-11-03 10:37:01 +08:00
runs-on: ubuntu-latest
Simplify matrix configuration for CI workflows (#1213) Addresses https://github.com/llvm/torch-mlir/issues/1207. #### Provisioned jobs: ``` # ubuntu - x86_64 - llvm in-tree - pytorch binary - build+test # most used dev flow and fastest signal # ubuntu - x86_64 - llvm out-of-tree - pytorch source - build+test # most elaborate build # macos - arm64 - llvm in-tree - pytorch source - build only # cross compile, can't test arm64 ``` #### Main changes - [x] Spawn macos builds from a separate matrix (in the same workflow). It made sense to do this as they are fairly different from ubuntu (cross compile, use a different cmake configuration). This simplifies the matrix configuration and exclusions quite a bit, and makes the workflow a bit more tractable and maintenance friendly. - [x] Remove the submodule md5sum step for ccache config. This was [broken](https://github.com/llvm/torch-mlir/runs/7779288734?check_suite_focus=true#step:3:145) for a while now. - [x] Removes unused matrix options - `os`, `targetarch`, `python-version`, `llvmtype`. - [x] Address ZSTD [comment](https://github.com/llvm/torch-mlir/pull/1204#discussion_r942349282) on @powderluv's cross compile [PR](https://github.com/llvm/torch-mlir/pull/1204). #### Further improvements (to be addressed in follow-on): * ubuntu-x86_64 out-of-tree integration tests fail ([error](https://github.com/sjain-stanford/torch-mlir/runs/7781264029?check_suite_focus=true)); only run unit tests for now (tests are excluded in current CI too) #### Passing workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/2840676309 ![image](https://user-images.githubusercontent.com/19234106/184194535-f3807991-401a-4cb9-b030-0ee8c334eba3.png)
2022-08-12 07:35:15 +08:00
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/*
Simplify matrix configuration for CI workflows (#1213) Addresses https://github.com/llvm/torch-mlir/issues/1207. #### Provisioned jobs: ``` # ubuntu - x86_64 - llvm in-tree - pytorch binary - build+test # most used dev flow and fastest signal # ubuntu - x86_64 - llvm out-of-tree - pytorch source - build+test # most elaborate build # macos - arm64 - llvm in-tree - pytorch source - build only # cross compile, can't test arm64 ``` #### Main changes - [x] Spawn macos builds from a separate matrix (in the same workflow). It made sense to do this as they are fairly different from ubuntu (cross compile, use a different cmake configuration). This simplifies the matrix configuration and exclusions quite a bit, and makes the workflow a bit more tractable and maintenance friendly. - [x] Remove the submodule md5sum step for ccache config. This was [broken](https://github.com/llvm/torch-mlir/runs/7779288734?check_suite_focus=true#step:3:145) for a while now. - [x] Removes unused matrix options - `os`, `targetarch`, `python-version`, `llvmtype`. - [x] Address ZSTD [comment](https://github.com/llvm/torch-mlir/pull/1204#discussion_r942349282) on @powderluv's cross compile [PR](https://github.com/llvm/torch-mlir/pull/1204). #### Further improvements (to be addressed in follow-on): * ubuntu-x86_64 out-of-tree integration tests fail ([error](https://github.com/sjain-stanford/torch-mlir/runs/7781264029?check_suite_focus=true)); only run unit tests for now (tests are excluded in current CI too) #### Passing workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/2840676309 ![image](https://user-images.githubusercontent.com/19234106/184194535-f3807991-401a-4cb9-b030-0ee8c334eba3.png)
2022-08-12 07:35:15 +08:00
- name: Checkout torch-mlir
uses: actions/checkout@v3
with:
submodules: 'true'
Simplify matrix configuration for CI workflows (#1213) Addresses https://github.com/llvm/torch-mlir/issues/1207. #### Provisioned jobs: ``` # ubuntu - x86_64 - llvm in-tree - pytorch binary - build+test # most used dev flow and fastest signal # ubuntu - x86_64 - llvm out-of-tree - pytorch source - build+test # most elaborate build # macos - arm64 - llvm in-tree - pytorch source - build only # cross compile, can't test arm64 ``` #### Main changes - [x] Spawn macos builds from a separate matrix (in the same workflow). It made sense to do this as they are fairly different from ubuntu (cross compile, use a different cmake configuration). This simplifies the matrix configuration and exclusions quite a bit, and makes the workflow a bit more tractable and maintenance friendly. - [x] Remove the submodule md5sum step for ccache config. This was [broken](https://github.com/llvm/torch-mlir/runs/7779288734?check_suite_focus=true#step:3:145) for a while now. - [x] Removes unused matrix options - `os`, `targetarch`, `python-version`, `llvmtype`. - [x] Address ZSTD [comment](https://github.com/llvm/torch-mlir/pull/1204#discussion_r942349282) on @powderluv's cross compile [PR](https://github.com/llvm/torch-mlir/pull/1204). #### Further improvements (to be addressed in follow-on): * ubuntu-x86_64 out-of-tree integration tests fail ([error](https://github.com/sjain-stanford/torch-mlir/runs/7781264029?check_suite_focus=true)); only run unit tests for now (tests are excluded in current CI too) #### Passing workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/2840676309 ![image](https://user-images.githubusercontent.com/19234106/184194535-f3807991-401a-4cb9-b030-0ee8c334eba3.png)
2022-08-12 07:35:15 +08:00
Enable bazel LIT tests in CI (#1596) Bazel LIT test support was added in https://github.com/llvm/torch-mlir/pull/1585. This PR enables the tests in CI. ``` INFO: Build completed successfully, 254 total actions @torch-mlir//test/Conversion:TorchToArith/basic.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/basic.mlir.test PASSED in 0.5s @torch-mlir//test/Conversion:TorchToLinalg/elementwise.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/flatten.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/pooling.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/unsqueeze.mlir.test PASSED in 0.2s @torch-mlir//test/Conversion:TorchToLinalg/view.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/basic.mlir.test PASSED in 0.5s @torch-mlir//test/Conversion:TorchToMhlo/elementwise.mlir.test PASSED in 0.9s @torch-mlir//test/Conversion:TorchToMhlo/gather.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/linear.mlir.test PASSED in 0.6s @torch-mlir//test/Conversion:TorchToMhlo/pooling.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/reduction.mlir.test PASSED in 0.4s @torch-mlir//test/Conversion:TorchToMhlo/view_like.mlir.test PASSED in 0.6s @torch-mlir//test/Conversion:TorchToSCF/basic.mlir.test PASSED in 0.2s @torch-mlir//test/Conversion:TorchToTosa/basic.mlir.test PASSED in 1.1s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/basic.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/free-functions.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/initializers.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/methods.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/module-uses-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/module-uses.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances-multiple-module-args.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/submodules.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/visibility.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/adjust-calling-conventions.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/canonicalize.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/decompose-complex-ops-legal.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/decompose-complex-ops.mlir.test PASSED in 0.9s @torch-mlir//test/Dialect:Torch/drop-shape-calculations.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/erase-module-initializer.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/inline-global-slots-analysis.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/inline-global-slots-transform.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/invalid.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/lower-to-backend-contract-error.mlir.test PASSED in 17.3s @torch-mlir//test/Dialect:Torch/maximize-value-semantics.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/ops.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/prepare-for-globalize-object-graph.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/promote-types.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/reduce-op-variants-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/reduce-op-variants.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/refine-public-return.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/refine-types-branch.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/refine-types-ops.mlir.test PASSED in 0.6s @torch-mlir//test/Dialect:Torch/refine-types.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/reify-shape-calculations.mlir.test PASSED in 2.9s @torch-mlir//test/Dialect:Torch/simplify-shape-calculations.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/torch-function-to-torch-backend-pipeline.mlir.test PASSED in 0.6s @torch-mlir//test/Dialect:TorchConversion/canonicalize.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:TorchConversion/finalizing-backend-type-conversion.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/func-backend-type-conversion.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:TorchConversion/ops.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/verify-linalg-on-tensors-backend-contract.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/verify-tosa-backend-contract.mlir.test PASSED in 0.2s @torch-mlir//test/RefBackend:insert-rng-globals.mlir.test PASSED in 0.2s INFO: Build completed successfully, 2[54](https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489#step:7:55) total actions @torch-mlir//test/RefBackend:munge-calling-conventions.mlir.test PASSED in 0.2s Executed [59](https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489#step:7:60) out of 59 tests: 59 tests pass. ``` GHA workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489
2022-11-17 03:59:33 +08:00
# Continually update cache even if there's a "hit" during
# restore to avoid the cache going stale over time
# https://github.com/actions/cache/blob/main/workarounds.md#update-a-cache
- name: Setup cache for bazel
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: torch_mlir-bazel-build-cache-${{ runner.os }}-${{ github.sha }}
restore-keys: |
torch_mlir-bazel-build-cache-${{ runner.os }}
# Change bazel cache directory to root ownership
# to allow writing to it from within the docker container.
# If no cache hits, this directory is not present
# so don't run chown (will error otherwise).
- name: Set bazel cache permissions
run: |
if [ -d "${HOME}/.cache/bazel" ]; then
sudo chown -R root:root "${HOME}/.cache/bazel"
fi
- name: Build docker image
run: |
docker build -f utils/bazel/docker/Dockerfile \
-t torch-mlir:ci \
.
- name: Verify buildifier was run (bazel lint)
run: |
docker run --rm \
-v "$(pwd)":"/opt/src/torch-mlir" \
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \
torch-mlir:ci \
bazel run @torch-mlir//:buildifier
if [ -n "$(git status --porcelain)" ]; then
echo "Please 'bazel run @torch-mlir//:buildifier' and commit changes."
exit 1
fi
- name: Bazel build torch-mlir
Enable bazel LIT tests in CI (#1596) Bazel LIT test support was added in https://github.com/llvm/torch-mlir/pull/1585. This PR enables the tests in CI. ``` INFO: Build completed successfully, 254 total actions @torch-mlir//test/Conversion:TorchToArith/basic.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/basic.mlir.test PASSED in 0.5s @torch-mlir//test/Conversion:TorchToLinalg/elementwise.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/flatten.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/pooling.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/unsqueeze.mlir.test PASSED in 0.2s @torch-mlir//test/Conversion:TorchToLinalg/view.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/basic.mlir.test PASSED in 0.5s @torch-mlir//test/Conversion:TorchToMhlo/elementwise.mlir.test PASSED in 0.9s @torch-mlir//test/Conversion:TorchToMhlo/gather.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/linear.mlir.test PASSED in 0.6s @torch-mlir//test/Conversion:TorchToMhlo/pooling.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/reduction.mlir.test PASSED in 0.4s @torch-mlir//test/Conversion:TorchToMhlo/view_like.mlir.test PASSED in 0.6s @torch-mlir//test/Conversion:TorchToSCF/basic.mlir.test PASSED in 0.2s @torch-mlir//test/Conversion:TorchToTosa/basic.mlir.test PASSED in 1.1s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/basic.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/free-functions.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/initializers.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/methods.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/module-uses-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/module-uses.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances-multiple-module-args.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/submodules.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/visibility.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/adjust-calling-conventions.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/canonicalize.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/decompose-complex-ops-legal.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/decompose-complex-ops.mlir.test PASSED in 0.9s @torch-mlir//test/Dialect:Torch/drop-shape-calculations.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/erase-module-initializer.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/inline-global-slots-analysis.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/inline-global-slots-transform.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/invalid.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/lower-to-backend-contract-error.mlir.test PASSED in 17.3s @torch-mlir//test/Dialect:Torch/maximize-value-semantics.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/ops.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/prepare-for-globalize-object-graph.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/promote-types.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/reduce-op-variants-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/reduce-op-variants.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/refine-public-return.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/refine-types-branch.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/refine-types-ops.mlir.test PASSED in 0.6s @torch-mlir//test/Dialect:Torch/refine-types.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/reify-shape-calculations.mlir.test PASSED in 2.9s @torch-mlir//test/Dialect:Torch/simplify-shape-calculations.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/torch-function-to-torch-backend-pipeline.mlir.test PASSED in 0.6s @torch-mlir//test/Dialect:TorchConversion/canonicalize.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:TorchConversion/finalizing-backend-type-conversion.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/func-backend-type-conversion.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:TorchConversion/ops.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/verify-linalg-on-tensors-backend-contract.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/verify-tosa-backend-contract.mlir.test PASSED in 0.2s @torch-mlir//test/RefBackend:insert-rng-globals.mlir.test PASSED in 0.2s INFO: Build completed successfully, 2[54](https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489#step:7:55) total actions @torch-mlir//test/RefBackend:munge-calling-conventions.mlir.test PASSED in 0.2s Executed [59](https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489#step:7:60) out of 59 tests: 59 tests pass. ``` GHA workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489
2022-11-17 03:59:33 +08:00
run: |
docker run --rm \
-v "$(pwd)":"/opt/src/torch-mlir" \
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \
torch-mlir:ci \
bazel build @torch-mlir//:torch-mlir-opt
Enable bazel LIT tests in CI (#1596) Bazel LIT test support was added in https://github.com/llvm/torch-mlir/pull/1585. This PR enables the tests in CI. ``` INFO: Build completed successfully, 254 total actions @torch-mlir//test/Conversion:TorchToArith/basic.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/basic.mlir.test PASSED in 0.5s @torch-mlir//test/Conversion:TorchToLinalg/elementwise.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/flatten.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/pooling.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToLinalg/unsqueeze.mlir.test PASSED in 0.2s @torch-mlir//test/Conversion:TorchToLinalg/view.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/basic.mlir.test PASSED in 0.5s @torch-mlir//test/Conversion:TorchToMhlo/elementwise.mlir.test PASSED in 0.9s @torch-mlir//test/Conversion:TorchToMhlo/gather.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/linear.mlir.test PASSED in 0.6s @torch-mlir//test/Conversion:TorchToMhlo/pooling.mlir.test PASSED in 0.3s @torch-mlir//test/Conversion:TorchToMhlo/reduction.mlir.test PASSED in 0.4s @torch-mlir//test/Conversion:TorchToMhlo/view_like.mlir.test PASSED in 0.6s @torch-mlir//test/Conversion:TorchToSCF/basic.mlir.test PASSED in 0.2s @torch-mlir//test/Conversion:TorchToTosa/basic.mlir.test PASSED in 1.1s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/basic.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/free-functions.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/initializers.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/methods.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/module-uses-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/module-uses.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances-multiple-module-args.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/multiple-instances.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/submodules.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/GlobalizeObjectGraph/visibility.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/adjust-calling-conventions.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/canonicalize.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/decompose-complex-ops-legal.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/decompose-complex-ops.mlir.test PASSED in 0.9s @torch-mlir//test/Dialect:Torch/drop-shape-calculations.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/erase-module-initializer.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/inline-global-slots-analysis.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/inline-global-slots-transform.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/invalid.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/lower-to-backend-contract-error.mlir.test PASSED in 17.3s @torch-mlir//test/Dialect:Torch/maximize-value-semantics.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/ops.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/prepare-for-globalize-object-graph.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/promote-types.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/reduce-op-variants-error.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/reduce-op-variants.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/refine-public-return.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:Torch/refine-types-branch.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/refine-types-ops.mlir.test PASSED in 0.6s @torch-mlir//test/Dialect:Torch/refine-types.mlir.test PASSED in 0.4s @torch-mlir//test/Dialect:Torch/reify-shape-calculations.mlir.test PASSED in 2.9s @torch-mlir//test/Dialect:Torch/simplify-shape-calculations.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:Torch/torch-function-to-torch-backend-pipeline.mlir.test PASSED in 0.6s @torch-mlir//test/Dialect:TorchConversion/canonicalize.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:TorchConversion/finalizing-backend-type-conversion.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/func-backend-type-conversion.mlir.test PASSED in 0.2s @torch-mlir//test/Dialect:TorchConversion/ops.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/verify-linalg-on-tensors-backend-contract.mlir.test PASSED in 0.3s @torch-mlir//test/Dialect:TorchConversion/verify-tosa-backend-contract.mlir.test PASSED in 0.2s @torch-mlir//test/RefBackend:insert-rng-globals.mlir.test PASSED in 0.2s INFO: Build completed successfully, 2[54](https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489#step:7:55) total actions @torch-mlir//test/RefBackend:munge-calling-conventions.mlir.test PASSED in 0.2s Executed [59](https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489#step:7:60) out of 59 tests: 59 tests pass. ``` GHA workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/3476816449/jobs/5812368489
2022-11-17 03:59:33 +08:00
- name: Bazel test torch-mlir (lit tests)
run: |
docker run --rm \
-v "$(pwd)":"/opt/src/torch-mlir" \
-v "${HOME}/.cache/bazel":"/root/.cache/bazel" \
torch-mlir:ci \
bazel test @torch-mlir//test/...
# Switch back bazel cache directory to user ownership
# to allow GHA post-cache step to save cache without
# permissions issue.
- name: Switch bazel cache permissions
run: |
if [ -d "${HOME}/.cache/bazel" ]; then
sudo chown -R "$USER":"$USER" "${HOME}/.cache/bazel"
fi
Simplify matrix configuration for CI workflows (#1213) Addresses https://github.com/llvm/torch-mlir/issues/1207. #### Provisioned jobs: ``` # ubuntu - x86_64 - llvm in-tree - pytorch binary - build+test # most used dev flow and fastest signal # ubuntu - x86_64 - llvm out-of-tree - pytorch source - build+test # most elaborate build # macos - arm64 - llvm in-tree - pytorch source - build only # cross compile, can't test arm64 ``` #### Main changes - [x] Spawn macos builds from a separate matrix (in the same workflow). It made sense to do this as they are fairly different from ubuntu (cross compile, use a different cmake configuration). This simplifies the matrix configuration and exclusions quite a bit, and makes the workflow a bit more tractable and maintenance friendly. - [x] Remove the submodule md5sum step for ccache config. This was [broken](https://github.com/llvm/torch-mlir/runs/7779288734?check_suite_focus=true#step:3:145) for a while now. - [x] Removes unused matrix options - `os`, `targetarch`, `python-version`, `llvmtype`. - [x] Address ZSTD [comment](https://github.com/llvm/torch-mlir/pull/1204#discussion_r942349282) on @powderluv's cross compile [PR](https://github.com/llvm/torch-mlir/pull/1204). #### Further improvements (to be addressed in follow-on): * ubuntu-x86_64 out-of-tree integration tests fail ([error](https://github.com/sjain-stanford/torch-mlir/runs/7781264029?check_suite_focus=true)); only run unit tests for now (tests are excluded in current CI too) #### Passing workflow: https://github.com/sjain-stanford/torch-mlir/actions/runs/2840676309 ![image](https://user-images.githubusercontent.com/19234106/184194535-f3807991-401a-4cb9-b030-0ee8c334eba3.png)
2022-08-12 07:35:15 +08:00
- name: Send mail
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ secrets.SMTP_SERVER }}
server_port: ${{ secrets.SMTP_PORT }}
username: ${{ secrets.SMTP_USERNAME }}
password: ${{ secrets.SMTP_PASSWORD }}
subject: GitHub Action Bazel Build and Test failed!
body: Bazel Build job failed! See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} for more information.
to: ${{ secrets.MAIL_RECEIVER }}
from: Torch-MLIR Bazel Build GitHub Actions