Skip to content

Workflow update - PART 1 #1416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 87 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d2c1973
Update build-wheels-cuda.yaml
Smartappli Apr 30, 2024
4f0cd41
Update build-wheels-cuda.yaml
Smartappli Apr 30, 2024
3e012ca
Merge branch 'abetlen:main' into cuda
Smartappli May 1, 2024
04f509d
revert
Smartappli May 1, 2024
34d4475
Bump pyhton from 3.8 to 3.9
Smartappli May 1, 2024
f7b3dd0
Remove python 3.8
Smartappli May 1, 2024
a903572
Remove Python 3.7 and 3.8 deprecated
Smartappli May 1, 2024
e890e2e
Bump python from 3.8 to 3.9
Smartappli May 1, 2024
0ce29fe
Add python 3.9
Smartappli May 1, 2024
63c74d7
Add python 3.9, remove macos-11 deprecated, add macos-14
Smartappli May 1, 2024
864d190
Bump python 3.8 to 3.9
Smartappli May 1, 2024
1934440
Add python 3.13
Smartappli May 1, 2024
525b7af
Add python 3.13
Smartappli May 1, 2024
b94a9e2
python 3.13 remove
Smartappli May 1, 2024
d24c882
remove python 3.13
Smartappli May 1, 2024
a5d4a37
remove python 3.8
Smartappli May 1, 2024
2e412af
Bump macos-13 to macos-14
Smartappli May 1, 2024
b1a7cde
Update build-wheels-metal.yaml
Smartappli May 1, 2024
8517a80
Update build-wheels-metal.yaml
Smartappli May 1, 2024
d24d08a
Update build-and-release.yaml
Smartappli May 1, 2024
9efb21f
Update build-and-release.yaml
Smartappli May 1, 2024
15be4a2
Update build-and-release.yaml
Smartappli May 1, 2024
d67c7a6
Update build-and-release.yaml
Smartappli May 1, 2024
561e1ba
Update build-and-release.yaml
Smartappli May 1, 2024
8486229
Update build-and-release.yaml
Smartappli May 1, 2024
56b5a08
Update build-and-release.yaml
Smartappli May 1, 2024
3a6b448
Update build-and-release.yaml
Smartappli May 1, 2024
7f8954f
Update build-wheels-metal.yaml
Smartappli May 2, 2024
cfead6a
Update generate-index-from-release.yaml
Smartappli May 2, 2024
af5030f
Merge branch 'abetlen:main' into cuda
Smartappli May 2, 2024
976cb03
Update test.yaml
Smartappli May 3, 2024
bc99285
Update test-pypi.yaml
Smartappli May 3, 2024
1b620c4
Update publish.yaml
Smartappli May 3, 2024
e2f0259
Update publish-to-test.yaml
Smartappli May 3, 2024
319ddf1
Update build-wheels-cuda.yaml
Smartappli May 3, 2024
eb3f734
Update build-wheels-cuda.yaml
Smartappli May 3, 2024
3a61206
remove DEPRECATED 32 bits
Smartappli May 3, 2024
2095372
Update build-and-release.yaml
Smartappli May 3, 2024
4ebedc1
Update build-and-release.yaml
Smartappli May 3, 2024
8c2120d
Update build-and-release.yaml
Smartappli May 3, 2024
1b8f088
Update build-and-release.yaml
Smartappli May 3, 2024
bfced4f
Update build-and-release.yaml
Smartappli May 3, 2024
698efb7
Update build-and-release.yaml
Smartappli May 3, 2024
6af3934
Update build-and-release.yaml
Smartappli May 3, 2024
74f6cdf
Update build-and-release.yaml
Smartappli May 3, 2024
0aefa55
Update build-and-release.yaml
Smartappli May 3, 2024
d043348
Merge branch 'main' into cuda
Smartappli May 3, 2024
caceb89
Update build-and-release.yaml
Smartappli May 4, 2024
78b9de3
Update build-and-release.yaml
Smartappli May 4, 2024
1552e8e
Update build-and-release.yaml
Smartappli May 4, 2024
93f143e
Merge branch 'main' into cuda
Smartappli May 4, 2024
f342418
Update build-and-release.yaml
Smartappli May 5, 2024
0ce4fab
Update build-wheels-metal.yaml
Smartappli May 5, 2024
32d77b9
Update build-wheels-cuda.yaml
Smartappli May 5, 2024
d61dbd8
Update test.yaml
Smartappli May 5, 2024
816476f
Update test-pypi.yaml
Smartappli May 5, 2024
d15fec6
Update test.yaml
Smartappli May 5, 2024
3c9ab30
Update publish-to-test.yaml
Smartappli May 5, 2024
0752f74
Update build-wheels-metal.yaml
Smartappli May 5, 2024
8aaba56
Update build-wheels-cuda.yaml
Smartappli May 5, 2024
c6f2df8
Update build-and-release.yaml
Smartappli May 5, 2024
04af8b6
Update build-and-release.yaml
Smartappli May 5, 2024
f0df0df
Merge branch 'main' into cuda
Smartappli May 9, 2024
df61135
Update build-wheels-metal.yaml
Smartappli May 10, 2024
561013f
Update build-wheels-metal.yaml
Smartappli May 10, 2024
6e3a5e6
Merge branch 'main' into cuda
Smartappli May 10, 2024
39e74ca
Update build-and-release.yaml
Smartappli May 11, 2024
e15305f
Update build-wheels-metal.yaml
Smartappli May 11, 2024
ccd8bbb
Update build-wheels-metal.yaml
Smartappli May 11, 2024
bc406ad
Update build-and-release.yaml
Smartappli May 11, 2024
0c0946e
Update build-and-release.yaml
Smartappli May 11, 2024
a4f25b4
Update build-and-release.yaml
Smartappli May 11, 2024
5e1d021
Update build-wheels-metal.yaml
Smartappli May 11, 2024
79619a5
Update build-and-release.yaml
Smartappli May 11, 2024
0e7d135
Update build-and-release.yaml
Smartappli May 11, 2024
2fba497
Update build-and-release.yaml
Smartappli May 11, 2024
10ab995
Merge branch 'main' into cuda
Smartappli May 12, 2024
b80cc88
Merge branch 'main' into cuda
Smartappli May 15, 2024
f385942
Merge branch 'main' into cuda
Smartappli May 17, 2024
6951db8
Merge branch 'main' into cuda
Smartappli May 19, 2024
a6b776b
Merge branch 'abetlen:main' into cuda
Smartappli May 29, 2024
1ed20b8
Update build-and-release.yaml
Smartappli May 29, 2024
bb98fa5
Update build-wheels-metal.yaml
Smartappli May 29, 2024
496a437
revert
Smartappli Jun 6, 2024
fe9a9a1
Merge branch 'main' into cuda
Smartappli Jun 12, 2024
6d065af
Merge branch 'main' into cuda
abetlen Jun 13, 2024
6627890
Remove cpu variants
abetlen Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/build-wheels-cuda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
id: set-matrix
run: |
$matrix = @{
'os' = @('ubuntu-20.04', 'windows-latest')
'pyver' = @("3.10", "3.11", "3.12")
'os' = @('ubuntu-latest', 'windows-latest')
'pyver' = @("3.9", "3.10", "3.11", "3.12")
'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1")
'releasetag' = @("basic")
}
Expand Down Expand Up @@ -50,6 +50,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}
cache: 'pip'

