From fc2c8ff113aeb9a3bc4ae67128172142926dad7c Mon Sep 17 00:00:00 2001 From: Robert Taylor <1611833+rainierwolfcastle@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:58:12 +0100 Subject: [PATCH 1/4] Speed up LLVM builds. --- .github/actions/build-wheel/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-wheel/action.yml b/.github/actions/build-wheel/action.yml index 1ea9cad..ce085ef 100644 --- a/.github/actions/build-wheel/action.yml +++ b/.github/actions/build-wheel/action.yml @@ -110,7 +110,8 @@ runs: -DLLVM_ENABLE_TERMINFO=OFF \ -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ -DPython3_EXECUTABLE=$(which python) - cmake --build . --target check-mlir + cmake --build . --target mlir-translate + cmake --build . --target tools/mlir/python_packages/mlir_core deactivate - name: Strip mlir-translate From ca4dc3f7fa796aa5e78818a9e1a3e49d549e3a7a Mon Sep 17 00:00:00 2001 From: Robert Taylor <1611833+rainierwolfcastle@users.noreply.github.com> Date: Mon, 15 Sep 2025 11:02:19 +0100 Subject: [PATCH 2/4] don't use the LLVM cache. --- .github/actions/build-wheel/action.yml | 35 +++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/actions/build-wheel/action.yml b/.github/actions/build-wheel/action.yml index ce085ef..6b98dce 100644 --- a/.github/actions/build-wheel/action.yml +++ b/.github/actions/build-wheel/action.yml @@ -66,14 +66,15 @@ runs: path: ai-ml-sdk-model-converter ref: ${{ inputs.model-converter-ref }} - - name: Restore LLVM build cache - id: cache-llvm-restore - uses: actions/cache/restore@v4 - with: - path: | - llvm-project/build/bin/mlir-translate - llvm-project/build/tools/mlir/python_packages/mlir_core - key: ${{ inputs.runner }}-${{ inputs.arch }}-python-${{ inputs.python-version }}-llvm-${{ inputs.llvm-ref }}-model-converter-${{ inputs.model-converter-ref }} + # - name: Restore LLVM build cache + # id: cache-llvm-restore + # uses: actions/cache/restore@v4 + # with: + # path: | + # llvm-project/build/bin/mlir-translate + # llvm-project/build/tools/mlir/python_packages/mlir_core + # key: ${{ inputs.runner }}-${{ inputs.arch }}-python-${{ inputs.python-version }}-llvm-${{ inputs.llvm-ref }}-model-converter-${{ inputs.model-converter-ref }} + - name: Checkout LLVM repo if: ${{ steps.cache-llvm-restore.outputs.cache-hit != 'true' }} uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -129,15 +130,15 @@ runs: python scripts/replace_symlinks_in_llvm_python_package.py $GITHUB_WORKSPACE/llvm-project/build/tools/mlir/python_packages/mlir_core/mlir --yes rm $GITHUB_WORKSPACE/llvm-project/build/tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/libMLIRPythonCAPI.so - - name: Save LLVM build cache - if: ${{ steps.cache-llvm-restore.outputs.cache-hit != 'true' }} - id: cache-llvm-save - uses: actions/cache/save@v4 - with: - path: | - llvm-project/build/bin/mlir-translate - llvm-project/build/tools/mlir/python_packages/mlir_core - key: ${{ steps.cache-llvm-restore.outputs.cache-primary-key }} + # - name: Save LLVM build cache + # if: ${{ steps.cache-llvm-restore.outputs.cache-hit != 'true' }} + # id: cache-llvm-save + # uses: actions/cache/save@v4 + # with: + # path: | + # llvm-project/build/bin/mlir-translate + # llvm-project/build/tools/mlir/python_packages/mlir_core + # key: ${{ steps.cache-llvm-restore.outputs.cache-primary-key }} - name: Add mlir-translate to PATH shell: bash From d4c26e2c342bf6bae6f5db40da6d0b4232c8d703 Mon Sep 17 00:00:00 2001 From: Robert Taylor <1611833+rainierwolfcastle@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:56:23 +0100 Subject: [PATCH 3/4] Update action.yml --- .github/actions/build-wheel/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/build-wheel/action.yml b/.github/actions/build-wheel/action.yml index 6b98dce..e3c4945 100644 --- a/.github/actions/build-wheel/action.yml +++ b/.github/actions/build-wheel/action.yml @@ -111,8 +111,7 @@ runs: -DLLVM_ENABLE_TERMINFO=OFF \ -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ -DPython3_EXECUTABLE=$(which python) - cmake --build . --target mlir-translate - cmake --build . --target tools/mlir/python_packages/mlir_core + cmake --build . --target mlir-translate --target MLIRPythonModules --parallel $(nproc) deactivate - name: Strip mlir-translate From 3164a2849a9b7e736aeb7b34b8a2462beb2431d7 Mon Sep 17 00:00:00 2001 From: Robert Taylor <1611833+rainierwolfcastle@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:57:06 +0100 Subject: [PATCH 4/4] Update ci.yml --- .github/workflows/ci.yml | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f56a553..2e352a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10"] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -43,30 +43,30 @@ jobs: me-repo-access-app-id: ${{ env.ME_REPO_ACCESS_APP_ID }} me-repo-access-private-key: ${{ env.ME_REPO_ACCESS_PRIVATE_KEY }} - build-arm64: - if: ${{ !github.event.repository.private }} - name: Build (arm64) - strategy: - fail-fast: false - matrix: - python-version: ["3.10", "3.11", "3.12"] - runs-on: ubuntu-22.04-arm - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: ./.github/actions/build-wheel - with: - runner: ubuntu-22.04-arm - python-version: ${{ matrix.python-version }} - platform: manylinux_2_35_aarch64 - arch: arm64 - llvm-ref: ${{ env.LLVM_REF }} - flatbuffers-ref: ${{ env.FLATBUFFERS_REF }} - argparse-ref: ${{ env.ARGPARSE_REF }} - json-ref: ${{ env.JSON_REF }} - vgf-lib-ref: ${{ env.VGF_LIB_REF }} - model-converter-ref: ${{ env.MODEL_CONVERTER_REF }} - me-repo-access-app-id: ${{ env.ME_REPO_ACCESS_APP_ID }} - me-repo-access-private-key: ${{ env.ME_REPO_ACCESS_PRIVATE_KEY }} + # build-arm64: + # if: ${{ !github.event.repository.private }} + # name: Build (arm64) + # strategy: + # fail-fast: false + # matrix: + # python-version: ["3.10", "3.11", "3.12"] + # runs-on: ubuntu-22.04-arm + # steps: + # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + # - uses: ./.github/actions/build-wheel + # with: + # runner: ubuntu-22.04-arm + # python-version: ${{ matrix.python-version }} + # platform: manylinux_2_35_aarch64 + # arch: arm64 + # llvm-ref: ${{ env.LLVM_REF }} + # flatbuffers-ref: ${{ env.FLATBUFFERS_REF }} + # argparse-ref: ${{ env.ARGPARSE_REF }} + # json-ref: ${{ env.JSON_REF }} + # vgf-lib-ref: ${{ env.VGF_LIB_REF }} + # model-converter-ref: ${{ env.MODEL_CONVERTER_REF }} + # me-repo-access-app-id: ${{ env.ME_REPO_ACCESS_APP_ID }} + # me-repo-access-private-key: ${{ env.ME_REPO_ACCESS_PRIVATE_KEY }} release: name: Release