Skip to content

Commit 578ebe0

Browse files
committed
Upload testing workflow
1 parent 7c4876f commit 578ebe0

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build Wheels 0.1.70
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-22.04]
17+
pyver: ["3.10"]
18+
cuda: ["11.7.1"]
19+
releasetag: ["wheels"]
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.70'
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

0 commit comments

Comments
 (0)