- name: Setup Mamba
uses: conda-incubator/[email protected]
Expand Down Expand Up @@ -109,15 +110,15 @@ jobs:
$env:VERBOSE = '1'
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=all'
$env:CMAKE_ARGS = "-DLLAMA_CUDA_FORCE_MMQ=ON $env:CMAKE_ARGS"
if ($env:AVXVER -eq 'AVX') {
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
}
if ($env:AVXVER -eq 'AVX512') {
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on'
}
if ($env:AVXVER -eq 'basic') {
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
}
# if ($env:AVXVER -eq 'AVX') {
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
# }
# if ($env:AVXVER -eq 'AVX512') {
# $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on'
# }
# if ($env:AVXVER -eq 'basic') {
# $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off'
# }
python -m build --wheel
# write the build tag to the output
Write-Output "CUDA_VERSION=$cudaVersion" >> $env:GITHUB_ENV
Expand Down
91 changes: 35 additions & 56 deletions .github/workflows/build-wheels-metal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,60 @@ permissions:
contents: write

jobs:
define_matrix:
name: Define Build Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
defaults:
run:
shell: pwsh

steps:
- name: Define Job Output
id: set-matrix
run: |
$matrix = @{
'os' = @('macos-11', 'macos-12', 'macos-13')
'pyver' = @('3.10', '3.11', '3.12')
}

$matrixOut = ConvertTo-Json $matrix -Compress
Write-Output ('matrix=' + $matrixOut) >> $env:GITHUB_OUTPUT

build_wheels:
name: ${{ matrix.os }} Python ${{ matrix.pyver }}
needs: define_matrix
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.define_matrix.outputs.matrix) }}
env:
OSVER: ${{ matrix.os }}
matrix:
os: [macos-12, macos-13, macos-14]

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}

- name: Install Dependencies
run: |
python -m pip install build wheel cmake
python-version: "3.12"
cache: 'pip'

