From 1d841c7bf6d3a8ce80fdfd89ec598b5658607965 Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Tue, 7 Jan 2025 07:48:04 -0800 Subject: [PATCH] Delegate IREE source fetching to shortfin/CMakeLists.txt. (#762) This simplification will help with https://github.com/nod-ai/shark-ai/issues/760. Pros: * Now there are fewer places that use a ref pin * Workflows are now simpler Cons: * ~~Workflows will be several seconds slower since FetchContent always fetches all submodules~~ * The `SHORTFIN_IREE_SOURCE_DIR` option is no longer tested --- .github/workflows/ci-libshortfin.yml | 19 ------------------- .../ci_linux_x64_asan-libshortfin.yml | 19 ------------------- .../ci_linux_x64_nogil-libshortfin.yml | 19 ------------------- shortfin/CMakeLists.txt | 1 + shortfin/requirements-iree-compiler.txt | 2 +- 5 files changed, 2 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci-libshortfin.yml b/.github/workflows/ci-libshortfin.yml index cd33176ec..6acde5717 100644 --- a/.github/workflows/ci-libshortfin.yml +++ b/.github/workflows/ci-libshortfin.yml @@ -25,7 +25,6 @@ concurrency: cancel-in-progress: true env: - IREE_REPO_DIR: ${{ github.workspace }}/iree LIBSHORTFIN_DIR: ${{ github.workspace }}/shortfin/ jobs: @@ -95,23 +94,6 @@ jobs: with: toolchain: stable - - name: Checkout IREE repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: iree-org/iree - path: ${{ env.IREE_REPO_DIR }} - submodules: false - ref: iree-3.1.0rc20241220 - - - name: Initalize IREE submodules - working-directory: ${{ env.IREE_REPO_DIR }} - run : | - git submodule update --init --depth 1 -- third_party/benchmark - git submodule update --init --depth 1 -- third_party/cpuinfo/ - git submodule update --init --depth 1 -- third_party/flatcc - git submodule update --init --depth 1 -- third_party/googletest - git submodule update --init --depth 1 -- third_party/hip-build-deps/ - - name: "Setup Python ${{ matrix.python-version }}" uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: @@ -134,7 +116,6 @@ jobs: cmake -GNinja \ -S. \ -Bbuild \ - -DSHORTFIN_IREE_SOURCE_DIR="${{ env.IREE_REPO_DIR }}" \ -DSHORTFIN_BUILD_PYTHON_BINDINGS=ON \ ${{matrix.cmake-options}} cmake --build build --target all diff --git a/.github/workflows/ci_linux_x64_asan-libshortfin.yml b/.github/workflows/ci_linux_x64_asan-libshortfin.yml index b3de1a593..597c1855a 100644 --- a/.github/workflows/ci_linux_x64_asan-libshortfin.yml +++ b/.github/workflows/ci_linux_x64_asan-libshortfin.yml @@ -36,7 +36,6 @@ env: PYTHON_VER: 3.12.7 CACHE_ASAN_VER: 2 CACHE_DEPS_VER: 1 - IREE_SOURCE_DIR: ${{ github.workspace }}/iree LIBSHORTFIN_DIR: ${{ github.workspace }}/shortfin/ jobs: @@ -100,23 +99,6 @@ jobs: sudo apt update sudo apt install clang lld cmake ninja-build - - name: Checkout IREE repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: iree-org/iree - path: ${{ env.IREE_SOURCE_DIR }} - submodules: false - ref: iree-3.1.0rc20241220 - - - name: Initalize IREE submodules - working-directory: ${{ env.IREE_SOURCE_DIR }} - run : | - git submodule update --init --depth 1 -- third_party/benchmark - git submodule update --init --depth 1 -- third_party/cpuinfo/ - git submodule update --init --depth 1 -- third_party/flatcc - git submodule update --init --depth 1 -- third_party/googletest - git submodule update --init --depth 1 -- third_party/hip-build-deps/ - - name: Restore Python dependencies cache id: cache-python-deps-restore uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -157,7 +139,6 @@ jobs: working-directory: ${{ env.LIBSHORTFIN_DIR }} run: | eval "$(pyenv init -)" - SHORTFIN_IREE_SOURCE_DIR="${{ env.IREE_SOURCE_DIR }}" \ SHORTFIN_ENABLE_ASAN=ON \ SHORTFIN_DEV_MODE=ON \ SHORTFIN_RUN_CTESTS=ON \ diff --git a/.github/workflows/ci_linux_x64_nogil-libshortfin.yml b/.github/workflows/ci_linux_x64_nogil-libshortfin.yml index d10408c6d..8a297540e 100644 --- a/.github/workflows/ci_linux_x64_nogil-libshortfin.yml +++ b/.github/workflows/ci_linux_x64_nogil-libshortfin.yml @@ -32,7 +32,6 @@ concurrency: cancel-in-progress: true env: - IREE_REPO_DIR: ${{ github.workspace }}/iree LIBSHORTFIN_DIR: ${{ github.workspace }}/shortfin/ jobs: @@ -48,23 +47,6 @@ jobs: sudo apt update sudo apt install clang lld cmake ninja-build - - name: Checkout IREE repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: iree-org/iree - path: ${{ env.IREE_REPO_DIR }} - submodules: false - ref: iree-3.1.0rc20241220 - - - name: Initalize IREE submodules - working-directory: ${{ env.IREE_REPO_DIR }} - run : | - git submodule update --init --depth 1 -- third_party/benchmark - git submodule update --init --depth 1 -- third_party/cpuinfo/ - git submodule update --init --depth 1 -- third_party/flatcc - git submodule update --init --depth 1 -- third_party/googletest - git submodule update --init --depth 1 -- third_party/hip-build-deps/ - - name: Setup Python uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0 with: @@ -87,7 +69,6 @@ jobs: -DCMAKE_CXX_COMPILER=clang++-18 \ -DCMAKE_LINKER_TYPE=LLD \ -DSHORTFIN_BUNDLE_DEPS=ON \ - -DSHORTFIN_IREE_SOURCE_DIR="${{ env.IREE_REPO_DIR }}" \ -DSHORTFIN_BUILD_PYTHON_BINDINGS=ON cmake --build build --target all pip install -v -e build/ diff --git a/shortfin/CMakeLists.txt b/shortfin/CMakeLists.txt index 4b3ff446a..57aa76e12 100644 --- a/shortfin/CMakeLists.txt +++ b/shortfin/CMakeLists.txt @@ -44,6 +44,7 @@ add_compile_options("$<$:/utf-8>") add_compile_options("$<$:/utf-8>") # Pins +# Keep in sync with requirements-iree-compiler.txt. set(SHORTFIN_IREE_GIT_TAG "iree-3.1.0rc20241220") # build options diff --git a/shortfin/requirements-iree-compiler.txt b/shortfin/requirements-iree-compiler.txt index f20a7db20..7b52a3470 100644 --- a/shortfin/requirements-iree-compiler.txt +++ b/shortfin/requirements-iree-compiler.txt @@ -1,4 +1,4 @@ -# Keep in sync with "ref: iree-" in .github/workflows/* and GIT_TAG in CMakeLists.txt +# Keep in sync with SHORTFIN_IREE_GIT_TAG in CMakeLists.txt -f https://iree.dev/pip-release-links.html iree-base-compiler==3.1.0rc20241204 iree-base-runtime==3.1.0rc20241204