From 3466378a093175ef0246783d2e54c01ee63c1992 Mon Sep 17 00:00:00 2001 From: max Date: Wed, 13 Dec 2023 23:13:15 -0600 Subject: [PATCH] mlir-aie-no-rtti --- .github/workflows/mlirAIEDistro.yml | 105 ++++++++++++++++++++++++---- .github/workflows/mlirDistro.yml | 1 + docs/Dev.md | 4 +- 3 files changed, 97 insertions(+), 13 deletions(-) diff --git a/.github/workflows/mlirAIEDistro.yml b/.github/workflows/mlirAIEDistro.yml index 971d0818a3..fccc45f33e 100644 --- a/.github/workflows/mlirAIEDistro.yml +++ b/.github/workflows/mlirAIEDistro.yml @@ -94,7 +94,6 @@ jobs: ARCH: AMD64 ENABLE_RTTI: ON -# Can't figure it out but cmake segfault when building on mac on the runners - OS: macos-11 ARCH: x86_64 ENABLE_RTTI: ON @@ -107,6 +106,26 @@ jobs: ARCH: aarch64 ENABLE_RTTI: ON + - OS: ubuntu-20.04 + ARCH: x86_64 + ENABLE_RTTI: OFF + + - OS: windows-2019 + ARCH: AMD64 + ENABLE_RTTI: OFF + + - OS: macos-11 + ARCH: x86_64 + ENABLE_RTTI: OFF + + - OS: macos-11 + ARCH: arm64 + ENABLE_RTTI: OFF + + - OS: ubuntu-20.04 + ARCH: aarch64 + ENABLE_RTTI: OFF + steps: - name: Checkout actions @@ -174,6 +193,7 @@ jobs: export PIP_NO_BUILD_ISOLATION=false + ENABLE_RTTI=${{ matrix.ENABLE_RTTI }} \ CIBW_ARCHS=${{ matrix.ARCH }} \ CMAKE_GENERATOR=Ninja \ DATETIME=${{ needs.get_aie_project_commit.outputs.DATETIME }} \ @@ -196,6 +216,7 @@ jobs: pip install importlib-metadata CIBW_ARCHS=${{ matrix.ARCH }} MATRIX_OS=${{ matrix.OS }} ./scripts/download_mlir.sh + ENABLE_RTTI=${{ matrix.ENABLE_RTTI }} \ CIBW_ARCHS=${{ matrix.ARCH }} \ CMAKE_GENERATOR=Ninja \ DATETIME=${{ needs.get_aie_project_commit.outputs.DATETIME }} \ @@ -216,6 +237,7 @@ jobs: if: contains(inputs.MATRIX_OS, 'ubuntu') shell: bash run: | + docker system prune -a -f - name: Get wheel version @@ -254,7 +276,7 @@ jobs: # Set the timestamp to the beginning of the current hour. find $HOST_CCACHE_DIR -exec touch -a -m -t 201108231405.14 {} \; - # The wheels important parts of the wheels (all the LLVM/MLIR archives) have nothing to do with the + # The important parts of the wheels (all the LLVM/MLIR archives) have nothing to do with the # python version. With py3-none you can pip install them in any python venv. Unfortunately though this does # mean that the python bindings themselves will confusingly not work in other envs (!=3.10) - name: rename non-windows @@ -277,7 +299,7 @@ jobs: - name: build python bindings shell: bash - if: ${{ matrix.OS != 'ubuntu-20.04' || matrix.ARCH != 'aarch64' }} + if: (matrix.OS != 'ubuntu-20.04' || matrix.ARCH != 'aarch64') && matrix.ENABLE_RTTI == 'ON' working-directory: ${{ steps.workspace_root.outputs.WORKSPACE_ROOT }} run: | @@ -305,7 +327,7 @@ jobs: uses: actions/upload-artifact@v3 with: path: ${{ steps.workspace_root.outputs.WORKSPACE_ROOT }}/wheelhouse/*.whl - name: build_artifact + name: build_artifact_${{ matrix.OS }}_${{ matrix.ARCH }}_rtti_${{ matrix.ENABLE_RTTI }} build_linux_aarch64_pybindings_wheels: @@ -334,7 +356,6 @@ jobs: ARCH: aarch64 PY_VERSION: "cp312" - steps: - name: Checkout actions @@ -374,7 +395,7 @@ jobs: with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir - name: build_artifact + name: build_artifact_ubuntu-20.04_aarch64_rtti_ON path: ${{ steps.workspace_root.outputs.WORKSPACE_ROOT }}/wheelhouse - name: Set up QEMU @@ -419,9 +440,9 @@ jobs: smoke_test_wheels: - name: Smoke test on ${{ matrix.OS }} ${{ matrix.ARCH }} + name: test ${{ matrix.OS }} ${{ matrix.ARCH }} rtti=${{ matrix.ENABLE_RTTI }} - needs: [build_distro_wheels, build_linux_aarch64_pybindings_wheels] + needs: build_distro_wheels runs-on: ${{ matrix.OS }} strategy: @@ -430,12 +451,27 @@ jobs: include: - OS: ubuntu-20.04 ARCH: x86_64 + ENABLE_RTTI: ON + + - OS: windows-2019 + ARCH: AMD64 + ENABLE_RTTI: ON + + - OS: macos-11 + ARCH: x86_64 + ENABLE_RTTI: ON + + - OS: ubuntu-20.04 + ARCH: x86_64 + ENABLE_RTTI: OFF - OS: windows-2019 ARCH: AMD64 + ENABLE_RTTI: OFF - OS: macos-11 ARCH: x86_64 + ENABLE_RTTI: OFF steps: - name: Checkout reqs @@ -445,7 +481,7 @@ jobs: - uses: actions/download-artifact@v3 with: - name: build_artifact + name: build_artifact_${{ matrix.OS }}_${{ matrix.ARCH }}_rtti_${{ matrix.ENABLE_RTTI }} path: dist - uses: actions/setup-python@v4 @@ -456,8 +492,9 @@ jobs: shell: bash run: | pip install -r python/requirements.txt - pip install aie -f dist --no-index - python -c 'import aie.dialects.aie' + unzip -o -q dist/mlir_aie\*.whl + + PYTHONPATH=$(find . -name python) python -c 'import aie.ir' upload_wheels: @@ -471,12 +508,56 @@ jobs: id-token: write contents: write + strategy: + fail-fast: false + matrix: + include: + - OS: ubuntu-20.04 + ARCH: x86_64 + ENABLE_RTTI: ON + + - OS: ubuntu-20.04 + ARCH: aarch64 + ENABLE_RTTI: ON + + - OS: windows-2019 + ARCH: AMD64 + ENABLE_RTTI: ON + + - OS: macos-11 + ARCH: x86_64 + ENABLE_RTTI: ON + + - OS: macos-11 + ARCH: arm64 + ENABLE_RTTI: ON + + - OS: ubuntu-20.04 + ARCH: x86_64 + ENABLE_RTTI: OFF + + - OS: ubuntu-20.04 + ARCH: aarch64 + ENABLE_RTTI: OFF + + - OS: windows-2019 + ARCH: AMD64 + ENABLE_RTTI: OFF + + - OS: macos-11 + ARCH: x86_64 + ENABLE_RTTI: OFF + + - OS: macos-11 + ARCH: arm64 + ENABLE_RTTI: OFF + steps: - uses: actions/download-artifact@v3 with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir - name: build_artifact + name: build_artifact_${{ matrix.OS }}_${{ matrix.ARCH }}_rtti_${{ matrix.ENABLE_RTTI }} path: dist - name: Release current commit diff --git a/.github/workflows/mlirDistro.yml b/.github/workflows/mlirDistro.yml index 4988cef56a..a4f7a5ff98 100644 --- a/.github/workflows/mlirDistro.yml +++ b/.github/workflows/mlirDistro.yml @@ -242,6 +242,7 @@ jobs: if: contains(inputs.MATRIX_OS, 'ubuntu') shell: bash run: | + docker system prune -a -f - name: Get wheel version diff --git a/docs/Dev.md b/docs/Dev.md index 900585e078..21049b69c1 100644 --- a/docs/Dev.md +++ b/docs/Dev.md @@ -73,4 +73,6 @@ Why Mac? Because some people do dev on a Mac. ## Gotchas 1. In many places you will see `PIP_NO_BUILD_ISOLATION=false` - this means the opposite of what it says i.e., this actually turns off build isolation (i.e., equivalent to passing `--no-build-isolation` to `pip wheel`). [Don't ask me why](https://github.com/pypa/pip/issues/5229#issuecomment-387301397). -2. As of today (12/13/23), CMake will segfault during `Detecting CXX compiler ABI info` on mac for `cmake>3.27.9` inside of cibuildwheel. \ No newline at end of file +2. As of today (12/13/23), CMake will segfault during `Detecting CXX compiler ABI info` on mac for `cmake>3.27.9` inside of cibuildwheel. +3. `caution filename not matched` during `unzip` is due to a glob that matches multiple files; escape the glob like `mlir_aie\*.whl`. +4. Files creating in a cibuildwheel container (i.e., on Linux) have timestamps in the future. This will lead to `ninja` looping forever during a `cmake .. -G Ninja ...` configure step. Hence there's something like `find mlir -exec touch -a -m -t 201108231405.14 {} \;` in various places (where `201108231405.14` is just an arbitrary timestamp in the past). \ No newline at end of file