Skip to content

Commit 3b0938a

Browse files
committed
Upload 0.1.71 workflow
1 parent a82ee12 commit 3b0938a

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ jobs:
2929
name: Build Wheels 0.1.70
3030
needs: run_workflow_0-1-68
3131
uses: ./.github/workflows/build-wheels-0.1.70.yml
32+
33+
run_workflow_0-1-71:
34+
name: Build Wheels 0.1.71
35+
needs: run_workflow_0-1-70
36+
uses: ./.github/workflows/build-wheels-0.1.71.yml
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build Wheels 0.1.71
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.71'
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+
- uses: actions/upload-artifact@v3
74+
with:
75+
name: ${{ matrix.releasetag == 'wheels' && 'AVX2' || matrix.releasetag }}
76+
path: ./dist/*.whl
77+
78+
upload_release_assets:
79+
name: Upload wheels to a GitHub release
80+
needs: build_wheels
81+
runs-on: ubuntu-latest
82+
strategy:
83+
matrix:
84+
releasetag: ["AVX","wheels","AVX512"]
85+
86+
steps:
87+
- uses: actions/download-artifact@v3
88+
with:
89+
name: ${{ matrix.releasetag == 'wheels' && 'AVX2' || matrix.releasetag }}
90+
91+
- name: Upload ${{ matrix.releasetag == 'wheels' && 'AVX2' || matrix.releasetag }} wheels to a GitHub release
92+
id: upload-release
93+
uses: svenstaro/upload-release-action@2.6.1
94+
with:
95+
file: ./**.whl
96+
tag: ${{ matrix.releasetag }}
97+
file_glob: true
98+
make_latest: false
99+
overwrite: ${{ github.run_attempt == '1' && 'true' || 'false' }}

0 commit comments

Comments
 (0)