Merge pull request #64 from amd/add-windows-wheels-release #196
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build-repo: | |
| name: Build Triton Repo | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free disk space | |
| uses: descriptinc/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| swap-storage: false | |
| - name: Get repo | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| submodules: recursive | |
| - name: Ccache for C++ compilation | |
| uses: hendrikmuhs/ccache-action@v1.2.12 | |
| with: | |
| key: ${{ runner.os }}-clangreleaseasserts-${{ steps.get-submodule-hash.outputs.hash }} | |
| max-size: 1G | |
| - name: Install packages | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build build-essential cmake clang lld | |
| - name: Install python packages | |
| run: | | |
| pip cache purge | |
| pip install --upgrade pip | |
| pip install lit cmake joblib pybind11 nanobind | |
| - name: Install MLIR-AIR (with mlir-aie + llvm-aie via [aie] extra) | |
| shell: bash | |
| run: | | |
| # The mlir-air wheel pins the matching mlir-aie commit and requires | |
| # llvm-aie via the [aie] extra, so a single pip install pulls the whole | |
| # stack with a guaranteed-compatible mlir-aie. | |
| MLIR_AIR_HASH_FILE=utils/mlir-air-hash.txt | |
| MLIR_AIR_COMMIT_HASH=$(awk -v kw="Commit:" '$0 ~ kw {for (i=1; i<NF; i++) if ($i == kw) print $(i+1)}' "$MLIR_AIR_HASH_FILE") | |
| SHORT_MLIR_AIR_COMMIT_HASH="${MLIR_AIR_COMMIT_HASH:0:7}" | |
| echo "Using mlir-air hash: $SHORT_MLIR_AIR_COMMIT_HASH" | |
| MLIR_AIR_VERSION=$(awk -v kw="Version:" '$0 ~ kw {for (i=1; i<NF; i++) if ($i == kw) print $(i+1)}' "$MLIR_AIR_HASH_FILE") | |
| echo "mlir-air version: $MLIR_AIR_VERSION" | |
| MLIR_AIR_TIMESTAMP=$(awk -v kw="Timestamp:" '$0 ~ kw {for (i=1; i<NF; i++) if ($i == kw) print $(i+1)}' "$MLIR_AIR_HASH_FILE") | |
| echo "mlir-air timestamp: $MLIR_AIR_TIMESTAMP" | |
| python3 -m pip install "mlir_air[aie]==$MLIR_AIR_VERSION.$MLIR_AIR_TIMESTAMP+$SHORT_MLIR_AIR_COMMIT_HASH.no.rtti" \ | |
| -f https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-air-wheels-no-rtti \ | |
| -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels-no-rtti \ | |
| -f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly | |
| # The [aie] extra requires llvm-aie without a version pin. Force an | |
| # upgrade so we always test against the latest nightly wheel. | |
| python3 -m pip install --upgrade --force-reinstall llvm-aie -f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly | |
| python3 -m pip show llvm-aie | |
| python3 -m pip show mlir_aie | |
| # Set environmental variable "MLIR_AIE_INSTALL_DIR" | |
| MLIR_AIE_INSTALL_DIR_STR="$(python3 -m pip show mlir_aie | grep ^Location: | awk '{print $2}')/mlir_aie" | |
| echo "MLIR_AIE_INSTALL_DIR=$MLIR_AIE_INSTALL_DIR_STR" >> $GITHUB_ENV | |
| # Update paths in environmental variables | |
| echo "${MLIR_AIE_INSTALL_DIR}/bin" >> $GITHUB_PATH | |
| echo "PYTHONPATH=${MLIR_AIE_INSTALL_DIR}/python:$PYTHONPATH" >> $GITHUB_ENV | |
| echo "LD_LIBRARY_PATH=${MLIR_AIE_INSTALL_DIR}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cmake -GNinja -S . -Bbuild -DPIP_INSTALL_TARGET=$PWD/installed_triton_package | |
| ninja -Cbuild |