Skip to content

Commit 9e396b3

Browse files
Smartappliabetlen
andauthored
feat: Update workflows and pre-built wheels (#1416)
* Update build-wheels-cuda.yaml * Update build-wheels-cuda.yaml * revert * Bump pyhton from 3.8 to 3.9 * Remove python 3.8 * Remove Python 3.7 and 3.8 deprecated * Bump python from 3.8 to 3.9 * Add python 3.9 * Add python 3.9, remove macos-11 deprecated, add macos-14 * Bump python 3.8 to 3.9 * Add python 3.13 * Add python 3.13 * python 3.13 remove * remove python 3.13 * remove python 3.8 * Bump macos-13 to macos-14 * Update build-wheels-metal.yaml * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update generate-index-from-release.yaml Add avx, avx2 and avx512 * Update test.yaml * Update test-pypi.yaml * Update publish.yaml * Update publish-to-test.yaml * Update build-wheels-cuda.yaml Cuda with AVX2 by default * Update build-wheels-cuda.yaml * remove DEPRECATED 32 bits * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml Upgrade matrix os to latest version * Update build-wheels-metal.yaml * Update build-wheels-cuda.yaml * Update test.yaml * Update test-pypi.yaml * Update test.yaml Add cache: 'pip' * Update publish-to-test.yaml * Update build-wheels-metal.yaml Add cache: 'pip' * Update build-wheels-cuda.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml remove x86_64 * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * revert * Remove cpu variants --------- Co-authored-by: Andrei Betlen <[email protected]>
1 parent 5af8163 commit 9e396b3

File tree

6 files changed

+96
-109
lines changed

6 files changed

+96
-109
lines changed

.github/workflows/build-wheels-cuda.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
id: set-matrix
2121
run: |
2222
$matrix = @{
23-
'os' = @('ubuntu-20.04', 'windows-latest')
24-
'pyver' = @("3.10", "3.11", "3.12")
23+
'os' = @('ubuntu-latest', 'windows-latest')
24+
'pyver' = @("3.9", "3.10", "3.11", "3.12")
2525
'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1")
2626
'releasetag' = @("basic")
2727
}
@@ -50,6 +50,7 @@ jobs:
5050
- uses: actions/setup-python@v5
5151
with:
5252
python-version: ${{ matrix.pyver }}
53+
cache: 'pip'
5354

5455
- name: Setup Mamba
5556
uses: conda-incubator/[email protected]
@@ -109,15 +110,15 @@ jobs:
109110
$env:VERBOSE = '1'
110111
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=all'
111112
$env:CMAKE_ARGS = "-DLLAMA_CUDA_FORCE_MMQ=ON $env:CMAKE_ARGS"
112-
if ($env:AVXVER -eq 'AVX') {
113-
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
114-
}
115-
if ($env:AVXVER -eq 'AVX512') {
116-
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on'
117-
}
118-
if ($env:AVXVER -eq 'basic') {
119-
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
120-
}
113+
# if ($env:AVXVER -eq 'AVX') {
114+
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
115+
# }
116+
# if ($env:AVXVER -eq 'AVX512') {
117+
# $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on'
118+
# }
119+
# if ($env:AVXVER -eq 'basic') {
120+
# $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
121+
# }
121122
python -m build --wheel
122123
# write the build tag to the output
123124
Write-Output "CUDA_VERSION=$cudaVersion" >> $env:GITHUB_ENV

.github/workflows/build-wheels-metal.yaml

Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,60 @@ permissions:
66
contents: write
77

88
jobs:
9-
define_matrix:
10-
name: Define Build Matrix
11-
runs-on: ubuntu-latest
12-
outputs:
13-
matrix: ${{ steps.set-matrix.outputs.matrix }}
14-
defaults:
15-
run:
16-
shell: pwsh
17-
18-
steps:
19-
- name: Define Job Output
20-
id: set-matrix
21-
run: |
22-
$matrix = @{
23-
'os' = @('macos-11', 'macos-12', 'macos-13')
24-
'pyver' = @('3.10', '3.11', '3.12')
25-
}
26-
27-
$matrixOut = ConvertTo-Json $matrix -Compress
28-
Write-Output ('matrix=' + $matrixOut) >> $env:GITHUB_OUTPUT
29-
309
build_wheels:
31-
name: ${{ matrix.os }} Python ${{ matrix.pyver }}
32-
needs: define_matrix
10+
name: Build wheels on ${{ matrix.os }}
3311
runs-on: ${{ matrix.os }}
3412
strategy:
35-
matrix: ${{ fromJSON(needs.define_matrix.outputs.matrix) }}
36-
env:
37-
OSVER: ${{ matrix.os }}
13+
matrix:
14+
os: [macos-12, macos-13, macos-14]
3815

3916
steps:
4017
- uses: actions/checkout@v4
4118
with:
4219
submodules: "recursive"
4320

21+
# Used to host cibuildwheel
4422
- uses: actions/setup-python@v5
4523
with:
46-
python-version: ${{ matrix.pyver }}
47-
48-
- name: Install Dependencies
49-
run: |
50-
python -m pip install build wheel cmake
24+
python-version: "3.12"
25+
cache: 'pip'
5126

52-
- name: Build Wheel
27+
- name: Install dependencies
5328
run: |
54-
XCODE15PATH="/Applications/Xcode_15.0.app/Contents/Developer"
55-
XCODE15BINPATH="${XCODE15PATH}/Toolchains/XcodeDefault.xctoolchain/usr/bin"
56-
export CMAKE_ARGS="-DLLAMA_NATIVE=off -DLLAMA_METAL=on"
57-
[[ "$OSVER" == "macos-13" ]] && export CC="${XCODE15BINPATH}/cc" && export CXX="${XCODE15BINPATH}/c++" && export MACOSX_DEPLOYMENT_TARGET="13.0"
58-
[[ "$OSVER" == "macos-12" ]] && export MACOSX_DEPLOYMENT_TARGET="12.0"
59-
[[ "$OSVER" == "macos-11" ]] && export MACOSX_DEPLOYMENT_TARGET="11.0"
29+
python -m pip install --upgrade pip
30+
python -m pip install -e .[all]
6031
61-
export CMAKE_OSX_ARCHITECTURES="arm64" && export ARCHFLAGS="-arch arm64"
62-
VERBOSE=1 python -m build --wheel
63-
64-
if [[ "$OSVER" == "macos-13" ]]; then
65-
export SDKROOT="${XCODE15PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk"
66-
export MACOSX_DEPLOYMENT_TARGET="14.0"
67-
VERBOSE=1 python -m build --wheel
68-
fi
69-
70-
for file in ./dist/*.whl; do cp "$file" "${file/arm64.whl/aarch64.whl}"; done
32+
- name: Build wheels
33+
uses: pypa/[email protected]
34+
env:
35+
# disable repair
36+
CIBW_REPAIR_WHEEL_COMMAND: ""
37+
CIBW_ARCHS: "arm64"
38+
CIBW_ENVIRONMENT: CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DLLAMA_METAL=on"
39+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
40+
with:
41+
package-dir: .
42+
output-dir: wheelhouse2
7143

72-
export CMAKE_OSX_ARCHITECTURES="x86_64" && export CMAKE_ARGS="-DLLAMA_NATIVE=off -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DLLAMA_METAL=on" && export ARCHFLAGS="-arch x86_64"
73-
VERBOSE=1 python -m build --wheel
44+
- uses: actions/upload-artifact@v4
45+
with:
46+
name: wheels-mac_${{ matrix.os }}
47+
path: ./wheelhouse2/*.whl
7448

75-
if [[ "$OSVER" == "macos-13" ]]; then
76-
export SDKROOT="${XCODE15PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk"
77-
export MACOSX_DEPLOYMENT_TARGET="14.0"
78-
VERBOSE=1 python -m build --wheel
79-
fi
49+
release:
50+
name: Release
51+
needs: [build_wheels]
52+
runs-on: ubuntu-latest
8053

54+
steps:
55+
- uses: actions/download-artifact@v4
56+
with:
57+
merge-multiple: true
58+
path: dist2
59+
8160
- uses: softprops/action-gh-release@v2
8261
with:
83-
files: dist/*
62+
files: dist2/*
8463
# set release name to <tag>-metal
8564
tag_name: ${{ github.ref_name }}-metal
8665
env:

.github/workflows/publish-to-test.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.11"
26+
cache: 'pip'
2627
- name: Append Dev Version to __version__
2728
run: |
2829
DEV_VERSION=${{ github.event.inputs.dev_version }}
@@ -31,11 +32,11 @@ jobs:
3132
sed -i 's/__version__ = \".*\"/__version__ = \"'"${NEW_VERSION}"'\"/' llama_cpp/__init__.py
3233
- name: Install dependencies
3334
run: |
34-
python3 -m pip install --upgrade pip build
35-
python3 -m pip install -e .[all]
35+
python -m pip install --upgrade pip build
36+
python -m pip install -e .[all]
3637
- name: Build source distribution
3738
run: |
38-
python3 -m build --sdist
39+
python -m build --sdist
3940
- name: Publish to Test PyPI
4041
uses: pypa/gh-action-pypi-publish@release/v1
4142
with:

.github/workflows/publish.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
- name: Set up Python
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.8"
19+
python-version: "3.9"
2020
- name: Install dependencies
2121
run: |
22-
python3 -m pip install --upgrade pip build
23-
python3 -m pip install -e .[all]
22+
python -m pip install --upgrade pip build
23+
python -m pip install -e .[all]
2424
- name: Build source distribution
2525
run: |
26-
python3 -m build --sdist
26+
python -m build --sdist
2727
- name: Publish distribution to PyPI
2828
# TODO: move to tag based releases
2929
# if: startsWith(github.ref, 'refs/tags')

.github/workflows/test-pypi.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,60 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
11+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1212

1313
steps:
1414
- name: Set up Python ${{ matrix.python-version }}
1515
uses: actions/setup-python@v5
1616
with:
1717
python-version: ${{ matrix.python-version }}
18+
cache: 'pip'
1819
- name: Install dependencies
1920
run: |
20-
python3 -m pip install --upgrade pip
21-
python3 -m pip install --verbose llama-cpp-python[all]
21+
python -m pip install --upgrade pip
22+
python -m pip install --verbose llama-cpp-python[all]
2223
- name: Test with pytest
2324
run: |
24-
python3 -c "import llama_cpp"
25+
python -c "import llama_cpp"
2526
2627
build-windows:
2728

2829
runs-on: windows-latest
2930
strategy:
3031
matrix:
31-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
32+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3233

3334
steps:
3435
- name: Set up Python ${{ matrix.python-version }}
3536
uses: actions/setup-python@v5
3637
with:
3738
python-version: ${{ matrix.python-version }}
39+
cache: 'pip'
3840
- name: Install dependencies
3941
run: |
40-
python3 -m pip install --upgrade pip
41-
python3 -m pip install --verbose llama-cpp-python[all]
42+
python -m pip install --upgrade pip
43+
python -m pip install --verbose llama-cpp-python[all]
4244
- name: Test with pytest
4345
run: |
44-
python3 -c "import llama_cpp"
46+
python -c "import llama_cpp"
4547
4648
build-macos:
4749

4850
runs-on: macos-latest
4951
strategy:
5052
matrix:
51-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
53+
python-version: ["3.9", "3.10", "3.11", "3.12"]
5254

5355
steps:
5456
- name: Set up Python ${{ matrix.python-version }}
5557
uses: actions/setup-python@v5
5658
with:
5759
python-version: ${{ matrix.python-version }}
60+
cache: 'pip'
5861
- name: Install dependencies
5962
run: |
60-
python3 -m pip install --upgrade pip
61-
python3 -m pip install --verbose llama-cpp-python[all]
63+
python -m pip install --upgrade pip
64+
python -m pip install --verbose llama-cpp-python[all]
6265
- name: Test with pytest
6366
run: |
64-
python3 -c "import llama_cpp"
67+
python -c "import llama_cpp"

.github/workflows/test.yaml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -24,20 +24,21 @@ jobs:
2424
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
27+
cache: 'pip'
2728
- name: Install dependencies
2829
run: |
29-
python3 -m pip install --upgrade pip
30-
python3 -m pip install .[all] -v
30+
python -m pip install --upgrade pip
31+
python -m pip install .[all] -v
3132
- name: Test with pytest
3233
run: |
33-
python3 -m pytest
34+
python -m pytest
3435
3536
build-windows:
3637

3738
runs-on: windows-latest
3839
strategy:
3940
matrix:
40-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
41+
python-version: ["3.9", "3.10", "3.11", "3.12"]
4142

4243
steps:
4344
- uses: actions/checkout@v4
@@ -47,20 +48,21 @@ jobs:
4748
uses: actions/setup-python@v5
4849
with:
4950
python-version: ${{ matrix.python-version }}
51+
cache: 'pip'
5052
- name: Install dependencies
5153
run: |
52-
python3 -m pip install --upgrade pip
53-
python3 -m pip install .[all] -v
54+
python -m pip install --upgrade pip
55+
python -m pip install .[all] -v
5456
- name: Test with pytest
5557
run: |
56-
python3 -m pytest
58+
python -m pytest
5759
5860
build-macos:
5961

60-
runs-on: macos-13
62+
runs-on: macos-latest
6163
strategy:
6264
matrix:
63-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
65+
python-version: ["3.9", "3.10", "3.11", "3.12"]
6466

6567
steps:
6668
- uses: actions/checkout@v4
@@ -70,13 +72,14 @@ jobs:
7072
uses: actions/setup-python@v5
7173
with:
7274
python-version: ${{ matrix.python-version }}
75+
cache: 'pip'
7376
- name: Install dependencies
7477
run: |
75-
python3 -m pip install --upgrade pip
76-
python3 -m pip install .[all] --verbose
78+
python -m pip install --upgrade pip
79+
python -m pip install .[all] --verbose
7780
- name: Test with pytest
7881
run: |
79-
python3 -m pytest
82+
python -m pytest
8083
8184
# build-linux-opencl:
8285

@@ -98,29 +101,29 @@ jobs:
98101
# sudo apt-get install -y --no-install-recommends llvm intel-oneapi-runtime-opencl intel-oneapi-runtime-compilers libclblast-dev
99102
# - name: Install dependencies
100103
# run: |
101-
# python3 -m pip install --upgrade pip
102-
# CMAKE_ARGS="-DLLAMA_CLBLAST=on" python3 -m pip install .[all] --verbose
104+
# python -m pip install --upgrade pip
105+
# CMAKE_ARGS="-DLLAMA_CLBLAST=on" python -m pip install .[all] --verbose
103106
# - name: Test with pytest
104107
# run: |
105-
# python3 -m pytest
108+
# python -m pytest
106109

107110

108111
build-macos-metal:
109112

110-
runs-on: macos-13
113+
runs-on: macos-latest
111114

112115
steps:
113116
- uses: actions/checkout@v4
114117
with:
115118
submodules: "recursive"
116-
- name: Set up Python 3.8
119+
- name: Set up Python 3.9
117120
uses: actions/setup-python@v5
118121
with:
119-
python-version: "3.8"
122+
python-version: "3.9"
120123
- name: Install dependencies
121124
run: |
122-
python3 -m pip install --upgrade pip
123-
CMAKE_ARGS="-DLLAMA_METAL=on" python3 -m pip install .[all] --verbose
125+
python -m pip install --upgrade pip
126+
CMAKE_ARGS="-DLLAMA_METAL=on" python -m pip install .[all] --verbose
124127
- name: Test with pytest
125128
run: |
126-
python3 -m pytest
129+
python -m pytest

0 commit comments

Comments
 (0)