From 3edac689e1de858e141fe49c497af11e8dd75684 Mon Sep 17 00:00:00 2001 From: Joren Dumoulin Date: Tue, 17 Dec 2024 15:59:19 +0100 Subject: [PATCH 1/5] add aie ci test --- .github/workflows/ci-aie.yml | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ci-aie.yml diff --git a/.github/workflows/ci-aie.yml b/.github/workflows/ci-aie.yml new file mode 100644 index 0000000..619291d --- /dev/null +++ b/.github/workflows/ci-aie.yml @@ -0,0 +1,58 @@ +name: CI - MLIR-AIE-based Testing + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + env: + MLIR-AIE-Version: 0.0.1.2024121504+aff6da3 + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache MLIR-AIE setup + id: cache-binary + uses: actions/cache@v4 + with: + path: mlir_aie + key: mlir_aie-${{ env.MLIR-AIE-Version }} + + - name: Download and setup MLIR-AIE + if: steps.cache-binary.outputs.cache-hit != 'true' + run: | + wget -q https://github.com/Xilinx/mlir-aie/releases/download/latest-wheels/mlir_aie-${{ env.MLIR-AIE-Version }}-py3-none-manylinux_2_35_x86_64.whl -O mlir_aie.whl + unzip -q mlir_aie.whl + - name: Add MLIR-AIE to PATH + run: | + echo "$(pwd)/mlir_aie/bin" >> $GITHUB_PATH + echo "PATH after adding MLIR-AIE:" + echo $PATH + - name: Test aie-opt version + run: | + aie-opt --version + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + packages: ["xdsl_aie"] + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Install the project + run: uv sync --extra dev + + - name: Run all tests + run: uv run lit tests/filecheck -v From cb049a7ba0608538d7659e1a99df9f1e62baeec9 Mon Sep 17 00:00:00 2001 From: Joren Dumoulin Date: Tue, 17 Dec 2024 16:21:11 +0100 Subject: [PATCH 2/5] change order --- .github/workflows/ci-aie.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-aie.yml b/.github/workflows/ci-aie.yml index 619291d..e44d9dc 100644 --- a/.github/workflows/ci-aie.yml +++ b/.github/workflows/ci-aie.yml @@ -20,6 +20,19 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + packages: ["xdsl_aie"] + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Install the project + run: uv sync --extra dev + - name: Cache MLIR-AIE setup id: cache-binary uses: actions/cache@v4 @@ -41,18 +54,5 @@ jobs: run: | aie-opt --version - - name: Install uv - uses: astral-sh/setup-uv@v3 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" - packages: ["xdsl_aie"] - - - name: Set up Python ${{ matrix.python-version }} - run: uv python install ${{ matrix.python-version }} - - - name: Install the project - run: uv sync --extra dev - - name: Run all tests run: uv run lit tests/filecheck -v From 2b7622d44a029b03b89286fae6350121281c2246 Mon Sep 17 00:00:00 2001 From: Joren Dumoulin Date: Tue, 17 Dec 2024 16:22:01 +0100 Subject: [PATCH 3/5] change order again --- .github/workflows/ci-aie.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-aie.yml b/.github/workflows/ci-aie.yml index e44d9dc..69416cf 100644 --- a/.github/workflows/ci-aie.yml +++ b/.github/workflows/ci-aie.yml @@ -25,7 +25,6 @@ jobs: with: enable-cache: true cache-dependency-glob: "uv.lock" - packages: ["xdsl_aie"] - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} From 88f9ac3a4a966a1ea36d5f9f69062e0ae906def1 Mon Sep 17 00:00:00 2001 From: Joren Dumoulin Date: Tue, 17 Dec 2024 16:23:55 +0100 Subject: [PATCH 4/5] test: trip aie-opt --- tests/filecheck/dialects/aie.mlir | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/filecheck/dialects/aie.mlir b/tests/filecheck/dialects/aie.mlir index 4268f12..f9d7825 100644 --- a/tests/filecheck/dialects/aie.mlir +++ b/tests/filecheck/dialects/aie.mlir @@ -1,6 +1,6 @@ // RUN: XDSL_ROUNDTRIP // RUN: AIE_ROUNDTRIP -arith.constant 5 : i32 +"test.op"() : () -> () -// CHECK: arith.constant 5 : i32 +// CHECK: "test.op"() : () -> () From 94ecdde2c88e73d93420795ab06f3e984838e0b8 Mon Sep 17 00:00:00 2001 From: Joren Dumoulin Date: Tue, 17 Dec 2024 16:24:51 +0100 Subject: [PATCH 5/5] revert test --- tests/filecheck/dialects/aie.mlir | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/filecheck/dialects/aie.mlir b/tests/filecheck/dialects/aie.mlir index f9d7825..4268f12 100644 --- a/tests/filecheck/dialects/aie.mlir +++ b/tests/filecheck/dialects/aie.mlir @@ -1,6 +1,6 @@ // RUN: XDSL_ROUNDTRIP // RUN: AIE_ROUNDTRIP -"test.op"() : () -> () +arith.constant 5 : i32 -// CHECK: "test.op"() : () -> () +// CHECK: arith.constant 5 : i32