Skip to content

Commit

Permalink
build autogptq
Browse files Browse the repository at this point in the history
  • Loading branch information
achew010 committed Jun 26, 2024
1 parent 605975d commit db96b34
Showing 1 changed file with 48 additions and 44 deletions.
92 changes: 48 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
cuda-version:
- '12.1'
python-version:
- setup: "3.9"
torch-version:
- '2.2.2'
plugin_name:
- "framework"
- "accelerated-peft"
Expand All @@ -29,6 +33,16 @@ jobs:
steps:
- uses: actions/checkout@v4

# need to free up disk space for installation of toolkit and libraries
- name: Free up disk space
if: ${{ runner.os == 'Linux' }}
# https://github.com/easimon/maximize-build-space/blob/master/action.yml
# https://github.com/easimon/maximize-build-space/tree/test-report
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
- name: Set up Python ${{ matrix.python-version.setup }}
uses: actions/setup-python@v4
with:
Expand All @@ -39,55 +53,45 @@ jobs:
python -m pip install --upgrade pip
python -m pip install tox
- name: Run Tests
run: |
cd plugins/${{ matrix.plugin_name }}
tox -e py
- name: Install CUDA ${{ matrix.cuda-version }}
if: ${{ matrix.plugin_name == 'accelerated-peft' }}
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: ${{ matrix.cuda-version }}.0
linux-local-args: '["--toolkit"]'
method: 'network'
# sub-packages: '["nvcc"]'
# non-cuda-sub-packages: '["libcublas", "libcufft", "cuda-runtime"]'

- name: Build and check wheel package
- name: Building AutoGPTQ
if: ${{ matrix.plugin_name == 'accelerated-peft' }}
run: |
cd plugins/${{ matrix.plugin_name }}
tox -e build
ls dist/
python -m pip install torch --index-url https://download.pytorch.org/whl/cu${{{ matrix.cuda-version }}//./}
# push to Test PyPI on
# - a new GitHub release is published
# - a PR is merged into main branch
publish-test-pypi:
name: Publish packages to test.pypi.org
# environment: publish-test-pypi
if: ${{ (github.event.action == 'published') || ((github.event_name == 'push') && (github.ref == 'refs/heads/actions/whl_build')) }}
permissions:
contents: read
# see https://docs.pypi.org/trusted-publishers/
id-token: write
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- setup: "3.9"
plugin_name:
- "framework"
- "accelerated-peft"
- "fused-ops-and-kernels"
export CUDA_HOME=/usr/local/cuda-${{ matrix.cuda-version }}
export LD_LIBRARY_PATH=/usr/local/cuda-${{ matrix.cuda-version }}/lib64:$LD_LIBRARY_PATH
export TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX"
needs: build-package
# extract AutoGPTQ from requirements and add to src
cd plugins/${{ matrix.plugin_name }}/src
target="$(sed -n "/^auto_gptq / {s%.*git+%%; p;}" plugins/${{ matrix.plugin_name }}/requirements.txt)";
git clone "$(cut -d@ -f1 <<< "$target")";
cd AutoGPTQ
git checkout "$(cut -d@ -f2 <<< "$target")"
steps:
- name: "Harden Runner"
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
# do we need to build here or leave it to package manager
python setup.py sdist
- name: "Download build artifacts"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
path: plugins/${{ matrix.plugin_name }}/dist
ls
- name: Display structure of downloaded files
run: ls -R
# - name: Build and check wheel package
# run: |
# cd plugins/${{ matrix.plugin_name }}
# tox -e build
# ls dist

# - name: "Upload to Test PyPI"
# uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
# with:
# repository-url: https://test.pypi.org/legacy/
# - name: "Upload to Test PyPI"
# uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
# with:
# repository-url: https://test.pypi.org/legacy/

0 comments on commit db96b34

Please sign in to comment.