Skip to content

Commit

Permalink
mlir-aie-no-rtti
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Dec 14, 2023
1 parent 3edf924 commit 3466378
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 13 deletions.
105 changes: 93 additions & 12 deletions .github/workflows/mlirAIEDistro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }} \
Expand All @@ -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 }} \
Expand All @@ -216,6 +237,7 @@ jobs:
if: contains(inputs.MATRIX_OS, 'ubuntu')
shell: bash
run: |
docker system prune -a -f
- name: Get wheel version
Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -334,7 +356,6 @@ jobs:
ARCH: aarch64
PY_VERSION: "cp312"


steps:

- name: Checkout actions
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mlirDistro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ jobs:
if: contains(inputs.MATRIX_OS, 'ubuntu')
shell: bash
run: |
docker system prune -a -f
- name: Get wheel version
Expand Down
4 changes: 3 additions & 1 deletion docs/Dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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).

0 comments on commit 3466378

Please sign in to comment.