69 lines
2.2 KiB
YAML
69 lines
2.2 KiB
YAML
name: Build AutoGPTQ Wheels with CUDA
|
|
|
|
on: workflow_dispatch
|
|
|
|
jobs:
|
|
build_wheels:
|
|
if: ${{ github.repository_owner == 'PanQiWei' }}
|
|
name: Build wheels for ${{ matrix.os }} and Python ${{ matrix.python }} and CUDA ${{ matrix.cuda }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-20.04, windows-latest]
|
|
pyver: ["3.8", "3.9", "3.10", "3.11"]
|
|
cuda: ["11.7", "11.8"]
|
|
defaults:
|
|
run:
|
|
shell: pwsh
|
|
env:
|
|
CUDA_VERSION: ${{ matrix.cuda }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v3
|
|
with:
|
|
python-version: ${{ matrix.pyver }}
|
|
|
|
- name: Setup Miniconda
|
|
uses: conda-incubator/setup-miniconda@v2.2.0
|
|
with:
|
|
activate-environment: "build"
|
|
python-version: ${{ matrix.pyver }}
|
|
mamba-version: "*"
|
|
use-mamba: false
|
|
channels: conda-forge,defaults
|
|
channel-priority: true
|
|
add-pip-as-python-dependency: true
|
|
auto-activate-base: false
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
conda install cuda-toolkit -c "nvidia/label/cuda-${env:CUDA_VERSION}.0"
|
|
conda install pytorch "pytorch-cuda=${env:CUDA_VERSION}" -c pytorch -c nvidia
|
|
python -m pip install --upgrade build setuptools wheel ninja
|
|
|
|
- name: Build Wheel
|
|
run: |
|
|
$env:CUDA_PATH = $env:CONDA_PREFIX
|
|
$env:CUDA_HOME = $env:CONDA_PREFIX
|
|
if ($IsLinux) {$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH}
|
|
|
|
# TODO: remove this
|
|
if (!$IsLinux) {$env:INCLUDE_EXLLAMA_KERNELS = 0}
|
|
|
|
$env:TORCH_CUDA_ARCH_LIST = '6.0 6.1 7.0 7.5 8.0 8.6+PTX'
|
|
if ([decimal]$env:CUDA_VERSION -ge 11.8) { $env:TORCH_CUDA_ARCH_LIST = '6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX' }
|
|
python setup.py sdist bdist_wheel
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: runner.os == 'Linux'
|
|
with:
|
|
name: 'linux-cuda-wheels'
|
|
path: ./dist/*.whl
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: runner.os == 'Windows'
|
|
with:
|
|
name: 'windows-cuda-wheels'
|
|
path: ./dist/*.whl
|