@@ -173,7 +173,15 @@ jobs:
173
173
name : llama-bin-macos-x64.zip
174
174
175
175
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 }}
177
185
178
186
steps :
179
187
- name : Clone
@@ -239,14 +247,14 @@ jobs:
239
247
run : |
240
248
cp LICENSE ./build/bin/
241
249
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/*
243
251
244
252
- name : Upload artifacts
245
253
if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
246
254
uses : actions/upload-artifact@v4
247
255
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
250
258
251
259
ubuntu-latest-cmake-sanitizer :
252
260
runs-on : ubuntu-latest
@@ -459,6 +467,7 @@ jobs:
459
467
run : |
460
468
cmake -B build -S . \
461
469
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
470
+ -DGGML_HIP_ROCWMMA_FATTN=ON \
462
471
-DGGML_HIP=ON
463
472
cmake --build build --config Release -j $(nproc)
464
473
@@ -468,6 +477,7 @@ jobs:
468
477
cmake -B build2 -S . \
469
478
-DCMAKE_C_COMPILER=hipcc \
470
479
-DCMAKE_CXX_COMPILER=hipcc \
480
+ -DGGML_HIP_ROCWMMA_FATTN=ON \
471
481
-DGGML_HIP=ON
472
482
cmake --build build2 --config Release -j $(nproc)
473
483
@@ -666,6 +676,35 @@ jobs:
666
676
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
667
677
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
668
678
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
+
669
708
macOS-latest-swift :
670
709
runs-on : macos-latest
671
710
@@ -702,12 +741,11 @@ jobs:
702
741
-DLLAMA_BUILD_SERVER=OFF \
703
742
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
704
743
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
705
- sudo cmake --install build --config Release
706
744
707
745
- name : xcodebuild for swift package
708
746
id : xcodebuild
709
747
run : |
710
- xcodebuild -scheme llama-Package -destination "${{ matrix.destination }}"
748
+ ./build-xcframework.sh
711
749
712
750
windows-msys2 :
713
751
runs-on : windows-latest
@@ -765,7 +803,7 @@ jobs:
765
803
env :
766
804
OPENBLAS_VERSION : 0.3.23
767
805
SDE_VERSION : 9.33.0-2024-01-07
768
- VULKAN_VERSION : 1.3.261 .1
806
+ VULKAN_VERSION : 1.4.304 .1
769
807
770
808
strategy :
771
809
matrix :
@@ -1195,6 +1233,11 @@ jobs:
1195
1233
id : checkout
1196
1234
uses : actions/checkout@v4
1197
1235
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
+
1198
1241
- name : Install
1199
1242
id : depends
1200
1243
run : |
@@ -1224,8 +1267,10 @@ jobs:
1224
1267
cmake -G "Unix Makefiles" -B build -S . `
1225
1268
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
1226
1269
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1270
+ -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
1227
1271
-DCMAKE_BUILD_TYPE=Release `
1228
1272
-DGGML_HIP=ON `
1273
+ -DGGML_HIP_ROCWMMA_FATTN=ON `
1229
1274
-DGGML_RPC=ON
1230
1275
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1231
1276
@@ -1244,6 +1289,11 @@ jobs:
1244
1289
with :
1245
1290
fetch-depth : 0
1246
1291
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
+
1247
1297
- name : ccache
1248
1298
uses : hendrikmuhs/ccache-action@v1.2.16
1249
1299
with :
@@ -1273,8 +1323,10 @@ jobs:
1273
1323
cmake -G "Unix Makefiles" -B build -S . `
1274
1324
-DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
1275
1325
-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
1326
+ -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
1276
1327
-DCMAKE_BUILD_TYPE=Release `
1277
1328
-DAMDGPU_TARGETS=${{ matrix.gpu_target }} `
1329
+ -DGGML_HIP_ROCWMMA_FATTN=ON `
1278
1330
-DGGML_HIP=ON `
1279
1331
-DGGML_RPC=ON
1280
1332
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
@@ -1313,6 +1365,8 @@ jobs:
1313
1365
steps :
1314
1366
- name : Checkout code
1315
1367
uses : actions/checkout@v4
1368
+ with :
1369
+ fetch-depth : 0
1316
1370
1317
1371
- name : Build
1318
1372
id : cmake_build
@@ -1328,15 +1382,40 @@ jobs:
1328
1382
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
1329
1383
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
1330
1384
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
1331
- sudo cmake --install build --config Release
1332
1385
1333
1386
- name : xcodebuild for swift package
1334
1387
id : xcodebuild
1335
1388
run : |
1336
- xcodebuild -scheme llama-Package -destination 'generic/platform=iOS'
1389
+ ./build-xcframework.sh
1337
1390
1338
1391
- 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
1340
1419
1341
1420
android-build :
1342
1421
runs-on : ubuntu-latest
0 commit comments