- name: Build Wheel
- name: Install dependencies
run: |
XCODE15PATH="/Applications/Xcode_15.0.app/Contents/Developer"
XCODE15BINPATH="${XCODE15PATH}/Toolchains/XcodeDefault.xctoolchain/usr/bin"
export CMAKE_ARGS="-DLLAMA_NATIVE=off -DLLAMA_METAL=on"
[[ "$OSVER" == "macos-13" ]] && export CC="${XCODE15BINPATH}/cc" && export CXX="${XCODE15BINPATH}/c++" && export MACOSX_DEPLOYMENT_TARGET="13.0"
[[ "$OSVER" == "macos-12" ]] && export MACOSX_DEPLOYMENT_TARGET="12.0"
[[ "$OSVER" == "macos-11" ]] && export MACOSX_DEPLOYMENT_TARGET="11.0"
python -m pip install --upgrade pip
python -m pip install -e .[all]

export CMAKE_OSX_ARCHITECTURES="arm64" && export ARCHFLAGS="-arch arm64"
VERBOSE=1 python -m build --wheel

if [[ "$OSVER" == "macos-13" ]]; then
export SDKROOT="${XCODE15PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk"
export MACOSX_DEPLOYMENT_TARGET="14.0"
VERBOSE=1 python -m build --wheel
fi

for file in ./dist/*.whl; do cp "$file" "${file/arm64.whl/aarch64.whl}"; done
- name: Build wheels
uses: pypa/[email protected]
env:
# disable repair
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_ARCHS: "arm64"
CIBW_ENVIRONMENT: CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DLLAMA_METAL=on"
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
with:
package-dir: .
output-dir: wheelhouse2

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"
VERBOSE=1 python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: wheels-mac_${{ matrix.os }}
path: ./wheelhouse2/*.whl

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

steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist2

- uses: softprops/action-gh-release@v2
with:
files: dist/*
files: dist2/*
# set release name to <tag>-metal
tag_name: ${{ github.ref_name }}-metal
env:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-to-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.11"
cache: 'pip'
- name: Append Dev Version to __version__
run: |
DEV_VERSION=${{ github.event.inputs.dev_version }}
Expand All @@ -31,11 +32,11 @@ jobs:
sed -i 's/__version__ = \".*\"/__version__ = \"'"${NEW_VERSION}"'\"/' llama_cpp/__init__.py
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip build
python3 -m pip install -e .[all]
python -m pip install --upgrade pip build
python -m pip install -e .[all]
- name: Build source distribution
run: |
python3 -m build --sdist
python -m build --sdist
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip build
python3 -m pip install -e .[all]
python -m pip install --upgrade pip build
python -m pip install -e .[all]
- name: Build source distribution
run: |
python3 -m build --sdist
python -m build --sdist
- name: Publish distribution to PyPI
# TODO: move to tag based releases
# if: startsWith(github.ref, 'refs/tags')
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,60 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --verbose llama-cpp-python[all]
python -m pip install --upgrade pip
python -m pip install --verbose llama-cpp-python[all]
- name: Test with pytest
run: |
python3 -c "import llama_cpp"
python -c "import llama_cpp"

build-windows:

runs-on: windows-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --verbose llama-cpp-python[all]
python -m pip install --upgrade pip
python -m pip install --verbose llama-cpp-python[all]
- name: Test with pytest
run: |
python3 -c "import llama_cpp"
python -c "import llama_cpp"

build-macos:

runs-on: macos-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --verbose llama-cpp-python[all]
python -m pip install --upgrade pip
python -m pip install --verbose llama-cpp-python[all]
- name: Test with pytest
run: |
python3 -c "import llama_cpp"
python -c "import llama_cpp"
47 changes: 25 additions & 22 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -24,20 +24,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .[all] -v
python -m pip install --upgrade pip
python -m pip install .[all] -v
- name: Test with pytest
run: |
python3 -m pytest
python -m pytest

build-windows:

runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -47,20 +48,21 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .[all] -v
python -m pip install --upgrade pip
python -m pip install .[all] -v
- name: Test with pytest
run: |
python3 -m pytest
python -m pytest

build-macos:

runs-on: macos-13
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -70,13 +72,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .[all] --verbose
python -m pip install --upgrade pip
python -m pip install .[all] --verbose
- name: Test with pytest
run: |
python3 -m pytest
python -m pytest

# build-linux-opencl:

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


build-macos-metal:

runs-on: macos-13
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
CMAKE_ARGS="-DLLAMA_METAL=on" python3 -m pip install .[all] --verbose
python -m pip install --upgrade pip
CMAKE_ARGS="-DLLAMA_METAL=on" python -m pip install .[all] --verbose
- name: Test with pytest
run: |
python3 -m pytest
python -m pytest