From f07d7a3fd790e3c054fddd2be7ea6e20224b93b4 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 08:54:59 +0200 Subject: [PATCH 1/8] torch 2.4.1, python 3.12 --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 61ded07..cea66e8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, windows-latest] - pyver: ["3.8", "3.9", "3.10", "3.11"] + pyver: ["3.8", "3.9", "3.10", "3.11", "3.12"] cuda: ["11.8.0", "12.1.1"] defaults: run: @@ -91,7 +91,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - $pytorchVersion = "torch==2.3.1" + $pytorchVersion = "torch==2.4.1" 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 From 4c0c269383e451480898125f3e2ac430aa042b43 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 08:55:06 +0200 Subject: [PATCH 2/8] bump to version 0.0.8 --- scripts/download_wheels.sh | 2 +- setup.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/download_wheels.sh b/scripts/download_wheels.sh index b1bd8b7..8c4eef4 100644 --- a/scripts/download_wheels.sh +++ b/scripts/download_wheels.sh @@ -1,7 +1,7 @@ #!/bin/bash # Set variables -AWQ_KERNELS_VERSION="0.0.7" +AWQ_KERNELS_VERSION="0.0.8" RELEASE_URL="https://api.github.com/repos/casper-hansen/AutoAWQ_kernels/releases/tags/v${AWQ_KERNELS_VERSION}" # Create a directory to download the wheels diff --git a/setup.py b/setup.py index fffbf4f..ae6c4c3 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ os.environ["CC"] = "g++" os.environ["CXX"] = "g++" -AUTOAWQ_KERNELS_VERSION = "0.0.7" +AUTOAWQ_KERNELS_VERSION = "0.0.8" PYPI_BUILD = os.getenv("PYPI_BUILD", "0") == "1" CUDA_VERSION = os.getenv("CUDA_VERSION", None) or torch.version.cuda ROCM_VERSION = os.environ.get("ROCM_VERSION", None) or torch.version.hip @@ -51,6 +51,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: C++", ], } From e98780d19213df0eb1088427eb2046fdbeef964d Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 08:55:46 +0200 Subject: [PATCH 3/8] bump torch to 2.4.1 in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ae6c4c3..eb6ffca 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ } requirements = [ - "torch==2.3.1", + "torch==2.4.1", ] From 686c8f6eff66e4e375bbc06791ec1ec59bc8ea83 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 09:00:26 +0200 Subject: [PATCH 4/8] Deprecate ROCm build --- .github/workflows/build.yaml | 111 ----------------------------------- 1 file changed, 111 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cea66e8..8aa1499 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -119,114 +119,3 @@ jobs: with: upload_url: ${{ needs.release.outputs.upload_url }} asset_path: ./dist/*.whl - - build_rocm_wheels: - name: Build AWQ with ROCm - runs-on: ${{ matrix.os }} - needs: release - - strategy: - matrix: - os: [ubuntu-20.04] - python: ["3.8", "3.9", "3.10", "3.11"] - rocm: ["5.7.1"] - defaults: - run: - shell: bash - env: - ROCM_VERSION: ${{ matrix.rocm }} - - steps: - - uses: actions/checkout@v3 - - - name: Free Disk Space - run: | - df -h - echo "Removing large packages" - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel - df -h - sudo apt-get autoremove -y >/dev/null 2>&1 - sudo apt-get clean - sudo apt-get autoremove -y >/dev/null 2>&1 - sudo apt-get autoclean -y >/dev/null 2>&1 - df -h - echo "https://github.com/actions/virtual-environments/issues/709" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - echo "remove big /usr/local" - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf /usr/local/lib/android >/dev/null 2>&1 - df -h - sudo rm -rf /usr/share/dotnet/sdk > /dev/null 2>&1 - sudo rm -rf /usr/share/dotnet/shared > /dev/null 2>&1 - sudo rm -rf /usr/share/swift > /dev/null 2>&1 - df -h - - - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python }} - - - name: Setup Mamba - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - activate-environment: "build" - python-version: ${{ matrix.python }} - mamba-version: "*" - use-mamba: false - channels: conda-forge,defaults - channel-priority: true - add-pip-as-python-dependency: true - auto-activate-base: false - - - name: Set up ROCm - run: | - echo "Using python:" - python --version - which python - - if [[ "${{ matrix.rocm }}" == "5.4.2" ]]; then - export ROCM_DL_FILE=amdgpu-install_5.4.50402-1_all.deb - elif [[ "${{ matrix.rocm }}" == "5.6.1" ]]; then - export ROCM_DL_FILE=amdgpu-install_5.6.50601-1_all.deb - elif [[ "${{ matrix.rocm }}" == "5.7.1" ]]; then - export ROCM_DL_FILE=amdgpu-install_5.7.50701-1_all.deb - else - echo Unknown rocm version - exit 1 - fi - - curl -O https://repo.radeon.com/amdgpu-install/${{ matrix.rocm }}/ubuntu/focal/$ROCM_DL_FILE - sudo dpkg -i $ROCM_DL_FILE - sudo DEBIAN_FRONTEND=noninteractive amdgpu-install --usecase=rocm --no-dkms --no-32 -y - - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends rocsparse-dev rocthrust-dev rocblas-dev hipblas-dev hipsparse-dev - - python -m pip install --upgrade build setuptools wheel - - if [[ "${{ matrix.rocm }}" == "5.7.1" ]]; then - python -m pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/rocm5.7 - elif [[ "${{ matrix.rocm }}" == "5.6.1" ]]; then - python -m pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/rocm5.6 - else - echo Unknown rocm version for python install - exit 1 - fi - - - name: Build Wheel - run: | - echo "Using python for build:" - python --version - which python - - ROCM_VERSION=${{ matrix.rocm }} python setup.py sdist bdist_wheel - - - name: Upload Assets - uses: shogo82148/actions-upload-release-asset@v1 - with: - upload_url: ${{ needs.release.outputs.upload_url }} - asset_path: ./dist/*.whl From b68906114c2bf867addc48a57445773a7fd9fca7 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 09:05:52 +0200 Subject: [PATCH 5/8] test build system of PR --- .github/workflows/build.yaml | 64 +++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8aa1499..93f5a61 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,38 +4,40 @@ on: push: tags: - "v*" + pull_request: + branches: [ "main" ] 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 - - - 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) + # 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: 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_cuda_wheels: name: Build AWQ with CUDA runs-on: ${{ matrix.os }} - needs: release + # needs: release strategy: matrix: @@ -114,8 +116,8 @@ jobs: python setup.py sdist bdist_wheel - - name: Upload Assets - uses: shogo82148/actions-upload-release-asset@v1 - with: - upload_url: ${{ needs.release.outputs.upload_url }} - asset_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 From dbc4f7dc9834834c74e00b103828a1caee056483 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 09:28:46 +0200 Subject: [PATCH 6/8] deprecate cuda 11.8, add cuda 12.4.1 --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 93f5a61..8d247c7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,7 +43,7 @@ jobs: matrix: os: [ubuntu-20.04, windows-latest] pyver: ["3.8", "3.9", "3.10", "3.11", "3.12"] - cuda: ["11.8.0", "12.1.1"] + cuda: ["12.1.1", "12.4.1"] defaults: run: shell: pwsh From 4f6622e85830d6c7d7f17be2eb95eb95ee85908a Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 14:20:50 +0200 Subject: [PATCH 7/8] bump to cuda 12.4.1 --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8d247c7..954f9da 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,7 +43,7 @@ jobs: matrix: os: [ubuntu-20.04, windows-latest] pyver: ["3.8", "3.9", "3.10", "3.11", "3.12"] - cuda: ["12.1.1", "12.4.1"] + cuda: ["12.4.1"] defaults: run: shell: pwsh From 4fef88c0c57517fdd811c56ab23af2dddd0eee1f Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 10 Sep 2024 14:52:44 +0200 Subject: [PATCH 8/8] Update install notes. Enable release. --- .github/workflows/build.yaml | 64 +++++++++++++++++------------------- README.md | 12 ++----- 2 files changed, 33 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 954f9da..cb7788a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,40 +4,38 @@ on: push: tags: - "v*" - pull_request: - branches: [ "main" ] 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 - - # - 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) + 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: 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_cuda_wheels: name: Build AWQ with CUDA runs-on: ${{ matrix.os }} - # needs: release + needs: release strategy: matrix: @@ -116,8 +114,8 @@ jobs: python setup.py sdist bdist_wheel - # - name: Upload Assets - # uses: shogo82148/actions-upload-release-asset@v1 - # with: - # upload_url: ${{ needs.release.outputs.upload_url }} - # asset_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 diff --git a/README.md b/README.md index a2d4384..7e38dfd 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,18 @@ AutoAWQ Kernels is a new package that is split up from the [main repository](htt - GPU: Must be compute capability 7.5 or higher. - CUDA Toolkit: Must be 11.8 or higher. - AMD: - - ROCm: Must be 5.6 or higher. + - ROCm: Must be 5.6 or higher. [Build from source](#build-from-source) ## Install ### Install from PyPi -The package is available on PyPi with CUDA 12.1.1 wheels: +The package is available on PyPi with CUDA 12.4.1 wheels: ``` pip install autoawq-kernels ``` -### Install release wheels - -For ROCm and other CUDA versions, you can use the wheels published at each [release](https://github.com/casper-hansen/AutoAWQ_kernels/releases/): - -``` -pip install https://github.com/casper-hansen/AutoAWQ_kernels/releases/download/v0.0.2/autoawq_kernels-0.0.2+rocm561-cp310-cp310-linux_x86_64.whl -``` - ### Build from source You can also build from source: