From 43449871ddd38f42e5880ea3278b7543b9dde72a Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Tue, 31 May 2022 16:58:18 -0400 Subject: [PATCH 01/17] Run examples in cmake CI --- .github/workflows/ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ac836fe9e..fe5ac3e93 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,6 +88,14 @@ jobs: path: ~/cmake_build/py_pkg/dist/*.whl if-no-files-found: error retention-days: 7 + + - name: Run Examples + run: | + cd examples + python example_compiler_gym_service/demo_without_bazel.py + python example_unrolling_service/examples_without_bazel.py + python loop_optimizations_service/examples_without_bazel.py + shell: bash build-mlir-env-linux-cmake: runs-on: ubuntu-latest From 0fe508d896fe025a12bebcb4943ae4e2833d7526 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Tue, 31 May 2022 17:03:57 -0400 Subject: [PATCH 02/17] make pre-commit hook happy --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe5ac3e93..2e78f5b5d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,7 +88,7 @@ jobs: path: ~/cmake_build/py_pkg/dist/*.whl if-no-files-found: error retention-days: 7 - + - name: Run Examples run: | cd examples From 2594cbab8c8ed7c4a82651a1f3f7b8a41502cbb8 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Mon, 6 Jun 2022 21:39:18 -0400 Subject: [PATCH 03/17] install wheel so we can run the examples --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2e78f5b5d..7eafee9a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -91,6 +91,7 @@ jobs: - name: Run Examples run: | + pip install ~/cmake_build/py_pkg/dist/*.whl cd examples python example_compiler_gym_service/demo_without_bazel.py python example_unrolling_service/examples_without_bazel.py From fee3e89ee0ffda8cbbd51eeddc49308e06b4743f Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Tue, 7 Jun 2022 09:24:34 -0400 Subject: [PATCH 04/17] Fix typo in path of script --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7eafee9a5..6a45ca362 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,8 +94,8 @@ jobs: pip install ~/cmake_build/py_pkg/dist/*.whl cd examples python example_compiler_gym_service/demo_without_bazel.py - python example_unrolling_service/examples_without_bazel.py - python loop_optimizations_service/examples_without_bazel.py + python example_unrolling_service/example_without_bazel.py + python loop_optimizations_service/example_without_bazel.py shell: bash build-mlir-env-linux-cmake: From 088ee4716cc4f1be466232166b495bdd8a14093e Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Tue, 7 Jun 2022 16:17:28 -0400 Subject: [PATCH 05/17] upload and download example binaries --- .github/workflows/ci.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6a45ca362..1c4df430d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -85,7 +85,10 @@ jobs: uses: actions/upload-artifact@v2 with: name: linux-wheel-cmake - path: ~/cmake_build/py_pkg/dist/*.whl + path: | + ~/cmake_build/py_pkg/dist/*.whl + ~/example_unrolling_service/loop_unroller/loop_unroller + ~/loop_optimizations_service/opt_loops/opt_loops if-no-files-found: error retention-days: 7 @@ -233,6 +236,12 @@ jobs: uses: actions/download-artifact@v2 with: name: linux-wheel-cmake + + - name: Move examples binaries + run: | + mv loop_unroller ~/example_unrolling_service/loop_unroller/loop_unroller + mv opt_loops ~/loop_optimizations_service/opt_loops/opt_loops + shell: bash - name: Install wheel run: python -m pip install *.whl @@ -245,6 +254,15 @@ jobs: - name: Run the test suite run: make install-test PYTEST_ARGS="--ignore tests/mlir" + + - name: Run environment examples + run: | + cd examples + python example_compiler_gym_service/demo_without_bazel.py + python example_unrolling_service/example_without_bazel.py + python loop_optimizations_service/example_without_bazel.py + cd - + shell: bash test-mlir-env-linux-cmake: needs: build-mlir-env-linux-cmake From 2706976190ecaeee7007568695397658b60318ca Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Tue, 7 Jun 2022 16:27:36 -0400 Subject: [PATCH 06/17] make pre-commit happy --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1c4df430d..477377535 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -86,9 +86,9 @@ jobs: with: name: linux-wheel-cmake path: | - ~/cmake_build/py_pkg/dist/*.whl - ~/example_unrolling_service/loop_unroller/loop_unroller - ~/loop_optimizations_service/opt_loops/opt_loops + ~/cmake_build/py_pkg/dist/*.whl + ~/example_unrolling_service/loop_unroller/loop_unroller + ~/loop_optimizations_service/opt_loops/opt_loops if-no-files-found: error retention-days: 7 @@ -236,7 +236,7 @@ jobs: uses: actions/download-artifact@v2 with: name: linux-wheel-cmake - + - name: Move examples binaries run: | mv loop_unroller ~/example_unrolling_service/loop_unroller/loop_unroller @@ -254,7 +254,7 @@ jobs: - name: Run the test suite run: make install-test PYTEST_ARGS="--ignore tests/mlir" - + - name: Run environment examples run: | cd examples From f8213f2c932797465b7f0f1e5ca79b0ef71bdcd7 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Wed, 8 Jun 2022 00:06:04 -0400 Subject: [PATCH 07/17] Try removing mv command --- .github/workflows/ci.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 477377535..5fc0ed00d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -237,12 +237,6 @@ jobs: with: name: linux-wheel-cmake - - name: Move examples binaries - run: | - mv loop_unroller ~/example_unrolling_service/loop_unroller/loop_unroller - mv opt_loops ~/loop_optimizations_service/opt_loops/opt_loops - shell: bash - - name: Install wheel run: python -m pip install *.whl From 8aa1670a6b665a4adea5c8fed2cc4af483f2900f Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Wed, 8 Jun 2022 08:15:12 -0400 Subject: [PATCH 08/17] Upload and download each binary separately --- .github/workflows/ci.yaml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fc0ed00d..163d828e8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -85,10 +85,23 @@ jobs: uses: actions/upload-artifact@v2 with: name: linux-wheel-cmake - path: | - ~/cmake_build/py_pkg/dist/*.whl - ~/example_unrolling_service/loop_unroller/loop_unroller - ~/loop_optimizations_service/opt_loops/opt_loops + path: ~/cmake_build/py_pkg/dist/*.whl + if-no-files-found: error + retention-days: 7 + + - name: Upload loop_unroller binary + uses: actions/upload-artifact@v2 + with: + name: linux-loop-unrollee-cmake + path: ~/example_unrolling_service/loop_unroller/loop_unroller + if-no-files-found: error + retention-days: 7 + + - name: Upload opt_loops binary + uses: actions/upload-artifact@v2 + with: + name: linux-opt-loops-cmake + path: ~/loop_optimizations_service/opt_loops/opt_loops if-no-files-found: error retention-days: 7 @@ -249,6 +262,16 @@ jobs: - name: Run the test suite run: make install-test PYTEST_ARGS="--ignore tests/mlir" + - name: Download loop_unroller + uses: actions/download-artifact@v2 + with: + name: linux-loop-unroller-cmake + + - name: Download opt_loops + uses: actions/download-artifact@v2 + with: + name: linux-opt-loops-cmake + - name: Run environment examples run: | cd examples From 949596fcc9801b2e00bafaef9011c8a2edd2ab3d Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Wed, 8 Jun 2022 08:17:03 -0400 Subject: [PATCH 09/17] Mv binaries after downloading them --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 163d828e8..ca940d2d7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -272,6 +272,12 @@ jobs: with: name: linux-opt-loops-cmake + - name: Move examples binaries + run: | + mv loop_unroller ~/example_unrolling_service/loop_unroller/loop_unroller + mv opt_loops ~/loop_optimizations_service/opt_loops/opt_loops + shell: bash + - name: Run environment examples run: | cd examples From f9f9529a4ccc0e3bc8beb8ccb7489b00c8ca90a9 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Wed, 8 Jun 2022 11:51:15 -0400 Subject: [PATCH 10/17] fix paths of examples --- .github/workflows/ci.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ca940d2d7..90507f877 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -92,8 +92,8 @@ jobs: - name: Upload loop_unroller binary uses: actions/upload-artifact@v2 with: - name: linux-loop-unrollee-cmake - path: ~/example_unrolling_service/loop_unroller/loop_unroller + name: linux-loop-unroller-cmake + path: examples/example_unrolling_service/loop_unroller/loop_unroller if-no-files-found: error retention-days: 7 @@ -101,7 +101,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: linux-opt-loops-cmake - path: ~/loop_optimizations_service/opt_loops/opt_loops + path: examples/loop_optimizations_service/opt_loops/opt_loops if-no-files-found: error retention-days: 7 @@ -112,6 +112,7 @@ jobs: python example_compiler_gym_service/demo_without_bazel.py python example_unrolling_service/example_without_bazel.py python loop_optimizations_service/example_without_bazel.py + cd - shell: bash build-mlir-env-linux-cmake: @@ -274,8 +275,8 @@ jobs: - name: Move examples binaries run: | - mv loop_unroller ~/example_unrolling_service/loop_unroller/loop_unroller - mv opt_loops ~/loop_optimizations_service/opt_loops/opt_loops + mv loop_unroller examples/example_unrolling_service/loop_unroller/loop_unroller + mv opt_loops examples/loop_optimizations_service/opt_loops/opt_loops shell: bash - name: Run environment examples From a94697647d5415d3de14d342eabcc25082f53c2c Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Wed, 8 Jun 2022 16:42:43 -0400 Subject: [PATCH 11/17] Try again with minor modifications --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 90507f877..e7dd15c67 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -259,10 +259,7 @@ jobs: - name: Install test dependencies run: python -m pip install -r tests/requirements.txt - - - name: Run the test suite - run: make install-test PYTEST_ARGS="--ignore tests/mlir" - + - name: Download loop_unroller uses: actions/download-artifact@v2 with: @@ -275,8 +272,8 @@ jobs: - name: Move examples binaries run: | - mv loop_unroller examples/example_unrolling_service/loop_unroller/loop_unroller - mv opt_loops examples/loop_optimizations_service/opt_loops/opt_loops + mv loop_unroller ./examples/example_unrolling_service/loop_unroller/loop_unroller + mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops shell: bash - name: Run environment examples @@ -288,6 +285,9 @@ jobs: cd - shell: bash + - name: Run the test suite + run: make install-test PYTEST_ARGS="--ignore tests/mlir" + test-mlir-env-linux-cmake: needs: build-mlir-env-linux-cmake runs-on: ubuntu-latest From 3afcee0dcc229e6b7818731569016781db305fe3 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Wed, 8 Jun 2022 21:49:51 -0400 Subject: [PATCH 12/17] Show path and test existence of binaries --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e7dd15c67..809ac52ec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -259,7 +259,7 @@ jobs: - name: Install test dependencies run: python -m pip install -r tests/requirements.txt - + - name: Download loop_unroller uses: actions/download-artifact@v2 with: @@ -274,6 +274,10 @@ jobs: run: | mv loop_unroller ./examples/example_unrolling_service/loop_unroller/loop_unroller mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops + echo "pwd: " + echo pwd + touch -d examples/example_unrolling_service/loop_unroller/ + touch ./examples/example_unrolling_service/loop_unroller/loop_unroller shell: bash - name: Run environment examples From 2efdc3dea54e56675c9350bbd5babea06d815af0 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Thu, 9 Jun 2022 01:27:40 -0400 Subject: [PATCH 13/17] fix echo and test commands --- .github/workflows/ci.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 809ac52ec..07a59ef4d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -275,9 +275,10 @@ jobs: mv loop_unroller ./examples/example_unrolling_service/loop_unroller/loop_unroller mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops echo "pwd: " - echo pwd - touch -d examples/example_unrolling_service/loop_unroller/ - touch ./examples/example_unrolling_service/loop_unroller/loop_unroller + pwd + ls -R | grep loop_unroller + test -d examples/example_unrolling_service/loop_unroller/ + test ./examples/example_unrolling_service/loop_unroller/loop_unroller shell: bash - name: Run environment examples From 4eab53656a3970ce266163a270c98686f2898729 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Thu, 9 Jun 2022 10:11:16 -0400 Subject: [PATCH 14/17] add executable permission to binaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to https://github.com/actions/download-artifact#permission-loss: ``` ❗ File permissions are not maintained during artifact upload ❗ ``` --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 07a59ef4d..a24d887e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -272,6 +272,8 @@ jobs: - name: Move examples binaries run: | + chmod +x loop_unroller + chmod +x opt_loops mv loop_unroller ./examples/example_unrolling_service/loop_unroller/loop_unroller mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops echo "pwd: " From d877a4a0e1ed7dc81850f435953c5063f1e21fa1 Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Thu, 9 Jun 2022 10:41:21 -0400 Subject: [PATCH 15/17] a modification to force CI to rerun --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a24d887e1..778a435fe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -278,7 +278,7 @@ jobs: mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops echo "pwd: " pwd - ls -R | grep loop_unroller + ls -alR | grep loop_unroller test -d examples/example_unrolling_service/loop_unroller/ test ./examples/example_unrolling_service/loop_unroller/loop_unroller shell: bash From ad674cbfbb2ddb667f2fe58d3ee0e83905cdd6dd Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Thu, 9 Jun 2022 11:00:06 -0400 Subject: [PATCH 16/17] force CI to re-run --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 778a435fe..b74924f40 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -276,7 +276,7 @@ jobs: chmod +x opt_loops mv loop_unroller ./examples/example_unrolling_service/loop_unroller/loop_unroller mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops - echo "pwd: " + echo "pwd: " pwd ls -alR | grep loop_unroller test -d examples/example_unrolling_service/loop_unroller/ From 75d09686336fa07a93ff0087a0478be1cc139f8c Mon Sep 17 00:00:00 2001 From: Mostafa Elhoushi Date: Thu, 9 Jun 2022 15:13:02 -0400 Subject: [PATCH 17/17] upload/download compute_programl binary and also remove running examples during build-linux-cmake --- .github/workflows/ci.yaml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b74924f40..9721813de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -89,6 +89,14 @@ jobs: if-no-files-found: error retention-days: 7 + - name: Upload compute_programl binary + uses: actions/upload-artifact@v2 + with: + name: linux-compute-programl-cmake + path: compiler_gym/third_party/programl/compute_programl + if-no-files-found: error + retention-days: 7 + - name: Upload loop_unroller binary uses: actions/upload-artifact@v2 with: @@ -105,16 +113,6 @@ jobs: if-no-files-found: error retention-days: 7 - - name: Run Examples - run: | - pip install ~/cmake_build/py_pkg/dist/*.whl - cd examples - python example_compiler_gym_service/demo_without_bazel.py - python example_unrolling_service/example_without_bazel.py - python loop_optimizations_service/example_without_bazel.py - cd - - shell: bash - build-mlir-env-linux-cmake: runs-on: ubuntu-latest steps: @@ -260,6 +258,11 @@ jobs: - name: Install test dependencies run: python -m pip install -r tests/requirements.txt + - name: Download compute_programl + uses: actions/download-artifact@v2 + with: + name: linux-compute-programl-cmake + - name: Download loop_unroller uses: actions/download-artifact@v2 with: @@ -270,17 +273,17 @@ jobs: with: name: linux-opt-loops-cmake - - name: Move examples binaries + - name: Move examples and utility binaries run: | + chmod +x compute_programl chmod +x loop_unroller chmod +x opt_loops + mv compute_programl ./compiler_gym/third_party/programl/compute_programl mv loop_unroller ./examples/example_unrolling_service/loop_unroller/loop_unroller mv opt_loops ./examples/loop_optimizations_service/opt_loops/opt_loops - echo "pwd: " - pwd - ls -alR | grep loop_unroller - test -d examples/example_unrolling_service/loop_unroller/ + test ./compiler_gym/third_party/programl/compute_programl test ./examples/example_unrolling_service/loop_unroller/loop_unroller + test ./examples/loop_optimizations_service/opt_loops/opt_loops shell: bash - name: Run environment examples