1
0

build.yml 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. name: CI
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. inputs:
  5. create_release:
  6. description: 'Create new release'
  7. required: true
  8. type: boolean
  9. push:
  10. branches:
  11. - master
  12. paths: ['.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal']
  13. pull_request:
  14. types: [opened, synchronize, reopened]
  15. paths: ['.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cuh', '**/*.swift', '**/*.m', '**/*.metal']
  16. concurrency:
  17. group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  18. cancel-in-progress: true
  19. # Fine-grant permission
  20. # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
  21. permissions:
  22. contents: write # for creating release
  23. env:
  24. BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
  25. GGML_NLOOP: 3
  26. GGML_N_THREADS: 1
  27. LLAMA_LOG_COLORS: 1
  28. LLAMA_LOG_PREFIX: 1
  29. LLAMA_LOG_TIMESTAMPS: 1
  30. jobs:
  31. macOS-latest-cmake-arm64:
  32. runs-on: macos-14
  33. steps:
  34. - name: Clone
  35. id: checkout
  36. uses: actions/checkout@v4
  37. with:
  38. fetch-depth: 0
  39. - name: Dependencies
  40. id: depends
  41. continue-on-error: true
  42. run: |
  43. brew update
  44. - name: Build
  45. id: cmake_build
  46. run: |
  47. sysctl -a
  48. mkdir build
  49. cd build
  50. cmake .. \
  51. -DLLAMA_FATAL_WARNINGS=ON \
  52. -DLLAMA_CURL=ON \
  53. -DGGML_METAL_USE_BF16=ON \
  54. -DGGML_METAL_EMBED_LIBRARY=ON \
  55. -DGGML_RPC=ON \
  56. -DBUILD_SHARED_LIBS=OFF
  57. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  58. - name: Test
  59. id: cmake_test
  60. run: |
  61. cd build
  62. ctest -L 'main|curl' --verbose --timeout 900
  63. - name: Determine tag name
  64. id: tag
  65. shell: bash
  66. run: |
  67. BUILD_NUMBER="$(git rev-list --count HEAD)"
  68. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  69. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  70. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  71. else
  72. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  73. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  74. fi
  75. - name: Pack artifacts
  76. id: pack_artifacts
  77. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  78. run: |
  79. cp LICENSE ./build/bin/
  80. zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip ./build/bin/*
  81. - name: Upload artifacts
  82. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  83. uses: actions/upload-artifact@v4
  84. with:
  85. path: llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip
  86. name: llama-bin-macos-arm64.zip
  87. macOS-latest-cmake-x64:
  88. runs-on: macos-13
  89. steps:
  90. - name: Clone
  91. id: checkout
  92. uses: actions/checkout@v4
  93. with:
  94. fetch-depth: 0
  95. - name: Dependencies
  96. id: depends
  97. continue-on-error: true
  98. run: |
  99. brew update
  100. - name: Build
  101. id: cmake_build
  102. run: |
  103. sysctl -a
  104. # Metal is disabled due to intermittent failures with Github runners not having a GPU:
  105. # https://github.com/ggerganov/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
  106. cmake -B build \
  107. -DLLAMA_FATAL_WARNINGS=ON \
  108. -DLLAMA_CURL=ON \
  109. -DGGML_METAL=OFF \
  110. -DGGML_RPC=ON \
  111. -DBUILD_SHARED_LIBS=OFF
  112. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  113. - name: Test
  114. id: cmake_test
  115. run: |
  116. cd build
  117. ctest -L main --verbose --timeout 900
  118. - name: Determine tag name
  119. id: tag
  120. shell: bash
  121. run: |
  122. BUILD_NUMBER="$(git rev-list --count HEAD)"
  123. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  124. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  125. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  126. else
  127. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  128. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  129. fi
  130. - name: Pack artifacts
  131. id: pack_artifacts
  132. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  133. run: |
  134. cp LICENSE ./build/bin/
  135. zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip ./build/bin/*
  136. - name: Upload artifacts
  137. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  138. uses: actions/upload-artifact@v4
  139. with:
  140. path: llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip
  141. name: llama-bin-macos-x64.zip
  142. ubuntu-latest-cmake:
  143. runs-on: ubuntu-latest
  144. steps:
  145. - name: Clone
  146. id: checkout
  147. uses: actions/checkout@v4
  148. with:
  149. fetch-depth: 0
  150. - name: Dependencies
  151. id: depends
  152. run: |
  153. sudo apt-get update
  154. sudo apt-get install build-essential libcurl4-openssl-dev
  155. - name: Build
  156. id: cmake_build
  157. run: |
  158. mkdir build
  159. cd build
  160. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_CURL=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=OFF
  161. cmake --build . --config Release -j $(nproc)
  162. - name: Test
  163. id: cmake_test
  164. run: |
  165. cd build
  166. ctest -L 'main|curl' --verbose --timeout 900
  167. - name: Test llama2c conversion
  168. id: llama2c_test
  169. run: |
  170. cd build
  171. echo "Fetch tokenizer"
  172. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
  173. echo "Fetch llama2c model"
  174. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
  175. ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
  176. ./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
  177. - name: Determine tag name
  178. id: tag
  179. shell: bash
  180. run: |
  181. BUILD_NUMBER="$(git rev-list --count HEAD)"
  182. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  183. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  184. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  185. else
  186. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  187. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  188. fi
  189. - name: Pack artifacts
  190. id: pack_artifacts
  191. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  192. run: |
  193. cp LICENSE ./build/bin/
  194. zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip ./build/bin/*
  195. - name: Upload artifacts
  196. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  197. uses: actions/upload-artifact@v4
  198. with:
  199. path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip
  200. name: llama-bin-ubuntu-x64.zip
  201. ubuntu-latest-cmake-sanitizer:
  202. runs-on: ubuntu-latest
  203. continue-on-error: true
  204. strategy:
  205. matrix:
  206. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  207. build_type: [Debug, Release]
  208. steps:
  209. - name: Clone
  210. id: checkout
  211. uses: actions/checkout@v4
  212. - name: Dependencies
  213. id: depends
  214. run: |
  215. sudo apt-get update
  216. sudo apt-get install build-essential
  217. - name: Build
  218. id: cmake_build
  219. if: ${{ matrix.sanitizer != 'THREAD' }}
  220. run: |
  221. mkdir build
  222. cd build
  223. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  224. cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
  225. - name: Build (no OpenMP)
  226. id: cmake_build_no_openmp
  227. if: ${{ matrix.sanitizer == 'THREAD' }}
  228. run: |
  229. mkdir build
  230. cd build
  231. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DGGML_OPENMP=OFF
  232. cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
  233. - name: Test
  234. id: cmake_test
  235. run: |
  236. cd build
  237. ctest -L main --verbose --timeout 900
  238. ubuntu-latest-cmake-rpc:
  239. runs-on: ubuntu-latest
  240. continue-on-error: true
  241. steps:
  242. - name: Clone
  243. id: checkout
  244. uses: actions/checkout@v4
  245. - name: Dependencies
  246. id: depends
  247. run: |
  248. sudo apt-get update
  249. sudo apt-get install build-essential
  250. - name: Build
  251. id: cmake_build
  252. run: |
  253. mkdir build
  254. cd build
  255. cmake -DGGML_RPC=ON ..
  256. cmake --build . --config Release -j $(nproc)
  257. - name: Test
  258. id: cmake_test
  259. run: |
  260. cd build
  261. ctest -L main --verbose
  262. ubuntu-22-cmake-vulkan:
  263. runs-on: ubuntu-22.04
  264. steps:
  265. - name: Clone
  266. id: checkout
  267. uses: actions/checkout@v4
  268. - name: Dependencies
  269. id: depends
  270. run: |
  271. wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
  272. sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
  273. sudo apt-get update -y
  274. sudo apt-get install -y build-essential vulkan-sdk
  275. - name: Build
  276. id: cmake_build
  277. run: |
  278. mkdir build
  279. cd build
  280. cmake -DGGML_VULKAN=ON ..
  281. cmake --build . --config Release -j $(nproc)
  282. ubuntu-22-cmake-hip:
  283. runs-on: ubuntu-22.04
  284. container: rocm/dev-ubuntu-22.04:6.0.2
  285. steps:
  286. - name: Clone
  287. id: checkout
  288. uses: actions/checkout@v4
  289. - name: Dependencies
  290. id: depends
  291. run: |
  292. sudo apt-get update
  293. sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev
  294. - name: Build with native CMake HIP support
  295. id: cmake_build
  296. run: |
  297. cmake -B build -S . -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" -DGGML_HIP=ON
  298. cmake --build build --config Release -j $(nproc)
  299. - name: Build with legacy HIP support
  300. id: cmake_build_legacy_hip
  301. run: |
  302. cmake -B build2 -S . -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc -DGGML_HIP=ON
  303. cmake --build build2 --config Release -j $(nproc)
  304. ubuntu-22-cmake-musa:
  305. runs-on: ubuntu-22.04
  306. container: mthreads/musa:rc3.1.0-devel-ubuntu22.04
  307. steps:
  308. - name: Clone
  309. id: checkout
  310. uses: actions/checkout@v4
  311. - name: Dependencies
  312. id: depends
  313. run: |
  314. apt-get update
  315. apt-get install -y build-essential git cmake libcurl4-openssl-dev
  316. - name: Build with native CMake MUSA support
  317. id: cmake_build
  318. run: |
  319. cmake -B build -S . -DGGML_MUSA=ON
  320. cmake --build build --config Release -j $(nproc)
  321. ubuntu-22-cmake-sycl:
  322. runs-on: ubuntu-22.04
  323. continue-on-error: true
  324. steps:
  325. - uses: actions/checkout@v4
  326. - name: add oneAPI to apt
  327. shell: bash
  328. run: |
  329. cd /tmp
  330. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  331. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  332. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  333. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  334. - name: install oneAPI dpcpp compiler
  335. shell: bash
  336. run: |
  337. sudo apt update
  338. sudo apt install intel-oneapi-compiler-dpcpp-cpp
  339. - name: install oneAPI MKL library
  340. shell: bash
  341. run: |
  342. sudo apt install intel-oneapi-mkl-devel
  343. - name: Clone
  344. id: checkout
  345. uses: actions/checkout@v4
  346. - name: Build
  347. id: cmake_build
  348. run: |
  349. source /opt/intel/oneapi/setvars.sh
  350. mkdir build
  351. cd build
  352. cmake -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ..
  353. cmake --build . --config Release -j $(nproc)
  354. ubuntu-22-cmake-sycl-fp16:
  355. runs-on: ubuntu-22.04
  356. continue-on-error: true
  357. steps:
  358. - uses: actions/checkout@v4
  359. - name: add oneAPI to apt
  360. shell: bash
  361. run: |
  362. cd /tmp
  363. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  364. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  365. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  366. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  367. - name: install oneAPI dpcpp compiler
  368. shell: bash
  369. run: |
  370. sudo apt update
  371. sudo apt install intel-oneapi-compiler-dpcpp-cpp
  372. - name: install oneAPI MKL library
  373. shell: bash
  374. run: |
  375. sudo apt install intel-oneapi-mkl-devel
  376. - name: Clone
  377. id: checkout
  378. uses: actions/checkout@v4
  379. - name: Build
  380. id: cmake_build
  381. run: |
  382. source /opt/intel/oneapi/setvars.sh
  383. mkdir build
  384. cd build
  385. cmake -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON ..
  386. cmake --build . --config Release -j $(nproc)
  387. # TODO: build with GGML_METAL=OFF because test-backend-ops fail on "Apple Paravirtual device" and I don't know
  388. # how to debug it.
  389. # ref: https://github.com/ggerganov/llama.cpp/actions/runs/7132125951/job/19422043567?pr=4359#step:5:6584
  390. # would be great if we fix these
  391. macOS-latest-cmake:
  392. runs-on: macos-latest
  393. steps:
  394. - name: Clone
  395. id: checkout
  396. uses: actions/checkout@v4
  397. - name: Dependencies
  398. id: depends
  399. continue-on-error: true
  400. run: |
  401. brew update
  402. - name: Build
  403. id: cmake_build
  404. run: |
  405. sysctl -a
  406. mkdir build
  407. cd build
  408. cmake -DLLAMA_FATAL_WARNINGS=ON -DGGML_METAL=OFF ..
  409. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  410. - name: Test
  411. id: cmake_test
  412. run: |
  413. cd build
  414. ctest -L main --verbose --timeout 900
  415. macOS-latest-cmake-ios:
  416. runs-on: macos-latest
  417. steps:
  418. - name: Clone
  419. id: checkout
  420. uses: actions/checkout@v4
  421. - name: Dependencies
  422. id: depends
  423. continue-on-error: true
  424. run: |
  425. brew update
  426. - name: Build
  427. id: cmake_build
  428. run: |
  429. sysctl -a
  430. mkdir build
  431. cd build
  432. cmake -G Xcode .. \
  433. -DGGML_METAL_USE_BF16=ON \
  434. -DGGML_METAL_EMBED_LIBRARY=ON \
  435. -DLLAMA_BUILD_EXAMPLES=OFF \
  436. -DLLAMA_BUILD_TESTS=OFF \
  437. -DLLAMA_BUILD_SERVER=OFF \
  438. -DCMAKE_SYSTEM_NAME=iOS \
  439. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  440. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  441. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  442. macOS-latest-cmake-tvos:
  443. runs-on: macos-latest
  444. steps:
  445. - name: Clone
  446. id: checkout
  447. uses: actions/checkout@v4
  448. - name: Dependencies
  449. id: depends
  450. continue-on-error: true
  451. run: |
  452. brew update
  453. - name: Build
  454. id: cmake_build
  455. run: |
  456. sysctl -a
  457. mkdir build
  458. cd build
  459. cmake -G Xcode .. \
  460. -DGGML_METAL_USE_BF16=ON \
  461. -DGGML_METAL_EMBED_LIBRARY=ON \
  462. -DLLAMA_BUILD_EXAMPLES=OFF \
  463. -DLLAMA_BUILD_TESTS=OFF \
  464. -DLLAMA_BUILD_SERVER=OFF \
  465. -DCMAKE_SYSTEM_NAME=tvOS \
  466. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  467. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  468. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  469. macOS-latest-swift:
  470. runs-on: macos-latest
  471. strategy:
  472. matrix:
  473. destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
  474. steps:
  475. - name: Clone
  476. id: checkout
  477. uses: actions/checkout@v4
  478. - name: Dependencies
  479. id: depends
  480. continue-on-error: true
  481. run: |
  482. brew update
  483. - name: Build llama.cpp with CMake
  484. id: cmake_build
  485. run: |
  486. sysctl -a
  487. mkdir build
  488. cd build
  489. cmake -G Xcode .. \
  490. -DGGML_METAL_USE_BF16=ON \
  491. -DGGML_METAL_EMBED_LIBRARY=ON \
  492. -DLLAMA_BUILD_EXAMPLES=OFF \
  493. -DLLAMA_BUILD_TESTS=OFF \
  494. -DLLAMA_BUILD_SERVER=OFF \
  495. -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
  496. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  497. sudo cmake --install . --config Release
  498. - name: xcodebuild for swift package
  499. id: xcodebuild
  500. run: |
  501. xcodebuild -scheme llama-Package -destination "${{ matrix.destination }}"
  502. windows-msys2:
  503. runs-on: windows-latest
  504. strategy:
  505. fail-fast: false
  506. matrix:
  507. include:
  508. - { sys: UCRT64, env: ucrt-x86_64, build: Release }
  509. - { sys: CLANG64, env: clang-x86_64, build: Release }
  510. steps:
  511. - name: Clone
  512. uses: actions/checkout@v4
  513. - name: Setup ${{ matrix.sys }}
  514. uses: msys2/setup-msys2@v2
  515. with:
  516. update: true
  517. msystem: ${{matrix.sys}}
  518. install: >-
  519. base-devel
  520. mingw-w64-${{matrix.env}}-toolchain
  521. mingw-w64-${{matrix.env}}-cmake
  522. mingw-w64-${{matrix.env}}-openblas
  523. - name: Build using CMake
  524. shell: msys2 {0}
  525. run: |
  526. cmake -B build
  527. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  528. - name: Clean after building using CMake
  529. shell: msys2 {0}
  530. run: |
  531. rm -rf build
  532. - name: Build using CMake w/ OpenBLAS
  533. shell: msys2 {0}
  534. run: |
  535. cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
  536. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  537. windows-latest-cmake:
  538. runs-on: windows-latest
  539. env:
  540. OPENBLAS_VERSION: 0.3.23
  541. SDE_VERSION: 9.33.0-2024-01-07
  542. VULKAN_VERSION: 1.3.261.1
  543. strategy:
  544. matrix:
  545. include:
  546. - build: 'noavx-x64'
  547. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DBUILD_SHARED_LIBS=ON'
  548. - build: 'avx2-x64'
  549. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=ON'
  550. - build: 'avx-x64'
  551. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX2=OFF -DBUILD_SHARED_LIBS=ON'
  552. - build: 'avx512-x64'
  553. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX512=ON -DBUILD_SHARED_LIBS=ON'
  554. - build: 'openblas-x64'
  555. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BLAS=ON -DBUILD_SHARED_LIBS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
  556. - build: 'kompute-x64'
  557. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -DBUILD_SHARED_LIBS=ON'
  558. - build: 'vulkan-x64'
  559. defines: '-DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_VULKAN=ON -DBUILD_SHARED_LIBS=ON'
  560. - build: 'llvm-arm64'
  561. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  562. - build: 'msvc-arm64'
  563. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  564. steps:
  565. - name: Clone
  566. id: checkout
  567. uses: actions/checkout@v4
  568. with:
  569. fetch-depth: 0
  570. - name: Clone Kompute submodule
  571. id: clone_kompute
  572. if: ${{ matrix.build == 'kompute-x64' }}
  573. run: |
  574. git submodule update --init ggml/src/ggml-kompute/kompute
  575. - name: Download OpenBLAS
  576. id: get_openblas
  577. if: ${{ matrix.build == 'openblas-x64' }}
  578. run: |
  579. curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}/OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip"
  580. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  581. mkdir $env:RUNNER_TEMP/openblas
  582. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  583. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  584. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  585. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  586. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  587. - name: Install Vulkan SDK
  588. id: get_vulkan
  589. if: ${{ matrix.build == 'kompute-x64' || matrix.build == 'vulkan-x64' }}
  590. run: |
  591. curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe"
  592. & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
  593. Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
  594. Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
  595. - name: Install Ninja
  596. id: install_ninja
  597. run: |
  598. choco install ninja
  599. - name: Build
  600. id: cmake_build
  601. run: |
  602. cmake -S . -B build ${{ matrix.defines }}
  603. cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
  604. - name: Add libopenblas.dll
  605. id: add_libopenblas_dll
  606. if: ${{ matrix.build == 'openblas-x64' }}
  607. run: |
  608. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  609. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  610. - name: Check AVX512F support
  611. id: check_avx512f
  612. if: ${{ matrix.build == 'avx512-x64' }}
  613. continue-on-error: true
  614. run: |
  615. cd build
  616. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  617. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  618. $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
  619. echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
  620. & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
  621. .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
  622. - name: Test
  623. id: cmake_test
  624. # not all machines have native AVX-512
  625. if: ${{ matrix.build != 'msvc-arm64' && matrix.build != 'llvm-arm64' && matrix.build != 'kompute-x64' && matrix.build != 'vulkan-x64' && (matrix.build != 'avx512-x64' || env.HAS_AVX512F == '1') }}
  626. run: |
  627. cd build
  628. ctest -L main -C Release --verbose --timeout 900
  629. - name: Test (Intel SDE)
  630. id: cmake_test_sde
  631. if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
  632. run: |
  633. curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
  634. # for some weird reason windows tar doesn't like sde tar.xz
  635. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
  636. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
  637. $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
  638. cd build
  639. $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
  640. & $sde -future -- ctest -L main -C Release --verbose --timeout 900
  641. - name: Determine tag name
  642. id: tag
  643. shell: bash
  644. run: |
  645. BUILD_NUMBER="$(git rev-list --count HEAD)"
  646. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  647. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  648. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  649. else
  650. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  651. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  652. fi
  653. - name: Pack artifacts
  654. id: pack_artifacts
  655. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  656. run: |
  657. Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
  658. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip .\build\bin\Release\*
  659. - name: Upload artifacts
  660. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  661. uses: actions/upload-artifact@v4
  662. with:
  663. path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}.zip
  664. name: llama-bin-win-${{ matrix.build }}.zip
  665. ubuntu-latest-cmake-cuda:
  666. runs-on: ubuntu-latest
  667. container: nvidia/cuda:12.6.2-devel-ubuntu24.04
  668. steps:
  669. - name: Clone
  670. id: checkout
  671. uses: actions/checkout@v4
  672. - name: Install dependencies
  673. env:
  674. DEBIAN_FRONTEND: noninteractive
  675. run: |
  676. apt update
  677. apt install -y cmake build-essential ninja-build libgomp1 git
  678. - name: Build with CMake
  679. run: |
  680. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=89-real -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined -DLLAMA_FATAL_WARNINGS=ON
  681. cmake --build build
  682. windows-2019-cmake-cuda:
  683. runs-on: windows-2019
  684. strategy:
  685. matrix:
  686. cuda: ['12.4', '11.7']
  687. build: ['cuda']
  688. steps:
  689. - name: Clone
  690. id: checkout
  691. uses: actions/checkout@v4
  692. with:
  693. fetch-depth: 0
  694. - name: Install Cuda Toolkit 11.7
  695. if: ${{ matrix.cuda == '11.7' }}
  696. run: |
  697. mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
  698. choco install unzip -y
  699. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.7.99-archive.zip"
  700. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-11.7.99-archive.zip"
  701. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-11.7.99-archive.zip"
  702. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.7.4.6-archive.zip"
  703. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-11.7.91-archive.zip"
  704. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-11.7.91-archive.zip"
  705. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-11.7.101-archive.zip"
  706. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-11.7.91-archive.zip"
  707. unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"
  708. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cudart-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  709. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvcc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  710. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvrtc-windows-x86_64-11.7.99-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  711. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libcublas-windows-x86_64-11.7.4.6-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  712. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvtx-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  713. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\visual_studio_integration-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  714. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_nvprof-windows-x86_64-11.7.101-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  715. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\cuda_cccl-windows-x86_64-11.7.91-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" /E /I /H /Y
  716. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  717. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  718. echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  719. echo "CUDA_PATH_V11_7=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  720. - name: Install Cuda Toolkit 12.4
  721. if: ${{ matrix.cuda == '12.4' }}
  722. run: |
  723. mkdir -p "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
  724. choco install unzip -y
  725. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-12.4.127-archive.zip"
  726. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-12.4.131-archive.zip"
  727. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-12.4.127-archive.zip"
  728. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-12.4.5.8-archive.zip"
  729. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-12.4.127-archive.zip"
  730. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-12.4.127-archive.zip"
  731. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-12.4.127-archive.zip"
  732. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-12.4.127-archive.zip"
  733. curl -O "https://developer.download.nvidia.com/compute/cuda/redist/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-12.4.127-archive.zip"
  734. unzip '*.zip' -d "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
  735. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cudart-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  736. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvcc-windows-x86_64-12.4.131-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  737. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvrtc-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  738. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libcublas-windows-x86_64-12.4.5.8-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  739. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvtx-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  740. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_profiler_api-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  741. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\visual_studio_integration-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  742. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_nvprof-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  743. xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\cuda_cccl-windows-x86_64-12.4.127-archive\*" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" /E /I /H /Y
  744. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  745. echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  746. echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  747. echo "CUDA_PATH_V12_4=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
  748. - name: Install ccache
  749. uses: hendrikmuhs/ccache-action@v1.2
  750. with:
  751. key: ${{ github.job }}-${{ matrix.cuda }}-${{ matrix.build }}
  752. - name: Install Ninja
  753. id: install_ninja
  754. run: |
  755. choco install ninja
  756. - name: Build
  757. id: cmake_build
  758. shell: cmd
  759. run: |
  760. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  761. cmake -S . -B build -G "Ninja Multi-Config" -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=ON -DGGML_RPC=ON
  762. set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
  763. cmake --build build --config Release -j %NINJA_JOBS% -t ggml
  764. cmake --build build --config Release
  765. - name: Determine tag name
  766. id: tag
  767. shell: bash
  768. run: |
  769. BUILD_NUMBER="$(git rev-list --count HEAD)"
  770. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  771. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  772. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  773. else
  774. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  775. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  776. fi
  777. - name: Pack artifacts
  778. id: pack_artifacts
  779. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  780. run: |
  781. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
  782. - name: Upload artifacts
  783. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  784. uses: actions/upload-artifact@v4
  785. with:
  786. path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
  787. name: llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  788. - name: Copy and pack Cuda runtime
  789. if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
  790. run: |
  791. echo "Cuda install location: ${{ env.CUDA_PATH }}"
  792. $dst='.\build\bin\cudart\'
  793. robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
  794. robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
  795. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip $dst\*
  796. - name: Upload Cuda runtime
  797. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  798. uses: actions/upload-artifact@v4
  799. with:
  800. path: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  801. name: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  802. windows-latest-cmake-sycl:
  803. runs-on: windows-latest
  804. defaults:
  805. run:
  806. shell: bash
  807. env:
  808. WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b380d914-366b-4b77-a74a-05e3c38b3514/intel-oneapi-base-toolkit-2025.0.0.882_offline.exe
  809. WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
  810. ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
  811. steps:
  812. - name: Clone
  813. id: checkout
  814. uses: actions/checkout@v4
  815. with:
  816. fetch-depth: 0
  817. - name: Install
  818. run: |
  819. scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
  820. - name: Build
  821. id: cmake_build
  822. run: examples/sycl/win-build-sycl.bat
  823. - name: Determine tag name
  824. id: tag
  825. shell: bash
  826. run: |
  827. BUILD_NUMBER="$(git rev-list --count HEAD)"
  828. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  829. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  830. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  831. else
  832. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  833. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  834. fi
  835. - name: Build the release package
  836. id: pack_artifacts
  837. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  838. run: |
  839. echo "cp oneAPI running time dll files in ${{ env.ONEAPI_ROOT }} to ./build/bin"
  840. cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_sycl_blas.5.dll" ./build/bin
  841. cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.2.dll" ./build/bin
  842. cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.2.dll" ./build/bin
  843. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero.dll" ./build/bin
  844. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_opencl.dll" ./build/bin
  845. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_loader.dll" ./build/bin
  846. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_win_proxy_loader.dll" ./build/bin
  847. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl8.dll" ./build/bin
  848. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin
  849. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin
  850. cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin
  851. cp "${{ env.ONEAPI_ROOT }}/dnnl/latest/bin/dnnl.dll" ./build/bin
  852. cp "${{ env.ONEAPI_ROOT }}/tbb/latest/bin/tbb12.dll" ./build/bin
  853. echo "cp oneAPI running time dll files to ./build/bin done"
  854. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip ./build/bin/*
  855. - name: Upload the release package
  856. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  857. uses: actions/upload-artifact@v4
  858. with:
  859. path: llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip
  860. name: llama-bin-win-sycl-x64.zip
  861. windows-latest-cmake-hip:
  862. if: ${{ github.event.inputs.create_release != 'true' }}
  863. runs-on: windows-latest
  864. steps:
  865. - name: Clone
  866. id: checkout
  867. uses: actions/checkout@v4
  868. - name: Install
  869. id: depends
  870. run: |
  871. $ErrorActionPreference = "Stop"
  872. write-host "Downloading AMD HIP SDK Installer"
  873. Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
  874. write-host "Installing AMD HIP SDK"
  875. Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
  876. write-host "Completed AMD HIP SDK installation"
  877. - name: Verify ROCm
  878. id: verify
  879. run: |
  880. & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
  881. - name: Install ccache
  882. uses: hendrikmuhs/ccache-action@v1.2
  883. with:
  884. key: ${{ github.job }}
  885. - name: Build
  886. id: cmake_build
  887. run: |
  888. $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
  889. $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
  890. cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release -DGGML_RPC=ON
  891. cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
  892. windows-latest-cmake-hip-release:
  893. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  894. runs-on: windows-latest
  895. strategy:
  896. matrix:
  897. gpu_target: [gfx1100, gfx1101, gfx1030]
  898. steps:
  899. - name: Clone
  900. id: checkout
  901. uses: actions/checkout@v4
  902. with:
  903. fetch-depth: 0
  904. - name: Install
  905. id: depends
  906. run: |
  907. $ErrorActionPreference = "Stop"
  908. write-host "Downloading AMD HIP SDK Installer"
  909. Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
  910. write-host "Installing AMD HIP SDK"
  911. Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
  912. write-host "Completed AMD HIP SDK installation"
  913. - name: Verify ROCm
  914. id: verify
  915. run: |
  916. & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
  917. - name: Build
  918. id: cmake_build
  919. run: |
  920. $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
  921. $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
  922. cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON
  923. cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
  924. md "build\bin\rocblas\library\"
  925. cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
  926. cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
  927. cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
  928. - name: Determine tag name
  929. id: tag
  930. shell: bash
  931. run: |
  932. BUILD_NUMBER="$(git rev-list --count HEAD)"
  933. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  934. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  935. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  936. else
  937. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  938. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  939. fi
  940. - name: Pack artifacts
  941. id: pack_artifacts
  942. run: |
  943. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
  944. - name: Upload artifacts
  945. uses: actions/upload-artifact@v4
  946. with:
  947. path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
  948. name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
  949. ios-xcode-build:
  950. runs-on: macos-latest
  951. steps:
  952. - name: Checkout code
  953. uses: actions/checkout@v4
  954. - name: Build
  955. id: cmake_build
  956. run: |
  957. sysctl -a
  958. mkdir build
  959. cd build
  960. cmake -G Xcode .. \
  961. -DGGML_METAL_USE_BF16=ON \
  962. -DGGML_METAL_EMBED_LIBRARY=ON \
  963. -DLLAMA_BUILD_EXAMPLES=OFF \
  964. -DLLAMA_BUILD_TESTS=OFF \
  965. -DLLAMA_BUILD_SERVER=OFF \
  966. -DCMAKE_SYSTEM_NAME=iOS \
  967. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  968. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  969. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  970. sudo cmake --install . --config Release
  971. - name: xcodebuild for swift package
  972. id: xcodebuild
  973. run: |
  974. xcodebuild -scheme llama-Package -destination 'generic/platform=iOS'
  975. - name: Build Xcode project
  976. 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
  977. android-build:
  978. runs-on: ubuntu-latest
  979. steps:
  980. - name: Clone
  981. uses: actions/checkout@v4
  982. - name: Set up JDK
  983. uses: actions/setup-java@v3
  984. with:
  985. java-version: 17
  986. distribution: zulu
  987. - name: Setup Android SDK
  988. uses: android-actions/setup-android@v3
  989. with:
  990. log-accepted-android-sdk-licenses: false
  991. - name: Build
  992. run: |
  993. cd examples/llama.android
  994. ./gradlew build --no-daemon
  995. release:
  996. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  997. runs-on: ubuntu-latest
  998. needs:
  999. - ubuntu-latest-cmake
  1000. - macOS-latest-cmake
  1001. - windows-latest-cmake
  1002. - windows-2019-cmake-cuda
  1003. - windows-latest-cmake-hip-release
  1004. - macOS-latest-cmake-arm64
  1005. - macOS-latest-cmake-x64
  1006. steps:
  1007. - name: Clone
  1008. id: checkout
  1009. uses: actions/checkout@v4
  1010. with:
  1011. fetch-depth: 0
  1012. - name: Determine tag name
  1013. id: tag
  1014. shell: bash
  1015. run: |
  1016. BUILD_NUMBER="$(git rev-list --count HEAD)"
  1017. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  1018. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  1019. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  1020. else
  1021. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  1022. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  1023. fi
  1024. - name: Download artifacts
  1025. id: download-artifact
  1026. uses: actions/download-artifact@v4
  1027. with:
  1028. path: ./artifact
  1029. - name: Move artifacts
  1030. id: move_artifacts
  1031. run: mkdir -p ./artifact/release && mv ./artifact/*/*.zip ./artifact/release
  1032. - name: Create release
  1033. id: create_release
  1034. uses: anzz1/action-create-release@v1
  1035. env:
  1036. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1037. with:
  1038. tag_name: ${{ steps.tag.outputs.name }}
  1039. - name: Upload release
  1040. id: upload_release
  1041. uses: actions/github-script@v3
  1042. with:
  1043. github-token: ${{secrets.GITHUB_TOKEN}}
  1044. script: |
  1045. const path = require('path');
  1046. const fs = require('fs');
  1047. const release_id = '${{ steps.create_release.outputs.id }}';
  1048. for (let file of await fs.readdirSync('./artifact/release')) {
  1049. if (path.extname(file) === '.zip') {
  1050. console.log('uploadReleaseAsset', file);
  1051. await github.repos.uploadReleaseAsset({
  1052. owner: context.repo.owner,
  1053. repo: context.repo.repo,
  1054. release_id: release_id,
  1055. name: file,
  1056. data: await fs.readFileSync(`./artifact/release/${file}`)
  1057. });
  1058. }
  1059. }
  1060. # ubuntu-latest-gcc:
  1061. # runs-on: ubuntu-latest
  1062. #
  1063. # strategy:
  1064. # matrix:
  1065. # build: [Debug, Release]
  1066. #
  1067. # steps:
  1068. # - name: Clone
  1069. # uses: actions/checkout@v4
  1070. #
  1071. # - name: Dependencies
  1072. # run: |
  1073. # sudo apt-get update
  1074. # sudo apt-get install build-essential
  1075. # sudo apt-get install cmake
  1076. #
  1077. # - name: Configure
  1078. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1079. #
  1080. # - name: Build
  1081. # run: |
  1082. # make
  1083. #
  1084. # ubuntu-latest-clang:
  1085. # runs-on: ubuntu-latest
  1086. #
  1087. # strategy:
  1088. # matrix:
  1089. # build: [Debug, Release]
  1090. #
  1091. # steps:
  1092. # - name: Clone
  1093. # uses: actions/checkout@v4
  1094. #
  1095. # - name: Dependencies
  1096. # run: |
  1097. # sudo apt-get update
  1098. # sudo apt-get install build-essential
  1099. # sudo apt-get install cmake
  1100. #
  1101. # - name: Configure
  1102. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  1103. #
  1104. # - name: Build
  1105. # run: |
  1106. # make
  1107. #
  1108. # ubuntu-latest-gcc-sanitized:
  1109. # runs-on: ubuntu-latest
  1110. #
  1111. # strategy:
  1112. # matrix:
  1113. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  1114. #
  1115. # steps:
  1116. # - name: Clone
  1117. # uses: actions/checkout@v4
  1118. #
  1119. # - name: Dependencies
  1120. # run: |
  1121. # sudo apt-get update
  1122. # sudo apt-get install build-essential
  1123. # sudo apt-get install cmake
  1124. #
  1125. # - name: Configure
  1126. # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
  1127. #
  1128. # - name: Build
  1129. # run: |
  1130. # make
  1131. #
  1132. # windows:
  1133. # runs-on: windows-latest
  1134. #
  1135. # strategy:
  1136. # matrix:
  1137. # build: [Release]
  1138. # arch: [Win32, x64]
  1139. # include:
  1140. # - arch: Win32
  1141. # s2arc: x86
  1142. # - arch: x64
  1143. # s2arc: x64
  1144. #
  1145. # steps:
  1146. # - name: Clone
  1147. # uses: actions/checkout@v4
  1148. #
  1149. # - name: Add msbuild to PATH
  1150. # uses: microsoft/setup-msbuild@v1
  1151. #
  1152. # - name: Configure
  1153. # run: >
  1154. # cmake -S . -B ./build -A ${{ matrix.arch }}
  1155. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1156. #
  1157. # - name: Build
  1158. # run: |
  1159. # cd ./build
  1160. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  1161. #
  1162. # - name: Upload binaries
  1163. # uses: actions/upload-artifact@v4
  1164. # with:
  1165. # name: llama-bin-${{ matrix.arch }}
  1166. # path: build/bin/${{ matrix.build }}
  1167. #
  1168. # windows-blas:
  1169. # runs-on: windows-latest
  1170. #
  1171. # strategy:
  1172. # matrix:
  1173. # build: [Release]
  1174. # arch: [Win32, x64]
  1175. # blas: [ON]
  1176. # include:
  1177. # - arch: Win32
  1178. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
  1179. # s2arc: x86
  1180. # - arch: x64
  1181. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
  1182. # s2arc: x64
  1183. #
  1184. # steps:
  1185. # - name: Clone
  1186. # uses: actions/checkout@v4
  1187. #
  1188. # - name: Add msbuild to PATH
  1189. # uses: microsoft/setup-msbuild@v1
  1190. #
  1191. # - name: Fetch OpenBLAS
  1192. # if: matrix.blas == 'ON'
  1193. # run: |
  1194. # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
  1195. # 7z x blas.zip -oblas -y
  1196. # copy blas/include/cblas.h .
  1197. # copy blas/include/openblas_config.h .
  1198. # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
  1199. #
  1200. # - name: Configure
  1201. # run: >
  1202. # cmake -S . -B ./build -A ${{ matrix.arch }}
  1203. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1204. # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
  1205. # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
  1206. #
  1207. # - name: Build
  1208. # run: |
  1209. # cd ./build
  1210. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  1211. #
  1212. # - name: Copy libopenblas.dll
  1213. # if: matrix.blas == 'ON'
  1214. # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
  1215. #
  1216. # - name: Upload binaries
  1217. # if: matrix.blas == 'ON'
  1218. # uses: actions/upload-artifact@v4
  1219. # with:
  1220. # name: llama-blas-bin-${{ matrix.arch }}
  1221. # path: build/bin/${{ matrix.build }}
  1222. #
  1223. # emscripten:
  1224. # runs-on: ubuntu-latest
  1225. #
  1226. # strategy:
  1227. # matrix:
  1228. # build: [Release]
  1229. #
  1230. # steps:
  1231. # - name: Clone
  1232. # uses: actions/checkout@v4
  1233. #
  1234. # - name: Dependencies
  1235. # run: |
  1236. # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  1237. # tar -xvf master.tar.gz
  1238. # emsdk-master/emsdk update
  1239. # emsdk-master/emsdk install latest
  1240. # emsdk-master/emsdk activate latest
  1241. #
  1242. # - name: Configure
  1243. # run: echo "tmp"
  1244. #
  1245. # - name: Build
  1246. # run: |
  1247. # pushd emsdk-master
  1248. # source ./emsdk_env.sh
  1249. # popd
  1250. # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1251. # make