Skip to content

Commit

Permalink
Upload AVX512 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jllllll committed Jun 27, 2023
1 parent 3b31d6a commit d06d13a
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build-wheels-0.1.66-62-AVX512.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build Wheels 0.1.66/62 AVX512

on: workflow_dispatch

permissions:
contents: write

jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11"]
cuda: ["11.6.2", "11.7.1", "11.8.0", "12.0.1", "12.1.0"]
llamacpp: ['v0.1.66','v0.1.62']
defaults:
run:
shell: pwsh
env:
CUDAVER: ${{ matrix.cuda }}
LLAMAVER: ${{ matrix.llamacpp }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: 'abetlen/llama-cpp-python'
ref: ${{ matrix.llamacpp }}
path: 'llama-cpp-python'
submodules: 'recursive'

- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.pyver }}

- name: Setup Mamba
uses: conda-incubator/[email protected]
with:
activate-environment: "build"
python-version: ${{ matrix.pyver }}
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
add-pip-as-python-dependency: true
auto-activate-base: false

- name: Install Dependencies
run: |
$cudaVersion = $env:CUDAVER
$cudaChannels = ''
$cudaNum = [int]$cudaVersion.substring($cudaVersion.LastIndexOf('.')+1)
while ($cudaNum -ge 0) { $cudaChannels += '-c nvidia/label/cuda-' + $cudaVersion.Remove($cudaVersion.LastIndexOf('.')+1) + $cudaNum + ' '; $cudaNum-- }
mamba install -y 'cuda' $cudaChannels.TrimEnd().Split()
python -m pip install build wheel
- name: Build Wheel
run: |
Set-Location 'llama-cpp-python'
$cudaVersion = $env:CUDAVER.Remove($env:CUDAVER.LastIndexOf('.')).Replace('.','')
$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}
$env:VERBOSE = '1'
$env:FORCE_CMAKE = '1'
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DLLAMA_AVX512=on'
if ($env:LLAMAVER -eq 'v0.1.66') {$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DCMAKE_CUDA_ARCHITECTURES=all'}
if ($env:LLAMAVER -eq 'v0.1.62') {$env:CUDAFLAGS = '-arch=all'}
python -m build --wheel -C--build-option=egg_info "-C--build-option=--tag-build=+cu$cudaVersion"
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
file: ./llama-cpp-python/dist/*.whl
tag: AVX512
file_glob: true
overwrite: true

0 comments on commit d06d13a

Please sign in to comment.