Skip to content

Commit

Permalink
python bindings wheels working locally
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Sep 6, 2023
1 parent e8d90d2 commit 21dfeb6
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 1,071 deletions.
56 changes: 19 additions & 37 deletions .github/workflows/distro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
- OS: macos-11
ARCH: arm64

- OS: windows-2019
ARCH: AMD64
# - OS: windows-2019
# ARCH: AMD64

steps:
# Enable tmate debugging of manually-triggered workflows if the input option was provided
Expand All @@ -75,7 +75,7 @@ jobs:
- uses: actions/checkout@v3
with:
repository: Xilinx/mlir-air
ref: ${{ inputs.AIR_COMMIT }}
ref: ${{ inputs.AIR_COMMIT != '' && inputs.AIR_COMMIT || 'main' }}
submodules: recursive
path: mlir-air

Expand Down Expand Up @@ -173,14 +173,13 @@ jobs:
pip install cibuildwheel
APPLY_PATCHES=true \
BOOST_ROOT="${{ steps.install-boost.outputs.BOOST_ROOT }}" \
CIBW_ARCHS=${{ matrix.ARCH }} \
CMAKE_GENERATOR="Ninja" \
HOST_CCACHE_DIR=${{ steps.configure_ccache_dir_on_host.outputs.HOST_CCACHE_DIR }} \
MATRIX_OS=${{ matrix.OS }} \
MLIR_WHEEL_VERSION="17.0.0.2023083019+35ca6498" \
MLIR_AIE_WHEEL_VERSION="0.0.1.2023090122+c7add68" \
MLIR_AIE_WHEEL_VERSION="0.0.1.2023090522+9e659d8" \
PARALLEL_LEVEL=${{ matrix.OS == 'windows-2019' && '2' || '4' }} \
cibuildwheel --output-dir wheelhouse
Expand All @@ -191,22 +190,22 @@ jobs:
sudo apt-get install -y python3-dev
export APPLY_PATCHES=true
export PIP_NO_BUILD_ISOLATION="false"
export PIP_FIND_LINKS="https://makslevental.github.io/wheels"
export CIBW_ARCHS=${{ matrix.ARCH }}
export MLIR_WHEEL_VERSION="17.0.0.2023083019+35ca6498"
export MLIR_AIE_WHEEL_VERSION="0.0.1.2023090122+c7add68"
export MLIR_AIE_WHEEL_VERSION="0.0.1.2023090522+9e659d8"
export BOOST_ROOT="${{ steps.install-boost.outputs.BOOST_ROOT }}"
export MATRIX_OS=${{ matrix.OS }}
pip install -r requirements.txt
./scripts/pip_install_mlir.sh
./scripts/pip_install_mlir_aie.sh
./scripts/apply_patches.sh
CMAKE_GENERATOR=Ninja \
pip wheel . -v -w wheelhouse --no-build-isolation
pip wheel . -v -w wheelhouse --no-build-isolation \
-f https://makslevental.github.io/wheels \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels \
-f https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels
- name: rename
shell: bash
Expand All @@ -217,6 +216,7 @@ jobs:
else
sudo apt-get install -y rename
fi
rename 's/cp310-cp310/py3-none/' wheelhouse/mlir_air-*whl
rename 's/cp311-cp311/py3-none/' wheelhouse/mlir_air-*whl
if [ x"${{ matrix.OS }}" == x"ubuntu-20.04" ] && [ x"${{ matrix.ARCH }}" == x"aarch64" ]; then
Expand Down Expand Up @@ -272,35 +272,17 @@ jobs:
with:
artifacts: "dist/*.whl,dist/*.tar.xz"
token: "${{ secrets.GITHUB_TOKEN }}"
tag: "latest"
name: "latest"
tag: "latest-wheels"
name: "latest-wheels"
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true

- name: Release current commit
uses: ncipollo/[email protected]
with:
owner: makslevental
repo: wheels
artifacts: "dist/*.whl"
token: "${{ secrets.WHEELS_REPO }}"
tag: "i"
name: "i"
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true

# call-build-python-bindings:
# needs: [upload_distro_wheels]
# uses: makslevental/mlir-air/.github/workflows/wheels.yml@wheels
# permissions:
# contents: write
# id-token: write
# secrets: inherit # pass all secrets

#apt-get update && apt-get install libboost-all-dev git vim curl wget binutils-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
# apt-get install -y binutils-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
# apt-get install python3 python3-pip python-is-python3
call-build-python-bindings:
needs: [upload_distro_wheels]
uses: Xilinx/mlir-air/.github/workflows/wheels.yml@wheels_1
permissions:
contents: write
id-token: write
secrets: inherit # pass all secrets
35 changes: 16 additions & 19 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ name: Wheels

on:
workflow_dispatch:
MLIR_AIR_WHEEL_VERSION:
description: 'mlir-air wheel version'
type: string
required: false
default: ''
workflow_call:
inputs:
MLIR_AIR_WHEEL_VERSION:
description: 'mlir-air wheel version'
type: string
required: false
default: ''

jobs:

Expand All @@ -25,8 +36,8 @@ jobs:
- OS: macos-11
ARCH: arm64

- OS: windows-2019
ARCH: AMD64
# - OS: windows-2019
# ARCH: AMD64

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -119,8 +130,8 @@ jobs:
HOST_CCACHE_DIR=${{ steps.configure_ccache_dir_on_host.outputs.HOST_CCACHE_DIR }} \
MATRIX_OS=${{ matrix.OS }} \
MLIR_WHEEL_VERSION="17.0.0.2023083019+35ca6498" \
MLIR_AIE_WHEEL_VERSION="0.0.1.2023090122+c7add68" \
MLIR_AIR_WHEEL_VERSION="0.0.1.2023090202+fc87be2" \
MLIR_AIE_WHEEL_VERSION="0.0.1.2023090522+9e659d8" \
MLIR_AIR_WHEEL_VERSION=${{ inputs.MLIR_WHEEL_VERSION }} \
PARALLEL_LEVEL=${{ matrix.OS == 'windows-2019' && '2' || '2' }} \
cibuildwheel --output-dir ../wheelhouse
Expand Down Expand Up @@ -176,18 +187,4 @@ jobs:
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true

- name: Release current commit
uses: ncipollo/[email protected]
with:
owner: makslevental
repo: wheels
artifacts: "dist/*.whl"
token: "${{ secrets.WHEELS_REPO }}"
tag: "i"
name: "i"
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true
makeLatest: true
51 changes: 0 additions & 51 deletions patches/airtoaie.patch

This file was deleted.

20 changes: 0 additions & 20 deletions patches/boost.patch

This file was deleted.

71 changes: 0 additions & 71 deletions patches/capi.patch

This file was deleted.

Loading

0 comments on commit 21dfeb6

Please sign in to comment.