Skip to content

Commit 3fcd05f

Browse files
committed
Upload AVX workflows
1 parent bb45fff commit 3fcd05f

File tree

2 files changed

+159
-0
lines changed

2 files changed

+159
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build Wheels 0.1.62 AVX
2+
3+
on: workflow_dispatch
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
build_wheels:
10+
name: Build wheels for ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-20.04, windows-latest]
15+
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11"]
16+
cuda: ["11.6.2", "11.7.1", "11.8.0", "12.0.1", "12.1.0"]
17+
defaults:
18+
run:
19+
shell: pwsh
20+
env:
21+
CUDAVER: ${{ matrix.cuda }}
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v3
26+
with:
27+
repository: 'abetlen/llama-cpp-python'
28+
ref: 'v0.1.62'
29+
path: 'llama-cpp-python'
30+
submodules: 'recursive'
31+
32+
- uses: actions/setup-python@v3
33+
with:
34+
python-version: ${{ matrix.pyver }}
35+
36+
- name: Setup Mamba
37+
uses: conda-incubator/setup-miniconda@v2.2.0
38+
with:
39+
activate-environment: "build"
40+
python-version: ${{ matrix.pyver }}
41+
miniforge-variant: Mambaforge
42+
miniforge-version: latest
43+
use-mamba: true
44+
add-pip-as-python-dependency: true
45+
auto-activate-base: false
46+
47+
- name: Install CUDA Toolkit Linux
48+
if: runner.os == 'Linux'
49+
uses: Jimver/cuda-toolkit@v0.2.10
50+
with:
51+
cuda: ${{ matrix.cuda }}
52+
method: 'network'
53+
54+
- name: Install Dependencies
55+
run: |
56+
$cudaVersion = $env:CUDAVER
57+
$cudaChannels = ''
58+
$cudaNum = [int]$cudaVersion.substring($cudaVersion.LastIndexOf('.')+1)
59+
while ($cudaNum -ge 0) { $cudaChannels += '-c nvidia/label/cuda-' + $cudaVersion.Remove($cudaVersion.LastIndexOf('.')+1) + $cudaNum + ' '; $cudaNum-- }
60+
if ($IsWindows) {mamba install -y 'cuda' $cudaChannels.TrimEnd().Split()}
61+
python -m pip install build wheel
62+
63+
- name: Build Wheel
64+
run: |
65+
Set-Location 'llama-cpp-python'
66+
$cudaVersion = $env:CUDAVER.Remove($env:CUDAVER.LastIndexOf('.')).Replace('.','')
67+
if ($IsWindows) {$env:CUDA_PATH = $env:CONDA_PREFIX; $env:CUDA_HOME = $env:CONDA_PREFIX}
68+
$env:VERBOSE = '1'
69+
$env:FORCE_CMAKE = '1'
70+
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DLLAMA_AVX2=off'
71+
$env:CUDAFLAGS = '-arch=all'
72+
python -m build --wheel -C--build-option=egg_info "-C--build-option=--tag-build=+cu$cudaVersion"
73+
74+
- name: Upload files to a GitHub release
75+
uses: svenstaro/upload-release-action@2.6.1
76+
with:
77+
file: ./llama-cpp-python/dist/*.whl
78+
tag: wheels
79+
file_glob: true
80+
overwrite: true
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build Wheels 0.1.66 AVX
2+
3+
on: workflow_dispatch
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
build_wheels:
10+
name: Build wheels for ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-20.04, windows-latest]
15+
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11"]
16+
cuda: ["11.6.2", "11.7.1", "11.8.0", "12.0.1", "12.1.0"]
17+
defaults:
18+
run:
19+
shell: pwsh
20+
env:
21+
CUDAVER: ${{ matrix.cuda }}
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v3
26+
with:
27+
repository: 'abetlen/llama-cpp-python'
28+
ref: 'v0.1.66'
29+
path: 'llama-cpp-python'
30+
submodules: 'recursive'
31+
32+
- uses: actions/setup-python@v3
33+
with:
34+
python-version: ${{ matrix.pyver }}
35+
36+
- name: Setup Mamba
37+
uses: conda-incubator/setup-miniconda@v2.2.0
38+
with:
39+
activate-environment: "build"
40+
python-version: ${{ matrix.pyver }}
41+
miniforge-variant: Mambaforge
42+
miniforge-version: latest
43+
use-mamba: true
44+
add-pip-as-python-dependency: true
45+
auto-activate-base: false
46+
47+
- name: Install CUDA Toolkit Linux
48+
if: runner.os == 'Linux'
49+
uses: Jimver/cuda-toolkit@v0.2.10
50+
with:
51+
cuda: ${{ matrix.cuda }}
52+
method: 'network'
53+
54+
- name: Install Dependencies
55+
run: |
56+
$cudaVersion = $env:CUDAVER
57+
$cudaChannels = ''
58+
$cudaNum = [int]$cudaVersion.substring($cudaVersion.LastIndexOf('.')+1)
59+
while ($cudaNum -ge 0) { $cudaChannels += '-c nvidia/label/cuda-' + $cudaVersion.Remove($cudaVersion.LastIndexOf('.')+1) + $cudaNum + ' '; $cudaNum-- }
60+
if ($IsWindows) {mamba install -y 'cuda' $cudaChannels.TrimEnd().Split()}
61+
python -m pip install build wheel
62+
63+
- name: Build Wheel
64+
run: |
65+
Set-Location 'llama-cpp-python'
66+
$cudaVersion = $env:CUDAVER.Remove($env:CUDAVER.LastIndexOf('.')).Replace('.','')
67+
if ($IsWindows) {$env:CUDA_PATH = $env:CONDA_PREFIX; $env:CUDA_HOME = $env:CONDA_PREFIX}
68+
$env:VERBOSE = '1'
69+
$env:FORCE_CMAKE = '1'
70+
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DLLAMA_AVX2=off -DCMAKE_CUDA_ARCHITECTURES=all'
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+
uses: svenstaro/upload-release-action@2.6.1
75+
with:
76+
file: ./llama-cpp-python/dist/*.whl
77+
tag: wheels
78+
file_glob: true
79+
overwrite: true

0 commit comments

Comments
 (0)