From cb3f779531ce84d5cda41eda66473fa10bf3bac3 Mon Sep 17 00:00:00 2001 From: Casper Date: Sun, 5 Nov 2023 12:16:18 +0100 Subject: [PATCH] Test build of CUDA old and new wheel --- .github/workflows/build.yaml | 78 ++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f573b09a..c0a77f5b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,51 +2,52 @@ name: Build AutoAWQ Wheels with CUDA on: push: - tags: - - "v*" + branches: + - older_cuda_wheels jobs: - release: - # Retrieve tag and create release - name: Create Release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - steps: - - name: Checkout - uses: actions/checkout@v3 + # release: + # # Retrieve tag and create release + # name: Create Release + # runs-on: ubuntu-latest + # outputs: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # steps: + # - name: Checkout + # uses: actions/checkout@v3 - - name: Extract branch info - shell: bash - run: | - echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + # - name: Extract branch info + # shell: bash + # run: | + # echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Create Release - id: create_release - uses: "actions/github-script@v6" - env: - RELEASE_TAG: ${{ env.release_tag }} - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - const script = require('.github/workflows/scripts/github_create_release.js') - await script(github, context, core) + # - name: Create Release + # id: create_release + # uses: "actions/github-script@v6" + # env: + # RELEASE_TAG: ${{ env.release_tag }} + # with: + # github-token: "${{ secrets.GITHUB_TOKEN }}" + # script: | + # const script = require('.github/workflows/scripts/github_create_release.js') + # await script(github, context, core) build_wheels: name: Build AWQ runs-on: ${{ matrix.os }} - needs: release + # needs: release strategy: matrix: os: [ubuntu-20.04, windows-latest] pyver: ["3.8", "3.9", "3.10", "3.11"] - cuda: ["12.1.1"] + cuda: ["11.8.0", "12.1.1"] defaults: run: shell: pwsh env: - CUDA_VERSION: ${{ matrix.cuda }} + PYPI_CUDA_VERSION: "12.1.1" + CUDA_VERSION: ${{ matrix.cuda }} steps: - name: Free Disk Space @@ -90,7 +91,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - if ([int]$cudaVersionPytorch -gt 118) { $pytorchVersion = "torch==2.1.0" } else {$pytorchVersion = "torch==2.0.1"} + $pytorchVersion = "torch==2.1.0" python -m pip install --upgrade --no-cache-dir $pytorchVersion+cu$cudaVersionPytorch --index-url https://download.pytorch.org/whl/cu$cudaVersionPytorch python -m pip install build setuptools wheel ninja @@ -105,12 +106,21 @@ jobs: run: | $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX - $env:PYPI_BUILD = 1 + + # Only add +cu118 to wheel if not releasing on PyPi + if ( env:CUDA_VERSION = env:PYPI_CUDA_VERSION ){ + $env:PYPI_BUILD = 1 + } python setup.py sdist bdist_wheel - - name: Upload Assets - uses: shogo82148/actions-upload-release-asset@v1 + - uses: actions/upload-artifact@v3 with: - upload_url: ${{ needs.release.outputs.upload_url }} - asset_path: ./dist/*.whl \ No newline at end of file + name: 'wheels' + path: ./dist/*.whl + + # - name: Upload Assets + # uses: shogo82148/actions-upload-release-asset@v1 + # with: + # upload_url: ${{ needs.release.outputs.upload_url }} + # asset_path: ./dist/*.whl \ No newline at end of file