diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 0000000000..9231c12d70 --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,91 @@ +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 (macos, ASSERTIONS) + runs-on: macos-12 + strategy: + fail-fast: true + 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: macos-12-build-test-cpp-asserts-v1-${{ github.sha }}-${{ github.event.repository.updated_at }} + restore-keys: macos-12-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-macos-x86.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: macos_x86_64_release_packages + path: iree-dist-macos-x86.tar + if-no-files-found: warn + + - name: Save cache + uses: actions/cache/save@v3 + if: ${{ !cancelled() }} + with: + path: ${{ env.CACHE_DIR }} + key: macos-12-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 ad6b4e460c..33452ddda2 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -28,7 +28,7 @@ echo "Using python: $python" # note: on windows (git-bash) result is "msys" # well only if you have apparently the right version of git-bash installed # https://stackoverflow.com/a/72164385 -if [[ "$OSTYPE" == "linux-gnu"* ]]; then +if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "darwin"* ]]; then export CMAKE_TOOLCHAIN_FILE="$this_dir/linux_default_toolchain.cmake" export CC=clang export CXX=clang++ diff --git a/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt b/compiler/plugins/target/AMD-AIE/air/CMakeLists.txt index 8d8799d494..764dc66cdc 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 a14b0c0942..9448295803 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 4aba9c1887..44773bfdf9 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);