build.yml 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171
  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/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m']
  13. pull_request:
  14. types: [opened, synchronize, reopened]
  15. paths: ['**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m']
  16. concurrency:
  17. group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  18. cancel-in-progress: true
  19. env:
  20. BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
  21. GGML_NLOOP: 3
  22. GGML_N_THREADS: 1
  23. jobs:
  24. macOS-latest-cmake-arm64:
  25. runs-on: macos-14
  26. steps:
  27. - name: Clone
  28. id: checkout
  29. uses: actions/checkout@v4
  30. - name: Dependencies
  31. id: depends
  32. continue-on-error: true
  33. run: |
  34. brew update
  35. - name: Build
  36. id: cmake_build
  37. run: |
  38. sysctl -a
  39. mkdir build
  40. cd build
  41. cmake -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_METAL_EMBED_LIBRARY=ON -DLLAMA_CURL=ON ..
  42. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  43. - name: Test
  44. id: cmake_test
  45. run: |
  46. cd build
  47. ctest -L 'main|curl' --verbose --timeout 900
  48. - name: Determine tag name
  49. id: tag
  50. shell: bash
  51. run: |
  52. BUILD_NUMBER="$(git rev-list --count HEAD)"
  53. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  54. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  55. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  56. else
  57. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  58. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  59. fi
  60. - name: Pack artifacts
  61. id: pack_artifacts
  62. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  63. run: |
  64. cp LICENSE ./build/bin/
  65. zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip ./build/bin/*
  66. - name: Upload artifacts
  67. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  68. uses: actions/upload-artifact@v4
  69. with:
  70. path: llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.zip
  71. name: llama-bin-macos-arm64.zip
  72. macOS-latest-cmake-x64:
  73. runs-on: macos-latest
  74. steps:
  75. - name: Clone
  76. id: checkout
  77. uses: actions/checkout@v4
  78. - name: Dependencies
  79. id: depends
  80. continue-on-error: true
  81. run: |
  82. brew update
  83. - name: Build
  84. id: cmake_build
  85. run: |
  86. sysctl -a
  87. mkdir build
  88. cd build
  89. # Metal is disabled due to intermittent failures with Github runners not having a GPU:
  90. # https://github.com/ggerganov/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
  91. cmake -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_METAL=OFF -DLLAMA_CURL=ON ..
  92. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  93. - name: Test
  94. id: cmake_test
  95. run: |
  96. cd build
  97. ctest -L main --verbose --timeout 900
  98. - name: Determine tag name
  99. id: tag
  100. shell: bash
  101. run: |
  102. BUILD_NUMBER="$(git rev-list --count HEAD)"
  103. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  104. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  105. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  106. else
  107. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  108. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  109. fi
  110. - name: Pack artifacts
  111. id: pack_artifacts
  112. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  113. run: |
  114. cp LICENSE ./build/bin/
  115. zip -r llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip ./build/bin/*
  116. - name: Upload artifacts
  117. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  118. uses: actions/upload-artifact@v4
  119. with:
  120. path: llama-${{ steps.tag.outputs.name }}-bin-macos-x64.zip
  121. name: llama-bin-macos-x64.zip
  122. ubuntu-focal-make:
  123. runs-on: ubuntu-20.04
  124. env:
  125. LLAMA_NODE_AVAILABLE: true
  126. LLAMA_PYTHON_AVAILABLE: true
  127. steps:
  128. - name: Clone
  129. id: checkout
  130. uses: actions/checkout@v4
  131. - name: Dependencies
  132. id: depends
  133. run: |
  134. sudo apt-get update
  135. sudo apt-get install build-essential gcc-8
  136. - uses: actions/setup-node@v4
  137. with:
  138. node-version: "20"
  139. - uses: actions/setup-python@v5
  140. with:
  141. python-version: "3.11"
  142. - name: Build
  143. id: make_build
  144. env:
  145. LLAMA_FATAL_WARNINGS: 1
  146. run: |
  147. CC=gcc-8 make -j $(nproc)
  148. - name: Test
  149. id: make_test
  150. run: |
  151. CC=gcc-8 make tests -j $(nproc)
  152. make test -j $(nproc)
  153. ubuntu-focal-make-curl:
  154. runs-on: ubuntu-20.04
  155. steps:
  156. - name: Clone
  157. id: checkout
  158. uses: actions/checkout@v4
  159. - name: Dependencies
  160. id: depends
  161. run: |
  162. sudo apt-get update
  163. sudo apt-get install build-essential gcc-8 libcurl4-openssl-dev
  164. - name: Build
  165. id: make_build
  166. env:
  167. LLAMA_FATAL_WARNINGS: 1
  168. LLAMA_CURL: 1
  169. run: |
  170. CC=gcc-8 make -j $(nproc)
  171. ubuntu-latest-cmake:
  172. runs-on: ubuntu-latest
  173. steps:
  174. - name: Clone
  175. id: checkout
  176. uses: actions/checkout@v4
  177. - name: Dependencies
  178. id: depends
  179. run: |
  180. sudo apt-get update
  181. sudo apt-get install build-essential libcurl4-openssl-dev
  182. - name: Build
  183. id: cmake_build
  184. run: |
  185. mkdir build
  186. cd build
  187. cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_CURL=ON
  188. cmake --build . --config Release -j $(nproc)
  189. - name: Test
  190. id: cmake_test
  191. run: |
  192. cd build
  193. ctest -L 'main|curl' --verbose --timeout 900
  194. - name: Test llama2c conversion
  195. id: llama2c_test
  196. run: |
  197. cd build
  198. echo "Fetch tokenizer"
  199. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
  200. echo "Fetch llama2c model"
  201. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
  202. ./bin/convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
  203. ./bin/main -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
  204. # ubuntu-latest-cmake-sanitizer:
  205. # runs-on: ubuntu-latest
  206. #
  207. # continue-on-error: true
  208. #
  209. # strategy:
  210. # matrix:
  211. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  212. # build_type: [Debug, Release]
  213. #
  214. # steps:
  215. # - name: Clone
  216. # id: checkout
  217. # uses: actions/checkout@v4
  218. #
  219. # - name: Dependencies
  220. # id: depends
  221. # run: |
  222. # sudo apt-get update
  223. # sudo apt-get install build-essential
  224. #
  225. # - name: Build
  226. # id: cmake_build
  227. # run: |
  228. # mkdir build
  229. # cd build
  230. # cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  231. # cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
  232. #
  233. # - name: Test
  234. # id: cmake_test
  235. # run: |
  236. # cd build
  237. # ctest -L main --verbose --timeout 900
  238. ubuntu-latest-cmake-mpi:
  239. runs-on: ubuntu-latest
  240. continue-on-error: true
  241. strategy:
  242. matrix:
  243. mpi_library: [mpich, libopenmpi-dev]
  244. steps:
  245. - name: Clone
  246. id: checkout
  247. uses: actions/checkout@v4
  248. - name: Dependencies
  249. id: depends
  250. run: |
  251. sudo apt-get update
  252. sudo apt-get install build-essential ${{ matrix.mpi_library }}
  253. - name: Build
  254. id: cmake_build
  255. run: |
  256. mkdir build
  257. cd build
  258. cmake -DLLAMA_MPI=ON ..
  259. cmake --build . --config Release -j $(nproc)
  260. - name: Test
  261. id: cmake_test
  262. run: |
  263. cd build
  264. ctest -L main --verbose
  265. ubuntu-22-cmake-vulkan:
  266. runs-on: ubuntu-22.04
  267. steps:
  268. - name: Clone
  269. id: checkout
  270. uses: actions/checkout@v4
  271. - name: Dependencies
  272. id: depends
  273. run: |
  274. sudo apt-get update
  275. sudo apt-get install build-essential libvulkan-dev
  276. - name: Build
  277. id: cmake_build
  278. run: |
  279. mkdir build
  280. cd build
  281. cmake -DLLAMA_VULKAN=ON ..
  282. cmake --build . --config Release -j $(nproc)
  283. ubuntu-22-cmake-sycl:
  284. runs-on: ubuntu-22.04
  285. continue-on-error: true
  286. steps:
  287. - uses: actions/checkout@v2
  288. - name: add oneAPI to apt
  289. shell: bash
  290. run: |
  291. cd /tmp
  292. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  293. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  294. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  295. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  296. - name: install oneAPI dpcpp compiler
  297. shell: bash
  298. run: |
  299. sudo apt update
  300. sudo apt install intel-oneapi-compiler-dpcpp-cpp
  301. - name: install oneAPI MKL library
  302. shell: bash
  303. run: |
  304. sudo apt install intel-oneapi-mkl-devel
  305. - name: Clone
  306. id: checkout
  307. uses: actions/checkout@v4
  308. - name: Build
  309. id: cmake_build
  310. run: |
  311. source /opt/intel/oneapi/setvars.sh
  312. mkdir build
  313. cd build
  314. cmake -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ..
  315. cmake --build . --config Release -j $(nproc)
  316. ubuntu-22-cmake-sycl-fp16:
  317. runs-on: ubuntu-22.04
  318. continue-on-error: true
  319. steps:
  320. - uses: actions/checkout@v2
  321. - name: add oneAPI to apt
  322. shell: bash
  323. run: |
  324. cd /tmp
  325. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  326. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  327. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  328. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  329. - name: install oneAPI dpcpp compiler
  330. shell: bash
  331. run: |
  332. sudo apt update
  333. sudo apt install intel-oneapi-compiler-dpcpp-cpp
  334. - name: install oneAPI MKL library
  335. shell: bash
  336. run: |
  337. sudo apt install intel-oneapi-mkl-devel
  338. - name: Clone
  339. id: checkout
  340. uses: actions/checkout@v4
  341. - name: Build
  342. id: cmake_build
  343. run: |
  344. source /opt/intel/oneapi/setvars.sh
  345. mkdir build
  346. cd build
  347. cmake -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_SYCL_F16=ON ..
  348. cmake --build . --config Release -j $(nproc)
  349. # TODO: build with LLAMA_NO_METAL because test-backend-ops fail on "Apple Paravirtual device" and I don't know
  350. # how to debug it.
  351. # ref: https://github.com/ggerganov/llama.cpp/actions/runs/7131777249/job/19420981052#step:5:1124
  352. macOS-latest-make:
  353. runs-on: macos-latest
  354. steps:
  355. - name: Clone
  356. id: checkout
  357. uses: actions/checkout@v4
  358. - name: Dependencies
  359. id: depends
  360. continue-on-error: true
  361. run: |
  362. brew update
  363. - name: Build
  364. id: make_build
  365. env:
  366. LLAMA_FATAL_WARNINGS: 1
  367. run: |
  368. LLAMA_NO_METAL=1 make -j $(sysctl -n hw.logicalcpu)
  369. - name: Test
  370. id: make_test
  371. run: |
  372. LLAMA_NO_METAL=1 make tests -j $(sysctl -n hw.logicalcpu)
  373. LLAMA_NO_METAL=1 make test -j $(sysctl -n hw.logicalcpu)
  374. # TODO: build with LLAMA_METAL=OFF because test-backend-ops fail on "Apple Paravirtual device" and I don't know
  375. # how to debug it.
  376. # ref: https://github.com/ggerganov/llama.cpp/actions/runs/7132125951/job/19422043567?pr=4359#step:5:6584
  377. # would be great if we fix these
  378. macOS-latest-cmake:
  379. runs-on: macos-latest
  380. steps:
  381. - name: Clone
  382. id: checkout
  383. uses: actions/checkout@v4
  384. - name: Dependencies
  385. id: depends
  386. continue-on-error: true
  387. run: |
  388. brew update
  389. - name: Build
  390. id: cmake_build
  391. run: |
  392. sysctl -a
  393. mkdir build
  394. cd build
  395. cmake -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_METAL=OFF ..
  396. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  397. - name: Test
  398. id: cmake_test
  399. run: |
  400. cd build
  401. ctest -L main --verbose --timeout 900
  402. macOS-latest-cmake-ios:
  403. runs-on: macos-latest
  404. steps:
  405. - name: Clone
  406. id: checkout
  407. uses: actions/checkout@v1
  408. - name: Dependencies
  409. id: depends
  410. continue-on-error: true
  411. run: |
  412. brew update
  413. - name: Build
  414. id: cmake_build
  415. run: |
  416. sysctl -a
  417. mkdir build
  418. cd build
  419. cmake -G Xcode .. \
  420. -DLLAMA_METAL_EMBED_LIBRARY=ON \
  421. -DLLAMA_BUILD_EXAMPLES=OFF \
  422. -DLLAMA_BUILD_TESTS=OFF \
  423. -DLLAMA_BUILD_SERVER=OFF \
  424. -DCMAKE_SYSTEM_NAME=iOS \
  425. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
  426. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  427. macOS-latest-cmake-tvos:
  428. runs-on: macos-latest
  429. steps:
  430. - name: Clone
  431. id: checkout
  432. uses: actions/checkout@v1
  433. - name: Dependencies
  434. id: depends
  435. continue-on-error: true
  436. run: |
  437. brew update
  438. - name: Build
  439. id: cmake_build
  440. run: |
  441. sysctl -a
  442. mkdir build
  443. cd build
  444. cmake -G Xcode .. \
  445. -DLLAMA_METAL_EMBED_LIBRARY=ON \
  446. -DLLAMA_BUILD_EXAMPLES=OFF \
  447. -DLLAMA_BUILD_TESTS=OFF \
  448. -DLLAMA_BUILD_SERVER=OFF \
  449. -DCMAKE_SYSTEM_NAME=tvOS \
  450. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
  451. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  452. macOS-latest-swift:
  453. runs-on: macos-latest
  454. strategy:
  455. matrix:
  456. destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
  457. steps:
  458. - name: Clone
  459. id: checkout
  460. uses: actions/checkout@v1
  461. - name: Dependencies
  462. id: depends
  463. continue-on-error: true
  464. run: |
  465. brew update
  466. - name: xcodebuild for swift package
  467. id: xcodebuild
  468. run: |
  469. xcodebuild -scheme llama -destination "${{ matrix.destination }}"
  470. - name: Build Swift Example
  471. id: make_build_swift_example
  472. run: |
  473. make swift
  474. windows-latest-cmake:
  475. runs-on: windows-latest
  476. env:
  477. OPENBLAS_VERSION: 0.3.23
  478. OPENCL_VERSION: 2023.04.17
  479. CLBLAST_VERSION: 1.6.0
  480. SDE_VERSION: 9.33.0-2024-01-07
  481. VULKAN_VERSION: 1.3.261.1
  482. strategy:
  483. matrix:
  484. include:
  485. - build: 'noavx'
  486. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DBUILD_SHARED_LIBS=ON'
  487. - build: 'avx2'
  488. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  489. - build: 'avx'
  490. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF -DBUILD_SHARED_LIBS=ON'
  491. - build: 'avx512'
  492. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
  493. - build: 'clblast'
  494. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
  495. - build: 'openblas'
  496. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
  497. - build: 'kompute'
  498. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -DBUILD_SHARED_LIBS=ON'
  499. - build: 'vulkan'
  500. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_VULKAN=ON -DBUILD_SHARED_LIBS=ON'
  501. - build: 'arm64'
  502. defines: '-A ARM64 -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  503. steps:
  504. - name: Clone
  505. id: checkout
  506. uses: actions/checkout@v4
  507. with:
  508. fetch-depth: 0
  509. - name: Clone Kompute submodule
  510. id: clone_kompute
  511. if: ${{ matrix.build == 'kompute' }}
  512. run: |
  513. git submodule update --init kompute
  514. - name: Download OpenCL SDK
  515. id: get_opencl
  516. if: ${{ matrix.build == 'clblast' }}
  517. run: |
  518. curl.exe -o $env:RUNNER_TEMP/opencl.zip -L "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v${env:OPENCL_VERSION}/OpenCL-SDK-v${env:OPENCL_VERSION}-Win-x64.zip"
  519. mkdir $env:RUNNER_TEMP/opencl
  520. tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
  521. - name: Download CLBlast
  522. id: get_clblast
  523. if: ${{ matrix.build == 'clblast' }}
  524. run: |
  525. curl.exe -o $env:RUNNER_TEMP/clblast.7z -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-windows-x64.7z"
  526. curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE"
  527. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/clblast.7z
  528. rename-item $env:RUNNER_TEMP/CLBlast-${env:CLBLAST_VERSION}-windows-x64 clblast
  529. foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
  530. $txt = Get-Content -Path $f -Raw
  531. $txt.Replace('C:/vcpkg/packages/opencl_x64-windows/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
  532. }
  533. - name: Download OpenBLAS
  534. id: get_openblas
  535. if: ${{ matrix.build == 'openblas' }}
  536. run: |
  537. 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"
  538. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  539. mkdir $env:RUNNER_TEMP/openblas
  540. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  541. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  542. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  543. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  544. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  545. - name: Install Vulkan SDK
  546. id: get_vulkan
  547. if: ${{ matrix.build == 'kompute' || matrix.build == 'vulkan' }}
  548. run: |
  549. 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"
  550. & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
  551. Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
  552. Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
  553. - name: Build
  554. id: cmake_build
  555. run: |
  556. mkdir build
  557. cd build
  558. cmake .. ${{ matrix.defines }}
  559. cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
  560. - name: Add clblast.dll
  561. id: add_clblast_dll
  562. if: ${{ matrix.build == 'clblast' }}
  563. run: |
  564. cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release
  565. cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt
  566. - name: Add libopenblas.dll
  567. id: add_libopenblas_dll
  568. if: ${{ matrix.build == 'openblas' }}
  569. run: |
  570. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  571. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  572. - name: Check AVX512F support
  573. id: check_avx512f
  574. if: ${{ matrix.build == 'avx512' }}
  575. continue-on-error: true
  576. run: |
  577. cd build
  578. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  579. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  580. $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
  581. echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
  582. & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
  583. .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
  584. - name: Test
  585. id: cmake_test
  586. # not all machines have native AVX-512
  587. if: ${{ matrix.build != 'arm64' && matrix.build != 'clblast' && matrix.build != 'kompute' && matrix.build != 'vulkan' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }}
  588. run: |
  589. cd build
  590. ctest -L main -C Release --verbose --timeout 900
  591. - name: Test (Intel SDE)
  592. id: cmake_test_sde
  593. if: ${{ matrix.build == 'avx512' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
  594. run: |
  595. curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
  596. # for some weird reason windows tar doesn't like sde tar.xz
  597. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
  598. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
  599. $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
  600. cd build
  601. & $sde -future -- ctest -L main -C Release --verbose --timeout 900
  602. - name: Determine tag name
  603. id: tag
  604. shell: bash
  605. run: |
  606. BUILD_NUMBER="$(git rev-list --count HEAD)"
  607. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  608. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  609. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  610. else
  611. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  612. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  613. fi
  614. - name: Pack artifacts
  615. id: pack_artifacts
  616. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  617. run: |
  618. Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
  619. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip .\build\bin\Release\*
  620. - name: Upload artifacts
  621. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  622. uses: actions/upload-artifact@v4
  623. with:
  624. path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip
  625. name: llama-bin-win-${{ matrix.build }}-x64.zip
  626. windows-latest-cmake-cuda:
  627. runs-on: windows-latest
  628. strategy:
  629. matrix:
  630. cuda: ['12.2.0', '11.7.1']
  631. build: ['cuda']
  632. steps:
  633. - name: Clone
  634. id: checkout
  635. uses: actions/checkout@v4
  636. with:
  637. fetch-depth: 0
  638. - uses: Jimver/cuda-toolkit@v0.2.11
  639. id: cuda-toolkit
  640. with:
  641. cuda: ${{ matrix.cuda }}
  642. method: 'network'
  643. sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
  644. - name: Build
  645. id: cmake_build
  646. run: |
  647. mkdir build
  648. cd build
  649. cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUDA=ON -DBUILD_SHARED_LIBS=ON
  650. cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
  651. - name: Determine tag name
  652. id: tag
  653. shell: bash
  654. run: |
  655. BUILD_NUMBER="$(git rev-list --count HEAD)"
  656. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  657. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  658. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  659. else
  660. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  661. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  662. fi
  663. - name: Pack artifacts
  664. id: pack_artifacts
  665. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  666. run: |
  667. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
  668. - name: Upload artifacts
  669. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  670. uses: actions/upload-artifact@v4
  671. with:
  672. path: llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
  673. name: llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  674. - name: Copy and pack Cuda runtime
  675. run: |
  676. echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
  677. $dst='.\build\bin\cudart\'
  678. robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
  679. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip $dst\*
  680. - name: Upload Cuda runtime
  681. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  682. uses: actions/upload-artifact@v4
  683. with:
  684. path: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  685. name: cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  686. windows-latest-cmake-sycl:
  687. runs-on: windows-latest
  688. defaults:
  689. run:
  690. shell: bash
  691. env:
  692. WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/62641e01-1e8d-4ace-91d6-ae03f7f8a71f/w_BaseKit_p_2024.0.0.49563_offline.exe
  693. WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel
  694. steps:
  695. - name: Clone
  696. id: checkout
  697. uses: actions/checkout@v4
  698. with:
  699. fetch-depth: 0
  700. - name: Install
  701. run: scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
  702. - name: Build
  703. id: cmake_build
  704. run: examples/sycl/win-build-sycl.bat
  705. - name: Determine tag name
  706. id: tag
  707. shell: bash
  708. run: |
  709. BUILD_NUMBER="$(git rev-list --count HEAD)"
  710. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  711. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  712. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  713. else
  714. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  715. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  716. fi
  717. - name: Pack artifacts
  718. id: pack_artifacts
  719. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  720. run: |
  721. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip ./build/bin/*
  722. - name: Upload artifacts
  723. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  724. uses: actions/upload-artifact@v4
  725. with:
  726. path: llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip
  727. name: llama-bin-win-sycl-x64.zip
  728. ios-xcode-build:
  729. runs-on: macos-latest
  730. steps:
  731. - name: Checkout code
  732. uses: actions/checkout@v4
  733. - name: Build Xcode project
  734. 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
  735. android-build:
  736. runs-on: ubuntu-latest
  737. steps:
  738. - name: Clone
  739. uses: actions/checkout@v4
  740. - name: Set up JDK
  741. uses: actions/setup-java@v3
  742. with:
  743. java-version: 17
  744. distribution: zulu
  745. - name: Setup Android SDK
  746. uses: android-actions/setup-android@v3
  747. with:
  748. log-accepted-android-sdk-licenses: false
  749. - name: Build
  750. run: |
  751. cd examples/llama.android
  752. ./gradlew build --no-daemon
  753. # freeBSD-latest:
  754. # runs-on: macos-12
  755. # steps:
  756. # - name: Clone
  757. # uses: actions/checkout@v4
  758. #
  759. # - name: Build
  760. # uses: cross-platform-actions/action@v0.19.0
  761. # with:
  762. # operating_system: freebsd
  763. # version: '13.2'
  764. # hypervisor: 'qemu'
  765. # run: |
  766. # sudo pkg update
  767. # sudo pkg install -y gmake automake autoconf pkgconf llvm15 clinfo clover opencl clblast openblas
  768. # gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15 -j `sysctl -n hw.ncpu`
  769. release:
  770. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  771. runs-on: ubuntu-latest
  772. needs:
  773. - ubuntu-focal-make
  774. - ubuntu-latest-cmake
  775. - macOS-latest-make
  776. - macOS-latest-cmake
  777. - windows-latest-cmake
  778. - windows-latest-cmake-cuda
  779. - macOS-latest-cmake-arm64
  780. - macOS-latest-cmake-x64
  781. steps:
  782. - name: Clone
  783. id: checkout
  784. uses: actions/checkout@v4
  785. with:
  786. fetch-depth: 0
  787. - name: Determine tag name
  788. id: tag
  789. shell: bash
  790. run: |
  791. BUILD_NUMBER="$(git rev-list --count HEAD)"
  792. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  793. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  794. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  795. else
  796. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  797. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  798. fi
  799. - name: Download artifacts
  800. id: download-artifact
  801. uses: actions/download-artifact@v4
  802. with:
  803. path: ./artifact
  804. - name: Move artifacts
  805. id: move_artifacts
  806. run: mkdir -p ./artifact/release && mv ./artifact/*/*.zip ./artifact/release
  807. - name: Create release
  808. id: create_release
  809. uses: anzz1/action-create-release@v1
  810. env:
  811. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  812. with:
  813. tag_name: ${{ steps.tag.outputs.name }}
  814. - name: Upload release
  815. id: upload_release
  816. uses: actions/github-script@v3
  817. with:
  818. github-token: ${{secrets.GITHUB_TOKEN}}
  819. script: |
  820. const path = require('path');
  821. const fs = require('fs');
  822. const release_id = '${{ steps.create_release.outputs.id }}';
  823. for (let file of await fs.readdirSync('./artifact/release')) {
  824. if (path.extname(file) === '.zip') {
  825. console.log('uploadReleaseAsset', file);
  826. await github.repos.uploadReleaseAsset({
  827. owner: context.repo.owner,
  828. repo: context.repo.repo,
  829. release_id: release_id,
  830. name: file,
  831. data: await fs.readFileSync(`./artifact/release/${file}`)
  832. });
  833. }
  834. }
  835. # ubuntu-latest-gcc:
  836. # runs-on: ubuntu-latest
  837. #
  838. # strategy:
  839. # matrix:
  840. # build: [Debug, Release]
  841. #
  842. # steps:
  843. # - name: Clone
  844. # uses: actions/checkout@v4
  845. #
  846. # - name: Dependencies
  847. # run: |
  848. # sudo apt-get update
  849. # sudo apt-get install build-essential
  850. # sudo apt-get install cmake
  851. #
  852. # - name: Configure
  853. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  854. #
  855. # - name: Build
  856. # run: |
  857. # make
  858. #
  859. # ubuntu-latest-clang:
  860. # runs-on: ubuntu-latest
  861. #
  862. # strategy:
  863. # matrix:
  864. # build: [Debug, Release]
  865. #
  866. # steps:
  867. # - name: Clone
  868. # uses: actions/checkout@v4
  869. #
  870. # - name: Dependencies
  871. # run: |
  872. # sudo apt-get update
  873. # sudo apt-get install build-essential
  874. # sudo apt-get install cmake
  875. #
  876. # - name: Configure
  877. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  878. #
  879. # - name: Build
  880. # run: |
  881. # make
  882. #
  883. # ubuntu-latest-gcc-sanitized:
  884. # runs-on: ubuntu-latest
  885. #
  886. # strategy:
  887. # matrix:
  888. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  889. #
  890. # steps:
  891. # - name: Clone
  892. # uses: actions/checkout@v4
  893. #
  894. # - name: Dependencies
  895. # run: |
  896. # sudo apt-get update
  897. # sudo apt-get install build-essential
  898. # sudo apt-get install cmake
  899. #
  900. # - name: Configure
  901. # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
  902. #
  903. # - name: Build
  904. # run: |
  905. # make
  906. #
  907. # windows:
  908. # runs-on: windows-latest
  909. #
  910. # strategy:
  911. # matrix:
  912. # build: [Release]
  913. # arch: [Win32, x64]
  914. # include:
  915. # - arch: Win32
  916. # s2arc: x86
  917. # - arch: x64
  918. # s2arc: x64
  919. #
  920. # steps:
  921. # - name: Clone
  922. # uses: actions/checkout@v4
  923. #
  924. # - name: Add msbuild to PATH
  925. # uses: microsoft/setup-msbuild@v1
  926. #
  927. # - name: Configure
  928. # run: >
  929. # cmake -S . -B ./build -A ${{ matrix.arch }}
  930. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  931. #
  932. # - name: Build
  933. # run: |
  934. # cd ./build
  935. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  936. #
  937. # - name: Upload binaries
  938. # uses: actions/upload-artifact@v4
  939. # with:
  940. # name: llama-bin-${{ matrix.arch }}
  941. # path: build/bin/${{ matrix.build }}
  942. #
  943. # windows-blas:
  944. # runs-on: windows-latest
  945. #
  946. # strategy:
  947. # matrix:
  948. # build: [Release]
  949. # arch: [Win32, x64]
  950. # blas: [ON]
  951. # include:
  952. # - arch: Win32
  953. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
  954. # s2arc: x86
  955. # - arch: x64
  956. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
  957. # s2arc: x64
  958. #
  959. # steps:
  960. # - name: Clone
  961. # uses: actions/checkout@v4
  962. #
  963. # - name: Add msbuild to PATH
  964. # uses: microsoft/setup-msbuild@v1
  965. #
  966. # - name: Fetch OpenBLAS
  967. # if: matrix.blas == 'ON'
  968. # run: |
  969. # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
  970. # 7z x blas.zip -oblas -y
  971. # copy blas/include/cblas.h .
  972. # copy blas/include/openblas_config.h .
  973. # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
  974. #
  975. # - name: Configure
  976. # run: >
  977. # cmake -S . -B ./build -A ${{ matrix.arch }}
  978. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  979. # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
  980. # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
  981. #
  982. # - name: Build
  983. # run: |
  984. # cd ./build
  985. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  986. #
  987. # - name: Copy libopenblas.dll
  988. # if: matrix.blas == 'ON'
  989. # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
  990. #
  991. # - name: Upload binaries
  992. # if: matrix.blas == 'ON'
  993. # uses: actions/upload-artifact@v4
  994. # with:
  995. # name: llama-blas-bin-${{ matrix.arch }}
  996. # path: build/bin/${{ matrix.build }}
  997. #
  998. # emscripten:
  999. # runs-on: ubuntu-latest
  1000. #
  1001. # strategy:
  1002. # matrix:
  1003. # build: [Release]
  1004. #
  1005. # steps:
  1006. # - name: Clone
  1007. # uses: actions/checkout@v4
  1008. #
  1009. # - name: Dependencies
  1010. # run: |
  1011. # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  1012. # tar -xvf master.tar.gz
  1013. # emsdk-master/emsdk update
  1014. # emsdk-master/emsdk install latest
  1015. # emsdk-master/emsdk activate latest
  1016. #
  1017. # - name: Configure
  1018. # run: echo "tmp"
  1019. #
  1020. # - name: Build
  1021. # run: |
  1022. # pushd emsdk-master
  1023. # source ./emsdk_env.sh
  1024. # popd
  1025. # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  1026. # make