Skip to content

Commit c4a2de6

Browse files
Merge branch 'ggml-org:master' into master
2 parents 733dd8d + c95fa36 commit c4a2de6

File tree

312 files changed

+39346
-18891
lines changed

Some content is hidden

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

312 files changed

+39346
-18891
lines changed

.github/workflows/build.yml

Lines changed: 89 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,15 @@ jobs:
173173
name: llama-bin-macos-x64.zip
174174

175175
ubuntu-cpu-cmake:
176-
runs-on: ubuntu-22.04
176+
strategy:
177+
matrix:
178+
include:
179+
- build: 'x64'
180+
os: ubuntu-22.04
181+
- build: 'arm64'
182+
os: ubuntu-22.04-arm
183+
184+
runs-on: ${{ matrix.os }}
177185

178186
steps:
179187
- name: Clone
@@ -239,14 +247,14 @@ jobs:
239247
run: |
240248
cp LICENSE ./build/bin/
241249
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
242-
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip ./build/bin/*
250+
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.zip ./build/bin/*
243251
244252
- name: Upload artifacts
245253
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
246254
uses: actions/upload-artifact@v4
247255
with:
248-
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip
249-
name: llama-bin-ubuntu-x64.zip
256+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.zip
257+
name: llama-bin-ubuntu-${{ matrix.build }}.zip
250258

251259
ubuntu-latest-cmake-sanitizer:
252260
runs-on: ubuntu-latest
@@ -459,6 +467,7 @@ jobs:
459467
run: |
460468
cmake -B build -S . \
461469
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
470+
-DGGML_HIP_ROCWMMA_FATTN=ON \
462471
-DGGML_HIP=ON
463472
cmake --build build --config Release -j $(nproc)
464473
@@ -468,6 +477,7 @@ jobs:
468477
cmake -B build2 -S . \
469478
-DCMAKE_C_COMPILER=hipcc \
470479
-DCMAKE_CXX_COMPILER=hipcc \
480+
-DGGML_HIP_ROCWMMA_FATTN=ON \
471481
-DGGML_HIP=ON
472482
cmake --build build2 --config Release -j $(nproc)
473483
@@ -666,6 +676,35 @@ jobs:
666676
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
667677
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
668678
679+
macOS-latest-cmake-visionos:
680+
runs-on: macos-latest
681+
682+
steps:
683+
- name: Clone
684+
id: checkout
685+
uses: actions/checkout@v4
686+
687+
- name: Dependencies
688+
id: depends
689+
continue-on-error: true
690+
run: |
691+
brew update
692+
693+
- name: Build
694+
id: cmake_build
695+
run: |
696+
sysctl -a
697+
cmake -B build -G Xcode \
698+
-DGGML_METAL_USE_BF16=ON \
699+
-DGGML_METAL_EMBED_LIBRARY=ON \
700+
-DLLAMA_BUILD_EXAMPLES=OFF \
701+
-DLLAMA_BUILD_TESTS=OFF \
702+
-DLLAMA_BUILD_SERVER=OFF \
703+
-DCMAKE_SYSTEM_NAME=visionOS \
704+
-DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
705+
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
706+
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
707+
669708
macOS-latest-swift:
670709
runs-on: macos-latest
671710

@@ -702,12 +741,11 @@ jobs:
702741
-DLLAMA_BUILD_SERVER=OFF \
703742
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
704743
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
705-
sudo cmake --install build --config Release
706744
707745
- name: xcodebuild for swift package
708746
id: xcodebuild
709747
run: |
710-
xcodebuild -scheme llama-Package -destination "${{ matrix.destination }}"
748+
./build-xcframework.sh
711749
712750
windows-msys2:
713751
runs-on: windows-latest
@@ -765,7 +803,7 @@ jobs:
765803
env:
766804
OPENBLAS_VERSION: 0.3.23
767805
SDE_VERSION: 9.33.0-2024-01-07
768-
VULKAN_VERSION: 1.3.261.1
806+
VULKAN_VERSION: 1.4.304.1
769807

770808
strategy:
771809
matrix:
@@ -1195,6 +1233,11 @@ jobs:
11951233
id: checkout
11961234
uses: actions/checkout@v4
11971235

1236+
- name: Clone rocWMMA repository
1237+
id: clone_rocwmma
1238+
run: |
1239+
git clone https://github.com/rocm/rocwmma --branch rocm-6.2.4 --depth 1
1240+
11981241
- name: Install
11991242
id: depends
12001243
run: |
@@ -1224,8 +1267,10 @@ jobs:
12241267
cmake -G "Unix Makefiles" -B build -S . `
12251268
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
12261269
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1270+
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
12271271
-DCMAKE_BUILD_TYPE=Release `
12281272
-DGGML_HIP=ON `
1273+
-DGGML_HIP_ROCWMMA_FATTN=ON `
12291274
-DGGML_RPC=ON
12301275
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
12311276
@@ -1244,6 +1289,11 @@ jobs:
12441289
with:
12451290
fetch-depth: 0
12461291

1292+
- name: Clone rocWMMA repository
1293+
id: clone_rocwmma
1294+
run: |
1295+
git clone https://github.com/rocm/rocwmma --branch rocm-6.2.4 --depth 1
1296+
12471297
- name: ccache
12481298
uses: hendrikmuhs/ccache-action@v1.2.16
12491299
with:
@@ -1273,8 +1323,10 @@ jobs:
12731323
cmake -G "Unix Makefiles" -B build -S . `
12741324
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
12751325
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1326+
-DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
12761327
-DCMAKE_BUILD_TYPE=Release `
12771328
-DAMDGPU_TARGETS=${{ matrix.gpu_target }} `
1329+
-DGGML_HIP_ROCWMMA_FATTN=ON `
12781330
-DGGML_HIP=ON `
12791331
-DGGML_RPC=ON
12801332
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
@@ -1313,6 +1365,8 @@ jobs:
13131365
steps:
13141366
- name: Checkout code
13151367
uses: actions/checkout@v4
1368+
with:
1369+
fetch-depth: 0
13161370

13171371
- name: Build
13181372
id: cmake_build
@@ -1328,15 +1382,40 @@ jobs:
13281382
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
13291383
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
13301384
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
1331-
sudo cmake --install build --config Release
13321385
13331386
- name: xcodebuild for swift package
13341387
id: xcodebuild
13351388
run: |
1336-
xcodebuild -scheme llama-Package -destination 'generic/platform=iOS'
1389+
./build-xcframework.sh
13371390
13381391
- name: Build Xcode project
1339-
run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
1392+
run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build
1393+
1394+
- name: Determine tag name
1395+
id: tag
1396+
shell: bash
1397+
run: |
1398+
BUILD_NUMBER="$(git rev-list --count HEAD)"
1399+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1400+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1401+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1402+
else
1403+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1404+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1405+
fi
1406+
1407+
- name: Pack artifacts
1408+
id: pack_artifacts
1409+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1410+
run: |
1411+
zip --symlinks -r llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework
1412+
1413+
- name: Upload artifacts
1414+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1415+
uses: actions/upload-artifact@v4
1416+
with:
1417+
path: llama-${{ steps.tag.outputs.name }}-xcframework.zip
1418+
name: llama-${{ steps.tag.outputs.name }}-xcframework
13401419

13411420
android-build:
13421421
runs-on: ubuntu-latest

.github/workflows/server.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ jobs:
161161
- name: Tests
162162
id: server_integration_tests
163163
if: ${{ matrix.sanitizer == '' }}
164+
env:
165+
GITHUB_ACTIONS: "true"
164166
run: |
165167
cd examples/server/tests
166168
./tests.sh

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ lcov-report/
4545
tags
4646
.build/
4747
build*
48+
release
49+
debug
4850
!build-info.cmake
4951
!build-info.cpp.in
5052
!build-info.sh

0 commit comments

Comments
 (0)