Skip to content

Commit ea0ed40

Browse files
committed
Upload 0.1.72 workflow
1 parent 7da5ae6 commit ea0ed40

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

.github/workflows/build-all-wheels.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ jobs:
3434
name: Build Wheels 0.1.71
3535
needs: run_workflow_0-1-70
3636
uses: ./.github/workflows/build-wheels-0.1.71.yml
37+
38+
run_workflow_0-1-72:
39+
name: Build Wheels 0.1.72
40+
needs: run_workflow_0-1-71
41+
uses: ./.github/workflows/build-wheels-0.1.72.yml
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build Wheels 0.1.72
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build_wheels:
12+
name: ${{ matrix.os }} ${{ matrix.pyver }} ${{ matrix.cuda }} ${{ matrix.releasetag == 'wheels' && 'AVX2' || matrix.releasetag }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-20.04, windows-latest]
17+
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11"]
18+
cuda: ["11.6.2", "11.7.1", "11.8.0", "12.0.1", "12.1.1", "12.2.0"]
19+
releasetag: ["AVX","wheels","AVX512"]
20+
defaults:
21+
run:
22+
shell: pwsh
23+
env:
24+
CUDAVER: ${{ matrix.cuda }}
25+
AVXVER: ${{ matrix.releasetag }}
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
with:
30+
repository: 'abetlen/llama-cpp-python'
31+
ref: 'v0.1.72'
32+
submodules: 'recursive'
33+
34+
- uses: actions/setup-python@v3
35+
with:
36+
python-version: ${{ matrix.pyver }}
37+
38+
- name: Setup Mamba
39+
uses: conda-incubator/setup-miniconda@v2.2.0
40+
with:
41+
activate-environment: "build"
42+
python-version: ${{ matrix.pyver }}
43+
miniforge-variant: Mambaforge
44+
miniforge-version: latest
45+
use-mamba: true
46+
add-pip-as-python-dependency: true
47+
auto-activate-base: false
48+
49+
- name: Install Dependencies
50+
run: |
51+
$cudaVersion = $env:CUDAVER
52+
$cudaChannels = ''
53+
$cudaNum = [int]$cudaVersion.substring($cudaVersion.LastIndexOf('.')+1)
54+
while ($cudaNum -ge 0) { $cudaChannels += '-c nvidia/label/cuda-' + $cudaVersion.Remove($cudaVersion.LastIndexOf('.')+1) + $cudaNum + ' '; $cudaNum-- }
55+
mamba install -y 'cuda' $cudaChannels.TrimEnd().Split()
56+
python -m pip install build wheel
57+
58+
- name: Build Wheel
59+
run: |
60+
$cudaVersion = $env:CUDAVER.Remove($env:CUDAVER.LastIndexOf('.')).Replace('.','')
61+
$env:CUDA_PATH = $env:CONDA_PREFIX
62+
$env:CUDA_HOME = $env:CONDA_PREFIX
63+
if ($IsLinux) {$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH}
64+
$env:VERBOSE = '1'
65+
$env:FORCE_CMAKE = '1'
66+
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=35-real;37-real;52;61-real;70-real;72-real;75-real;80-real;86-real;89-real;90'
67+
if ([version]$env:CUDAVER -ge [version]'12.0') {$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=52;61-real;70-real;72-real;75-real;80-real;86-real;89-real;90'}
68+
if ([version]$env:CUDAVER -lt [version]'11.8') {$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=35-real;37-real;52;61-real;70-real;72-real;75-real;80-real;86'}
69+
if ($env:AVXVER -eq 'AVX') {$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off'}
70+
if ($env:AVXVER -eq 'AVX512') {$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on'}
71+
python -m build --wheel -C--build-option=egg_info "-C--build-option=--tag-build=+cu$cudaVersion"
72+
73+
- name: Upload files to a GitHub release
74+
id: upload-release
75+
uses: svenstaro/upload-release-action@2.6.1
76+
continue-on-error: true
77+
with:
78+
file: ./dist/*.whl
79+
tag: ${{ matrix.releasetag }}
80+
file_glob: true
81+
make_latest: false
82+
overwrite: true
83+
84+
- uses: actions/upload-artifact@v3
85+
if: steps.upload-release.outcome == 'failure'
86+
with:
87+
name: ${{ matrix.releasetag == 'wheels' && 'AVX2' || matrix.releasetag }}
88+
path: ./dist/*.whl

0 commit comments

Comments
 (0)