Skip to content

Commit 5039c4f

Browse files
authored
Merge branch 'abetlen:main' into main
2 parents 034082b + c3fc80a commit 5039c4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+5954
-3258
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@ updates:
88
- package-ecosystem: "pip" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: "daily"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"
16+
- package-ecosystem: "docker"
17+
directory: "/"
18+
schedule:
19+
interval: "daily"

.github/workflows/build-and-release.yaml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
os: [ubuntu-20.04, windows-2019, macos-11]
14+
os: [ubuntu-20.04, windows-2019, macos-12]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
submodules: "recursive"
2020

2121
# Used to host cibuildwheel
22-
- uses: actions/setup-python@v3
22+
- uses: actions/setup-python@v5
2323
with:
2424
python-version: "3.8"
2525

@@ -29,19 +29,20 @@ jobs:
2929
python -m pip install -e .[all]
3030
3131
- name: Build wheels
32-
uses: pypa/cibuildwheel@v2.16.5
32+
uses: pypa/cibuildwheel@v2.20.0
3333
env:
3434
# disable repair
3535
CIBW_REPAIR_WHEEL_COMMAND: ""
3636
with:
3737
package-dir: .
3838
output-dir: wheelhouse
3939

40-
- uses: actions/upload-artifact@v3
40+
- uses: actions/upload-artifact@v4
4141
with:
42+
name: wheels-${{ matrix.os }}
4243
path: ./wheelhouse/*.whl
4344

44-
build_arm64_wheels:
45+
build_wheels_arm64:
4546
name: Build arm64 wheels
4647
runs-on: ubuntu-latest
4748
steps:
@@ -55,30 +56,30 @@ jobs:
5556
platforms: linux/arm64
5657

5758
- name: Build wheels
58-
uses: pypa/cibuildwheel@v2.16.5
59+
uses: pypa/cibuildwheel@v2.20.0
5960
env:
6061
CIBW_SKIP: "*musllinux* pp*"
6162
CIBW_REPAIR_WHEEL_COMMAND: ""
6263
CIBW_ARCHS: "aarch64"
6364
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
6465
with:
65-
output-dir: wheelhouse/
66+
output-dir: wheelhouse
6667

6768
- name: Upload wheels as artifacts
6869
uses: actions/upload-artifact@v4
6970
with:
70-
name: wheels-${{ matrix.version }}
71-
path: wheelhouse/*.whl
71+
name: wheels_arm64
72+
path: ./wheelhouse/*.whl
7273

7374
build_sdist:
7475
name: Build source distribution
7576
runs-on: ubuntu-latest
7677

7778
steps:
78-
- uses: actions/checkout@v3
79+
- uses: actions/checkout@v4
7980
with:
8081
submodules: "recursive"
81-
- uses: actions/setup-python@v3
82+
- uses: actions/setup-python@v5
8283
with:
8384
python-version: "3.8"
8485
- name: Install dependencies
@@ -88,22 +89,24 @@ jobs:
8889
- name: Build source distribution
8990
run: |
9091
python -m build --sdist
91-
- uses: actions/upload-artifact@v3
92+
- uses: actions/upload-artifact@v4
9293
with:
94+
name: sdist
9395
path: ./dist/*.tar.gz
9496

9597
release:
9698
name: Release
97-
needs: [build_wheels, build_arm64_wheels, build_sdist]
99+
needs: [build_wheels, build_wheels_arm64, build_sdist]
98100
runs-on: ubuntu-latest
99101

100102
steps:
101-
- uses: actions/download-artifact@v3
103+
- uses: actions/download-artifact@v4
102104
with:
103-
name: artifact
105+
merge-multiple: true
104106
path: dist
105-
- uses: softprops/action-gh-release@v1
107+
108+
- uses: softprops/action-gh-release@v2
106109
with:
107110
files: dist/*
108111
env:
109-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-docker.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
submodules: "recursive"
1818

1919
- name: Set up QEMU
20-
uses: docker/setup-qemu-action@v2
20+
uses: docker/setup-qemu-action@v3
2121

2222
- name: Set up Docker Buildx
23-
uses: docker/setup-buildx-action@v2
23+
uses: docker/setup-buildx-action@v3
2424

2525
- name: Login to GitHub Container Registry
26-
uses: docker/login-action@v2
26+
uses: docker/login-action@v3
2727
with:
2828
registry: ghcr.io
2929
username: ${{ github.repository_owner }}
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131

3232
- name: Build and push
3333
id: docker_build
34-
uses: docker/build-push-action@v4
34+
uses: docker/build-push-action@v6
3535
with:
3636
context: .
3737
file: "docker/simple/Dockerfile"

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

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
id: set-matrix
2121
run: |
2222
$matrix = @{
23-
'os' = @('ubuntu-20.04', 'windows-latest')
24-
'pyver' = @("3.10", "3.11", "3.12")
25-
'cuda' = @("12.1.1", "12.2.2", "12.3.2")
23+
'os' = @('ubuntu-latest', 'windows-2019')
24+
'pyver' = @("3.9", "3.10", "3.11", "3.12")
25+
'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1")
2626
'releasetag' = @("basic")
2727
}
2828
@@ -43,16 +43,23 @@ jobs:
4343
AVXVER: ${{ matrix.releasetag }}
4444

4545
steps:
46+
- name: Add MSBuild to PATH
47+
if: runner.os == 'Windows'
48+
uses: microsoft/setup-msbuild@v2
49+
with:
50+
vs-version: '[16.11,16.12)'
51+
4652
- uses: actions/checkout@v4
4753
with:
4854
submodules: "recursive"
4955

50-
- uses: actions/setup-python@v4
56+
- uses: actions/setup-python@v5
5157
with:
5258
python-version: ${{ matrix.pyver }}
59+
cache: 'pip'
5360

5461
- name: Setup Mamba
55-
uses: conda-incubator/setup-miniconda@v2.2.0
62+
uses: conda-incubator/setup-miniconda@v3.0.4
5663
with:
5764
activate-environment: "build"
5865
python-version: ${{ matrix.pyver }}
@@ -65,7 +72,7 @@ jobs:
6572
- name: VS Integration Cache
6673
id: vs-integration-cache
6774
if: runner.os == 'Windows'
68-
uses: actions/cache@v3.3.2
75+
uses: actions/cache@v4.0.2
6976
with:
7077
path: ./MSBuildExtensions
7178
key: cuda-${{ matrix.cuda }}-vs-integration
@@ -74,7 +81,7 @@ jobs:
7481
if: runner.os == 'Windows' && steps.vs-integration-cache.outputs.cache-hit != 'true'
7582
run: |
7683
if ($env:CUDAVER -eq '12.1.1') {$x = '12.1.0'} else {$x = $env:CUDAVER}
77-
$links = (Invoke-RestMethod 'https://github.com/Jimver/cuda-toolkit/raw/dc0ca7bb29c5a92f7a963d3d5c93f8d59765136a/src/links/windows-links.ts').Trim().split().where({$_ -ne ''})
84+
$links = (Invoke-RestMethod 'https://raw.githubusercontent.com/Jimver/cuda-toolkit/master/src/links/windows-links.ts').Trim().split().where({$_ -ne ''})
7885
for ($i=$q=0;$i -lt $links.count -and $q -lt 2;$i++) {if ($links[$i] -eq "'$x',") {$q++}}
7986
Invoke-RestMethod $links[$i].Trim("'") -OutFile 'cudainstaller.zip'
8087
& 'C:\Program Files\7-Zip\7z.exe' e cudainstaller.zip -oMSBuildExtensions -r *\MSBuildExtensions\* > $null
@@ -84,7 +91,7 @@ jobs:
8491
if: runner.os == 'Windows'
8592
run: |
8693
$y = (gi '.\MSBuildExtensions').fullname + '\*'
87-
(gi 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\*\BuildCustomizations').fullname.foreach({cp $y $_})
94+
(gi 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\*\BuildCustomizations').fullname.foreach({cp $y $_})
8895
$cupath = 'CUDA_PATH_V' + $env:CUDAVER.Remove($env:CUDAVER.LastIndexOf('.')).Replace('.','_')
8996
echo "$cupath=$env:CONDA_PREFIX" >> $env:GITHUB_ENV
9097
@@ -107,22 +114,22 @@ jobs:
107114
$env:LD_LIBRARY_PATH = $env:CONDA_PREFIX + '/lib:' + $env:LD_LIBRARY_PATH
108115
}
109116
$env:VERBOSE = '1'
110-
$env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=all'
111-
$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-
}
117+
$env:CMAKE_ARGS = '-DGGML_CUDA=on -DCMAKE_CUDA_ARCHITECTURES=all'
118+
$env:CMAKE_ARGS = "-DGGML_CUDA_FORCE_MMQ=ON $env:CMAKE_ARGS"
119+
# if ($env:AVXVER -eq 'AVX') {
120+
$env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DGGML_AVX2=off -DGGML_FMA=off -DGGML_F16C=off'
121+
# }
122+
# if ($env:AVXVER -eq 'AVX512') {
123+
# $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DGGML_AVX512=on'
124+
# }
125+
# if ($env:AVXVER -eq 'basic') {
126+
# $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DGGML_AVX=off -DGGML_AVX2=off -DGGML_FMA=off -DGGML_F16C=off'
127+
# }
121128
python -m build --wheel
122129
# write the build tag to the output
123130
Write-Output "CUDA_VERSION=$cudaVersion" >> $env:GITHUB_ENV
124131
125-
- uses: softprops/action-gh-release@v1
132+
- uses: softprops/action-gh-release@v2
126133
with:
127134
files: dist/*
128135
# Set tag_name to <tag>-cu<cuda_version>

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

Lines changed: 37 additions & 58 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

44-
- uses: actions/setup-python@v4
21+
# Used to host cibuildwheel
22+
- 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/cibuildwheel@v2.20.0
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 -DGGML_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

81-
- uses: softprops/action-gh-release@v1
54+
steps:
55+
- uses: actions/download-artifact@v4
56+
with:
57+
merge-multiple: true
58+
path: dist2
59+
60+
- 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:

0 commit comments

Comments
 (0)