From ddca7ad1d06da4b02825c545ea527f6658ccb108 Mon Sep 17 00:00:00 2001 From: max Date: Sat, 24 Aug 2024 21:07:06 -0500 Subject: [PATCH 01/12] [wip] macos --- .github/workflows/ci-macos.yml | 93 +++++++++++++++++++ build_tools/ci/build_test_cpp.sh | 15 ++- .../target/AMD-AIE/aievec/CMakeLists.txt | 1 + .../plugins/target/AMD-AIE/air/CMakeLists.txt | 1 + iree_compiler_plugin.cmake | 2 +- .../aie_runtime/iree_aie_configure.cc | 16 ++-- .../aie_runtime/test/interpreter_op_impl.h | 6 +- 7 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 000000000..f34ece2f4 --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,93 @@ +name: CI MacOS + +on: + workflow_call: + workflow_dispatch: + pull_request: + merge_group: + push: + branches: + - main + +concurrency: + # A PR number if a pull request and otherwise the commit hash. This cancels + # queued and in-progress runs for the same PR (presubmit) or commit + # (postsubmit). + group: ci-build-test-cpp-macos-${{ github.event.number || github.sha }} + cancel-in-progress: true + +jobs: + build_and_ctest: + name: Build and Test (${{ matrix.runs-on }}, ASSERTIONS) + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + runs-on: [macos-12, macos-14] + env: + CACHE_DIR: ${{ github.workspace }}/.container-cache + steps: + - name: Set unified TZ + uses: szenius/set-timezone@v2.0 + with: + # this is an arbitrary choice + timezoneLinux: "Asia/Singapore" + timezoneMacos: "Asia/Singapore" + timezoneWindows: "Singapore Standard Time" + + - name: "Checking out repository" + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 + with: + submodules: recursive + + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install deps + run: | + brew install ccache ninja + + - name: Sync source deps + run: | + python ./sync_deps.py + + - name: Python deps + run: | + pip install "numpy<2" pyyaml "pybind11[global]==2.10.3" nanobind + + - name: Enable cache + uses: actions/cache/restore@v3 + with: + path: ${{ env.CACHE_DIR }} + # without datetime stamps you'll get collisions for the cache warming runs + # ("Failed to save: Unable to reserve cache with key ..., another job may be creating this cache.") + key: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ github.sha }}-${{ github.event.repository.updated_at }} + restore-keys: ${{ matrix.runs-on }}-build-test-cpp- + + - name: Build packages + run: | + export cache_dir="${{ env.CACHE_DIR }}" + bash build_tools/ci/build_test_cpp.sh + + - name: Create artifacts + if: ${{ !cancelled() }} + run: | + rm -f iree-install/bin/clang* + rm -f iree-install/bin/llvm-link* + tar cf iree-dist-${{ matrix.runs-on }}.tar -C iree-install . -C ../iree-build tools/testing/e2e/iree-e2e-matmul-test.exe + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: ${{ matrix.runs-on }}_release_packages + path: iree-dist-${{ matrix.runs-on }}.tar + if-no-files-found: warn + + - name: Save cache + uses: actions/cache/save@v3 + if: ${{ !cancelled() }} + with: + path: ${{ env.CACHE_DIR }} + key: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ github.sha }}-${{ github.event.repository.updated_at }} diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index ad6b4e460..a52676c2f 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -56,10 +56,12 @@ echo '{ }' > $iree_dir/CMakeUserPresets.json cd $iree_dir -cmake -S "$iree_dir" -B "$build_dir" \ +CMAKE_ARGS="\ + -S $iree_dir \ + -B $build_dir \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="$install_dir" \ + -DCMAKE_INSTALL_PREFIX=$install_dir \ -DCMAKE_INSTALL_LIBDIR=lib \ -DIREE_ENABLE_ASSERTIONS=ON \ -DIREE_BUILD_SAMPLES=OFF \ @@ -74,8 +76,13 @@ cmake -S "$iree_dir" -B "$build_dir" \ -DIREE_INPUT_STABLEHLO=OFF \ -DIREE_INPUT_TORCH=OFF \ -DCMAKE_OBJECT_PATH_MAX=4096 \ - -DIREE_CMAKE_PLUGIN_PATHS=../iree-amd-aie \ - -DIREE_EXTERNAL_HAL_DRIVERS=xrt + -DIREE_CMAKE_PLUGIN_PATHS=$PWD/../iree-amd-aie" + +if [[ "$OSTYPE" != "darwin"* ]]; then + CMAKE_ARGS="$CMAKE_ARGS -DIREE_EXTERNAL_HAL_DRIVERS=xrt" +fi + +cmake $CMAKE_ARGS echo "Building all" echo "------------" diff --git a/compiler/plugins/target/AMD-AIE/aievec/CMakeLists.txt b/compiler/plugins/target/AMD-AIE/aievec/CMakeLists.txt index 1b0b7ae6d..281252094 100644 --- a/compiler/plugins/target/AMD-AIE/aievec/CMakeLists.txt +++ b/compiler/plugins/target/AMD-AIE/aievec/CMakeLists.txt @@ -66,6 +66,7 @@ iree_cc_library( ::AIEVecOpsGen ::AIEVecDialectGen ::AIEVecAttrsGen + ::AIEVecXLLVMOpsGen MLIRIR ) diff --git a/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt b/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt index 8d8799d49..764dc66cd 100644 --- a/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt +++ b/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt @@ -164,6 +164,7 @@ iree_cc_library( MLIRTransforms ) +include(iree_aie_utils) replace_string_in_file( ${IREE_MLIR_AIR_SOURCE_DIR}/include/air/Conversion/PassDetail.h "aie/Dialect/AIEX/IR" "aie") diff --git a/iree_compiler_plugin.cmake b/iree_compiler_plugin.cmake index a14b0c094..944829580 100644 --- a/iree_compiler_plugin.cmake +++ b/iree_compiler_plugin.cmake @@ -18,8 +18,8 @@ endif() if(IREE_AMD_AIE_ENABLE_XRT_DRIVER) include(iree_aie_xrt) - include(iree_aie_bootgen) endif() +include(iree_aie_bootgen) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/compiler/plugins/target/AMD-AIE target/AMD-AIE) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tests/samples AMD-AIE/tests/samples) diff --git a/runtime/src/iree-amd-aie/aie_runtime/iree_aie_configure.cc b/runtime/src/iree-amd-aie/aie_runtime/iree_aie_configure.cc index 4aba9c188..44773bfdf 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/iree_aie_configure.cc +++ b/runtime/src/iree-amd-aie/aie_runtime/iree_aie_configure.cc @@ -64,12 +64,12 @@ LogicalResult configureDMABD( if (deviceModel.isShimNOCTile(tileLoc.col, tileLoc.row)) { // TODO(max): revisit these values // write them out like this so they show up with names in debug prints - size_t smid = 0; - size_t burstLen = 16; // (10):BLEN=16 (256Byte) (corresponds to - // 0x800000000 from target) - size_t qOs = 0; - size_t cache = 0; - size_t secure = 0; + uint8_t smid = 0; + uint8_t burstLen = 16; // (10):BLEN=16 (256Byte) (corresponds to + // 0x800000000 from target) + uint8_t qOs = 0; + uint8_t cache = 0; + uint8_t secure = 0; TRY_XAIE_API_LOGICAL_RESULT(XAie_DmaSetAxi, &dmaDesc, smid, burstLen, qOs, cache, secure); } @@ -347,8 +347,8 @@ LogicalResult coreEnable(const AMDAIEDeviceModel &deviceModel, return success(); } -void dmaUpdateBdAddr(const AMDAIEDeviceModel &deviceModel, int col, int row, - size_t addr, size_t bdId) { +void dmaUpdateBdAddr(const AMDAIEDeviceModel &deviceModel, uint8_t col, + uint8_t row, uint8_t addr, uint8_t bdId) { auto tileLoc = XAie_TileLoc(col, row); auto devInst = const_cast(&deviceModel.devInst); TRY_XAIE_API_FATAL_ERROR(XAie_DmaUpdateBdAddr, devInst, tileLoc, addr, bdId); diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h index c1f36de6e..de71a53c3 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h +++ b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h @@ -51,7 +51,7 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, u32 size = (bw_header->Size - sizeof(*bw_header)) / 4; for (uint32_t ii = 0; ii < size; ii++) { uint64_t addr = bw_header->RegOff + DevInst.BaseAddr + ii * 4U; - printf(" 0x%lx, 0x%x\n", addr, payload[ii]); + printf(" 0x%llx, 0x%x\n", addr, payload[ii]); } ptr += bw_header->Size; break; @@ -91,8 +91,8 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, case AMDAIE::XAie_TxnOpcode::XAIE_IO_CUSTOM_OP_DDR_PATCH: { XAie_CustomOpHdr *hdr = (XAie_CustomOpHdr *)ptr; patch_op_t *op = (patch_op_t *)(ptr + sizeof(*hdr)); - printf("CustomOp PatchBD argidx %lu\n", op->argidx); - printf("CustomOp PatchBD regaddr %lx\n", + printf("CustomOp PatchBD argidx %llu\n", op->argidx); + printf("CustomOp PatchBD regaddr %llx\n", op->regaddr + DevInst.BaseAddr); ptr += hdr->Size; break; From 455b790b31cd07be95d5b648d8ffc64bbbbc79eb Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 21:24:20 -0500 Subject: [PATCH 02/12] Update interpreter_op_impl.h --- .../src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h index de71a53c3..ac1828473 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h +++ b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h @@ -51,7 +51,7 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, u32 size = (bw_header->Size - sizeof(*bw_header)) / 4; for (uint32_t ii = 0; ii < size; ii++) { uint64_t addr = bw_header->RegOff + DevInst.BaseAddr + ii * 4U; - printf(" 0x%llx, 0x%x\n", addr, payload[ii]); + printf(" 0x%x, 0x%x\n", addr, payload[ii]); } ptr += bw_header->Size; break; @@ -91,8 +91,8 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, case AMDAIE::XAie_TxnOpcode::XAIE_IO_CUSTOM_OP_DDR_PATCH: { XAie_CustomOpHdr *hdr = (XAie_CustomOpHdr *)ptr; patch_op_t *op = (patch_op_t *)(ptr + sizeof(*hdr)); - printf("CustomOp PatchBD argidx %llu\n", op->argidx); - printf("CustomOp PatchBD regaddr %llx\n", + printf("CustomOp PatchBD argidx %d\n", op->argidx); + printf("CustomOp PatchBD regaddr %x\n", op->regaddr + DevInst.BaseAddr); ptr += hdr->Size; break; From 909d3f36363cd855aaa5e96f4fef24391a87f91f Mon Sep 17 00:00:00 2001 From: max Date: Sun, 25 Aug 2024 21:46:35 -0500 Subject: [PATCH 03/12] Revert "Update interpreter_op_impl.h" This reverts commit f88cbacd3b1051f3ee0cbe03c88af6c882b3194d. --- .../src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h index ac1828473..de71a53c3 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h +++ b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h @@ -51,7 +51,7 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, u32 size = (bw_header->Size - sizeof(*bw_header)) / 4; for (uint32_t ii = 0; ii < size; ii++) { uint64_t addr = bw_header->RegOff + DevInst.BaseAddr + ii * 4U; - printf(" 0x%x, 0x%x\n", addr, payload[ii]); + printf(" 0x%llx, 0x%x\n", addr, payload[ii]); } ptr += bw_header->Size; break; @@ -91,8 +91,8 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, case AMDAIE::XAie_TxnOpcode::XAIE_IO_CUSTOM_OP_DDR_PATCH: { XAie_CustomOpHdr *hdr = (XAie_CustomOpHdr *)ptr; patch_op_t *op = (patch_op_t *)(ptr + sizeof(*hdr)); - printf("CustomOp PatchBD argidx %d\n", op->argidx); - printf("CustomOp PatchBD regaddr %x\n", + printf("CustomOp PatchBD argidx %llu\n", op->argidx); + printf("CustomOp PatchBD regaddr %llx\n", op->regaddr + DevInst.BaseAddr); ptr += hdr->Size; break; From a1f587b8a369e8ab374da4f67eae5b5fb0f53b09 Mon Sep 17 00:00:00 2001 From: max Date: Sun, 25 Aug 2024 21:51:05 -0500 Subject: [PATCH 04/12] -Wno-format --- build_tools/ci/build_test_cpp.sh | 2 ++ .../iree-amd-aie/aie_runtime/test/CMakeLists.txt | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index a52676c2f..33d806922 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -97,6 +97,8 @@ echo "CTest" echo "-----" if [[ "$OSTYPE" == "linux-gnu"* ]]; then ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j +elif [[ "$OSTYPE" == "darwin"* ]]; then + ctest --test-dir "$build_dir" -R amd-aie --label-exclude "*pack_peel_pipeline_matmul*" --output-on-failure -j else # hack while windows is flaky to get past failing tests ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j --repeat until-pass:5 diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt index eb0d8ae90..da72707fd 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt +++ b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt @@ -35,7 +35,9 @@ iree_cc_test( NAME test_0335_aie_dma_tile_dma_packet_switch_mode SRCS - test_packet_switch_mode.cc + test_packet_switch_mode.cc + COPTS + -Wno-format DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -44,7 +46,7 @@ iree_lit_test( NAME test_0335_aie_dma_tile_dma_packet_switch_mode_lit_test TEST_FILE - test_packet_switch_mode.cc + test_packet_switch_mode.cc TOOLS ::test_0335_aie_dma_tile_dma_packet_switch_mode FileCheck @@ -56,7 +58,9 @@ iree_cc_test( NAME test_1114_aie_stream_switch_packet_switch_control_packets SRCS - test_control_packets.cc + test_control_packets.cc + COPTS + -Wno-format DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -65,7 +69,7 @@ iree_lit_test( NAME test_1114_aie_stream_switch_packet_switch_control_packets_lit_test TEST_FILE - test_control_packets.cc + test_control_packets.cc TOOLS ::test_1114_aie_stream_switch_packet_switch_control_packets FileCheck @@ -78,6 +82,8 @@ iree_cc_test( test_transaction SRCS test_transaction.cc + COPTS + -Wno-format DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) From 22738281299871040f768ff2afb09ef1b435b191 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 22:42:21 -0500 Subject: [PATCH 05/12] Update CMakeLists.txt --- runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt index da72707fd..51c03604a 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt +++ b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt @@ -36,8 +36,8 @@ iree_cc_test( test_0335_aie_dma_tile_dma_packet_switch_mode SRCS test_packet_switch_mode.cc - COPTS - -Wno-format + COPTS + $<$:-Wno-format> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -60,7 +60,7 @@ iree_cc_test( SRCS test_control_packets.cc COPTS - -Wno-format + $<$:-Wno-format> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -83,7 +83,7 @@ iree_cc_test( SRCS test_transaction.cc COPTS - -Wno-format + $<$:-Wno-format> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) From 77b75df155bdab5036fb71bb9e29d5e92f623f9c Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 22:47:45 -0500 Subject: [PATCH 06/12] Update CMakeLists.txt --- runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt index 51c03604a..efdf01920 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt +++ b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt @@ -38,6 +38,7 @@ iree_cc_test( test_packet_switch_mode.cc COPTS $<$:-Wno-format> + $<$:-Wno-format> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -61,6 +62,7 @@ iree_cc_test( test_control_packets.cc COPTS $<$:-Wno-format> + $<$:-Wno-format> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -84,6 +86,7 @@ iree_cc_test( test_transaction.cc COPTS $<$:-Wno-format> + $<$:-Wno-format> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) From fd42f4834062046a614a076a83e4cd9e89861479 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 22:48:40 -0500 Subject: [PATCH 07/12] Update interpreter_op_impl.h --- .../src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h index de71a53c3..c1f36de6e 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h +++ b/runtime/src/iree-amd-aie/aie_runtime/test/interpreter_op_impl.h @@ -51,7 +51,7 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, u32 size = (bw_header->Size - sizeof(*bw_header)) / 4; for (uint32_t ii = 0; ii < size; ii++) { uint64_t addr = bw_header->RegOff + DevInst.BaseAddr + ii * 4U; - printf(" 0x%llx, 0x%x\n", addr, payload[ii]); + printf(" 0x%lx, 0x%x\n", addr, payload[ii]); } ptr += bw_header->Size; break; @@ -91,8 +91,8 @@ inline void SubmitSerializedTransaction(XAie_DevInst &DevInst, case AMDAIE::XAie_TxnOpcode::XAIE_IO_CUSTOM_OP_DDR_PATCH: { XAie_CustomOpHdr *hdr = (XAie_CustomOpHdr *)ptr; patch_op_t *op = (patch_op_t *)(ptr + sizeof(*hdr)); - printf("CustomOp PatchBD argidx %llu\n", op->argidx); - printf("CustomOp PatchBD regaddr %llx\n", + printf("CustomOp PatchBD argidx %lu\n", op->argidx); + printf("CustomOp PatchBD regaddr %lx\n", op->regaddr + DevInst.BaseAddr); ptr += hdr->Size; break; From 8c015e3d2a9c3c8ec8929ccb2d68677a14195345 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 22:59:27 -0500 Subject: [PATCH 08/12] Update build_test_cpp.sh --- build_tools/ci/build_test_cpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index 33d806922..feccfd220 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -98,7 +98,7 @@ echo "-----" if [[ "$OSTYPE" == "linux-gnu"* ]]; then ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j elif [[ "$OSTYPE" == "darwin"* ]]; then - ctest --test-dir "$build_dir" -R amd-aie --label-exclude "*pack_peel_pipeline_matmul*" --output-on-failure -j + ctest --test-dir "$build_dir" -R amd-aie --label-exclude "pack_peel_pipeline_matmul" --output-on-failure -j else # hack while windows is flaky to get past failing tests ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j --repeat until-pass:5 From dec470fbfd202533f54673e303513d9f95e26a00 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 23:01:20 -0500 Subject: [PATCH 09/12] Update CMakeLists.txt --- runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt index efdf01920..c839e5c3f 100644 --- a/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt +++ b/runtime/src/iree-amd-aie/aie_runtime/test/CMakeLists.txt @@ -39,6 +39,7 @@ iree_cc_test( COPTS $<$:-Wno-format> $<$:-Wno-format> + $<$:/wd4777> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -63,6 +64,7 @@ iree_cc_test( COPTS $<$:-Wno-format> $<$:-Wno-format> + $<$:/wd4777> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) @@ -86,7 +88,8 @@ iree_cc_test( test_transaction.cc COPTS $<$:-Wno-format> - $<$:-Wno-format> + $<$:-Wno-format> + $<$:/wd4777> DEPS iree-amd-aie::aie_runtime::iree_aie_runtime_static ) From a3c96da10d9c5d35d2b3ac757558ed74dae9fd6e Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 23:15:27 -0500 Subject: [PATCH 10/12] Update build_test_cpp.sh --- build_tools/ci/build_test_cpp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index feccfd220..dd3851845 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -98,7 +98,7 @@ echo "-----" if [[ "$OSTYPE" == "linux-gnu"* ]]; then ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j elif [[ "$OSTYPE" == "darwin"* ]]; then - ctest --test-dir "$build_dir" -R amd-aie --label-exclude "pack_peel_pipeline_matmul" --output-on-failure -j + ctest --test-dir "$build_dir" -R amd-aie -E "pack_peel_pipeline_matmul" --output-on-failure -j else # hack while windows is flaky to get past failing tests ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j --repeat until-pass:5 From b0c84bd2146d1e10ca510118c441ae76cbebd103 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sun, 25 Aug 2024 23:26:34 -0500 Subject: [PATCH 11/12] Update ci-macos.yml --- .github/workflows/ci-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index f34ece2f4..eda8ee471 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -75,7 +75,7 @@ jobs: run: | rm -f iree-install/bin/clang* rm -f iree-install/bin/llvm-link* - tar cf iree-dist-${{ matrix.runs-on }}.tar -C iree-install . -C ../iree-build tools/testing/e2e/iree-e2e-matmul-test.exe + tar cf iree-dist-${{ matrix.runs-on }}.tar -C iree-install . -C ../iree-build tools/testing/e2e/iree-e2e-matmul-test - name: Upload artifacts uses: actions/upload-artifact@v4 From 33d8381e3fc6e66d1d983ef44b44664a67c63e68 Mon Sep 17 00:00:00 2001 From: makslevental Date: Mon, 26 Aug 2024 11:13:31 -0500 Subject: [PATCH 12/12] reorder air tablegen --- build_tools/ci/build_test_cpp.sh | 2 +- .../plugins/target/AMD-AIE/air/CMakeLists.txt | 61 ++++++++++--------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index dd3851845..53d190f0f 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -98,7 +98,7 @@ echo "-----" if [[ "$OSTYPE" == "linux-gnu"* ]]; then ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j elif [[ "$OSTYPE" == "darwin"* ]]; then - ctest --test-dir "$build_dir" -R amd-aie -E "pack_peel_pipeline_matmul" --output-on-failure -j + ctest --test-dir "$build_dir" -R amd-aie -E "pack_peel_pipeline_matmul|conv_fill_spec_pad" --output-on-failure -j --repeat until-pass:5 else # hack while windows is flaky to get past failing tests ctest --test-dir "$build_dir" -R amd-aie --output-on-failure -j --repeat until-pass:5 diff --git a/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt b/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt index 764dc66cd..dc1fbe635 100644 --- a/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt +++ b/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt @@ -21,19 +21,6 @@ iree_cc_library( # AIR Dialect ############################################################################### -iree_cc_library( - NAME - AIRDialectIR - SRCS - ${IREE_MLIR_AIR_SOURCE_DIR}/lib/Dialect/AIR/IR/AIRDialect.cpp - DEPS - ::defs - ::AIRDialectGen - ::AIRInterfaceGen - ::AIRTransformOpsGen - MLIRIR -) - iree_tablegen_library( NAME AIRDialectGen @@ -60,6 +47,26 @@ iree_tablegen_library( -gen-op-interface-defs Dialect/AIR/AIROpInterfaces.cpp.inc ) + +iree_tablegen_library( + NAME + AIRConversionPassesIncGen + TD_FILE + "${IREE_MLIR_AIR_SOURCE_DIR}/include/air/Conversion/Passes.td" + OUTS + -gen-pass-decls Conversion/Passes.h.inc +) + +iree_tablegen_library( + NAME + AIRTransformOpsGen + TD_FILE + "${IREE_MLIR_AIR_SOURCE_DIR}/include/air/Dialect/AIR/AIRTransformOps.td" + OUTS + -gen-op-decls Dialect/AIR/AIRTransformOps.h.inc + -gen-op-defs Dialect/AIR/AIRTransformOps.cpp.inc +) + iree_cc_library( NAME AIRTransformOps @@ -70,19 +77,24 @@ iree_cc_library( ::AIRDialectIR ::AIRTransformOpsGen ::AIRTransformPasses + ::AIRConversionPassesIncGen iree::target::amd-aie::aie::AIEDialectIR MLIRIR MLIRLinalgTransformOps ) -iree_tablegen_library( +iree_cc_library( NAME - AIRTransformOpsGen - TD_FILE - "${IREE_MLIR_AIR_SOURCE_DIR}/include/air/Dialect/AIR/AIRTransformOps.td" - OUTS - -gen-op-decls Dialect/AIR/AIRTransformOps.h.inc - -gen-op-defs Dialect/AIR/AIRTransformOps.cpp.inc + AIRDialectIR + SRCS + ${IREE_MLIR_AIR_SOURCE_DIR}/lib/Dialect/AIR/IR/AIRDialect.cpp + DEPS + ::defs + ::AIRDialectGen + ::AIRInterfaceGen + ::AIRTransformOpsGen + ::AIRConversionPassesIncGen + MLIRIR ) ############################################################################### @@ -121,15 +133,6 @@ iree_tablegen_library( # AIR Conversion Passes ############################################################################### -iree_tablegen_library( - NAME - AIRConversionPassesIncGen - TD_FILE - "${IREE_MLIR_AIR_SOURCE_DIR}/include/air/Conversion/Passes.td" - OUTS - -gen-pass-decls Conversion/Passes.h.inc -) - iree_cc_library( NAME AIRConversionPassHeaders