build.yml 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. name: CI
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. push:
  5. branches:
  6. - master
  7. paths: [
  8. '.github/workflows/build.yml',
  9. '.github/workflows/build-linux-cross.yml',
  10. '.github/workflows/build-cmake-pkg.yml',
  11. '**/CMakeLists.txt',
  12. '**/.cmake',
  13. '**/*.h',
  14. '**/*.hpp',
  15. '**/*.c',
  16. '**/*.cpp',
  17. '**/*.cu',
  18. '**/*.cuh',
  19. '**/*.swift',
  20. '**/*.m',
  21. '**/*.metal',
  22. '**/*.comp'
  23. ]
  24. pull_request:
  25. types: [opened, synchronize, reopened]
  26. paths: [
  27. '.github/workflows/build.yml',
  28. '.github/workflows/build-linux-cross.yml',
  29. '.github/workflows/build-cmake-pkg.yml',
  30. '**/CMakeLists.txt',
  31. '**/.cmake',
  32. '**/*.h',
  33. '**/*.hpp',
  34. '**/*.c',
  35. '**/*.cpp',
  36. '**/*.cu',
  37. '**/*.cuh',
  38. '**/*.swift',
  39. '**/*.m',
  40. '**/*.metal',
  41. '**/*.comp'
  42. ]
  43. concurrency:
  44. group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  45. cancel-in-progress: true
  46. env:
  47. GGML_NLOOP: 3
  48. GGML_N_THREADS: 1
  49. LLAMA_LOG_COLORS: 1
  50. LLAMA_LOG_PREFIX: 1
  51. LLAMA_LOG_TIMESTAMPS: 1
  52. jobs:
  53. macOS-latest-cmake-arm64:
  54. runs-on: macos-14
  55. steps:
  56. - name: Clone
  57. id: checkout
  58. uses: actions/checkout@v4
  59. - name: ccache
  60. uses: hendrikmuhs/ccache-action@v1.2.16
  61. with:
  62. key: macOS-latest-cmake-arm64
  63. evict-old-files: 1d
  64. - name: Dependencies
  65. id: depends
  66. continue-on-error: true
  67. run: |
  68. brew update
  69. brew install curl
  70. - name: Build
  71. id: cmake_build
  72. run: |
  73. sysctl -a
  74. cmake -B build \
  75. -DCMAKE_BUILD_RPATH="@loader_path" \
  76. -DLLAMA_FATAL_WARNINGS=ON \
  77. -DGGML_METAL_USE_BF16=ON \
  78. -DGGML_METAL_EMBED_LIBRARY=OFF \
  79. -DGGML_METAL_SHADER_DEBUG=ON \
  80. -DGGML_RPC=ON
  81. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  82. - name: Test
  83. id: cmake_test
  84. run: |
  85. cd build
  86. ctest -L 'main|curl' --verbose --timeout 900
  87. macOS-latest-cmake-x64:
  88. runs-on: macos-13
  89. steps:
  90. - name: Clone
  91. id: checkout
  92. uses: actions/checkout@v4
  93. - name: ccache
  94. uses: hendrikmuhs/ccache-action@v1.2.16
  95. with:
  96. key: macOS-latest-cmake-x64
  97. evict-old-files: 1d
  98. - name: Dependencies
  99. id: depends
  100. continue-on-error: true
  101. run: |
  102. brew update
  103. brew install curl
  104. - name: Build
  105. id: cmake_build
  106. run: |
  107. sysctl -a
  108. # Metal is disabled due to intermittent failures with Github runners not having a GPU:
  109. # https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
  110. cmake -B build \
  111. -DCMAKE_BUILD_RPATH="@loader_path" \
  112. -DLLAMA_FATAL_WARNINGS=ON \
  113. -DGGML_METAL=OFF \
  114. -DGGML_RPC=ON
  115. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  116. - name: Test
  117. id: cmake_test
  118. run: |
  119. cd build
  120. ctest -L main --verbose --timeout 900
  121. macOS-latest-cmake-arm64-webgpu:
  122. runs-on: macos-14
  123. steps:
  124. - name: Clone
  125. id: checkout
  126. uses: actions/checkout@v4
  127. - name: ccache
  128. uses: hendrikmuhs/ccache-action@v1.2.16
  129. with:
  130. key: macOS-latest-cmake-arm64-webgpu
  131. evict-old-files: 1d
  132. - name: Dependencies
  133. id: depends
  134. continue-on-error: true
  135. run: |
  136. brew update
  137. brew install curl
  138. - name: Dawn Dependency
  139. id: dawn-depends
  140. run: |
  141. DAWN_VERSION="v1.0.0"
  142. DAWN_OWNER="reeselevine"
  143. DAWN_REPO="dawn"
  144. DAWN_ASSET_NAME="Dawn-a1a6b45cced25a3b7f4fb491e0ae70796cc7f22b-macos-latest-Release.tar.gz"
  145. echo "Fetching release asset from https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  146. curl -L -o artifact.tar.gz \
  147. "https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  148. mkdir dawn
  149. tar -xvf artifact.tar.gz -C dawn --strip-components=1
  150. - name: Build
  151. id: cmake_build
  152. run: |
  153. export CMAKE_PREFIX_PATH=dawn
  154. cmake -B build -DGGML_WEBGPU=ON -DGGML_METAL=OFF -DGGML_BLAS=OFF
  155. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  156. - name: Test
  157. id: cmake_test
  158. run: |
  159. cd build
  160. ctest -L main --verbose --timeout 900
  161. ubuntu-cpu-cmake:
  162. strategy:
  163. matrix:
  164. include:
  165. - build: 'x64'
  166. os: ubuntu-22.04
  167. - build: 'arm64'
  168. os: ubuntu-22.04-arm
  169. runs-on: ${{ matrix.os }}
  170. steps:
  171. - name: Clone
  172. id: checkout
  173. uses: actions/checkout@v4
  174. - name: ccache
  175. uses: hendrikmuhs/ccache-action@v1.2.16
  176. with:
  177. key: ubuntu-cpu-cmake
  178. evict-old-files: 1d
  179. - name: Dependencies
  180. id: depends
  181. run: |
  182. sudo apt-get update
  183. sudo apt-get install build-essential libcurl4-openssl-dev
  184. - name: Build
  185. id: cmake_build
  186. run: |
  187. cmake -B build \
  188. -DLLAMA_FATAL_WARNINGS=ON \
  189. -DGGML_RPC=ON
  190. cmake --build build --config Release -j $(nproc)
  191. - name: Test
  192. id: cmake_test
  193. run: |
  194. cd build
  195. ctest -L 'main|curl' --verbose --timeout 900
  196. - name: Test llama2c conversion
  197. id: llama2c_test
  198. run: |
  199. cd build
  200. echo "Fetch tokenizer"
  201. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
  202. echo "Fetch llama2c model"
  203. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
  204. ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
  205. ./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
  206. ubuntu-latest-cmake-sanitizer:
  207. runs-on: ubuntu-latest
  208. continue-on-error: true
  209. strategy:
  210. matrix:
  211. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  212. build_type: [Debug]
  213. steps:
  214. - name: Clone
  215. id: checkout
  216. uses: actions/checkout@v4
  217. - name: ccache
  218. uses: hendrikmuhs/ccache-action@v1.2.16
  219. with:
  220. key: ubuntu-latest-cmake-sanitizer-${{ matrix.sanitizer }}
  221. evict-old-files: 1d
  222. - name: Dependencies
  223. id: depends
  224. run: |
  225. sudo apt-get update
  226. sudo apt-get install build-essential libcurl4-openssl-dev
  227. - name: Build
  228. id: cmake_build
  229. if: ${{ matrix.sanitizer != 'THREAD' }}
  230. run: |
  231. cmake -B build \
  232. -DLLAMA_FATAL_WARNINGS=ON \
  233. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
  234. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  235. cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
  236. - name: Build (no OpenMP)
  237. id: cmake_build_no_openmp
  238. if: ${{ matrix.sanitizer == 'THREAD' }}
  239. run: |
  240. cmake -B build \
  241. -DLLAMA_FATAL_WARNINGS=ON \
  242. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
  243. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
  244. -DGGML_OPENMP=OFF
  245. cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
  246. - name: Test
  247. id: cmake_test
  248. run: |
  249. cd build
  250. ctest -L main --verbose --timeout 900
  251. ubuntu-latest-llguidance:
  252. runs-on: ubuntu-latest
  253. steps:
  254. - name: Clone
  255. id: checkout
  256. uses: actions/checkout@v4
  257. - name: Dependencies
  258. id: depends
  259. run: |
  260. sudo apt-get update
  261. sudo apt-get install build-essential libcurl4-openssl-dev
  262. - name: Build
  263. id: cmake_build
  264. run: |
  265. mkdir build
  266. cd build
  267. cmake .. \
  268. -DLLAMA_FATAL_WARNINGS=ON \
  269. -DLLAMA_LLGUIDANCE=ON
  270. cmake --build . --config Release -j $(nproc)
  271. - name: Test
  272. id: cmake_test
  273. run: |
  274. cd build
  275. ctest -L main --verbose --timeout 900
  276. ubuntu-latest-cmake-rpc:
  277. runs-on: ubuntu-latest
  278. continue-on-error: true
  279. steps:
  280. - name: Clone
  281. id: checkout
  282. uses: actions/checkout@v4
  283. - name: ccache
  284. uses: hendrikmuhs/ccache-action@v1.2.16
  285. with:
  286. key: ubuntu-latest-cmake-rpc
  287. evict-old-files: 1d
  288. - name: Dependencies
  289. id: depends
  290. run: |
  291. sudo apt-get update
  292. sudo apt-get install build-essential libcurl4-openssl-dev
  293. - name: Build
  294. id: cmake_build
  295. run: |
  296. cmake -B build \
  297. -DGGML_RPC=ON
  298. cmake --build build --config Release -j $(nproc)
  299. - name: Test
  300. id: cmake_test
  301. run: |
  302. cd build
  303. ctest -L main --verbose
  304. ubuntu-22-cmake-vulkan:
  305. runs-on: ubuntu-22.04
  306. steps:
  307. - name: Clone
  308. id: checkout
  309. uses: actions/checkout@v4
  310. - name: ccache
  311. uses: hendrikmuhs/ccache-action@v1.2.16
  312. with:
  313. key: ubuntu-22-cmake-vulkan
  314. evict-old-files: 1d
  315. - name: Dependencies
  316. id: depends
  317. run: |
  318. wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
  319. sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
  320. sudo apt-get update -y
  321. sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev
  322. - name: Build
  323. id: cmake_build
  324. run: |
  325. cmake -B build \
  326. -DGGML_VULKAN=ON
  327. cmake --build build --config Release -j $(nproc)
  328. - name: Test
  329. id: cmake_test
  330. run: |
  331. cd build
  332. export GGML_VK_VISIBLE_DEVICES=0
  333. # This is using llvmpipe and runs slower than other backends
  334. ctest -L main --verbose --timeout 4200
  335. ubuntu-22-cmake-webgpu:
  336. runs-on: ubuntu-22.04
  337. steps:
  338. - name: Clone
  339. id: checkout
  340. uses: actions/checkout@v4
  341. - name: ccache
  342. uses: hendrikmuhs/ccache-action@v1.2.16
  343. with:
  344. key: ubuntu-22-cmake-webgpu
  345. evict-old-files: 1d
  346. - name: Vulkan SDK Dependencies
  347. id: vulkan-depends
  348. run: |
  349. wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
  350. sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
  351. sudo apt-get update -y
  352. sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libcurl4-openssl-dev
  353. - name: Dawn Dependency
  354. id: dawn-depends
  355. run: |
  356. sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev libxi-dev
  357. DAWN_VERSION="v1.0.0"
  358. DAWN_OWNER="reeselevine"
  359. DAWN_REPO="dawn"
  360. DAWN_ASSET_NAME="Dawn-a1a6b45cced25a3b7f4fb491e0ae70796cc7f22b-ubuntu-latest-Release.tar.gz"
  361. echo "Fetching release asset from https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  362. curl -L -o artifact.tar.gz \
  363. "https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  364. mkdir dawn
  365. tar -xvf artifact.tar.gz -C dawn --strip-components=1
  366. - name: Build
  367. id: cmake_build
  368. run: |
  369. export Dawn_DIR=dawn/lib64/cmake/Dawn
  370. cmake -B build -DGGML_WEBGPU=ON
  371. cmake --build build --config Release -j $(nproc)
  372. - name: Test
  373. id: cmake_test
  374. run: |
  375. cd build
  376. # This is using llvmpipe and runs slower than other backends
  377. ctest -L main --verbose --timeout 3600
  378. ubuntu-22-cmake-hip:
  379. runs-on: ubuntu-22.04
  380. container: rocm/dev-ubuntu-22.04:6.0.2
  381. steps:
  382. - name: Clone
  383. id: checkout
  384. uses: actions/checkout@v4
  385. - name: Dependencies
  386. id: depends
  387. run: |
  388. sudo apt-get update
  389. sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libcurl4-openssl-dev
  390. - name: ccache
  391. uses: hendrikmuhs/ccache-action@v1.2.16
  392. with:
  393. key: ubuntu-22-cmake-hip
  394. evict-old-files: 1d
  395. - name: Build with native CMake HIP support
  396. id: cmake_build
  397. run: |
  398. cmake -B build -S . \
  399. -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
  400. -DGGML_HIP_ROCWMMA_FATTN=ON \
  401. -DGGML_HIP=ON
  402. cmake --build build --config Release -j $(nproc)
  403. - name: Build with legacy HIP support
  404. id: cmake_build_legacy_hip
  405. run: |
  406. cmake -B build2 -S . \
  407. -DCMAKE_C_COMPILER=hipcc \
  408. -DCMAKE_CXX_COMPILER=hipcc \
  409. -DGGML_HIP_ROCWMMA_FATTN=ON \
  410. -DGGML_HIP=ON
  411. cmake --build build2 --config Release -j $(nproc)
  412. ubuntu-22-cmake-musa:
  413. runs-on: ubuntu-22.04
  414. container: mthreads/musa:rc4.2.0-devel-ubuntu22.04-amd64
  415. steps:
  416. - name: Clone
  417. id: checkout
  418. uses: actions/checkout@v4
  419. - name: Dependencies
  420. id: depends
  421. run: |
  422. apt-get update
  423. apt-get install -y build-essential git cmake libcurl4-openssl-dev
  424. - name: ccache
  425. uses: hendrikmuhs/ccache-action@v1.2.16
  426. with:
  427. key: ubuntu-22-cmake-musa
  428. evict-old-files: 1d
  429. - name: Build with native CMake MUSA support
  430. id: cmake_build
  431. run: |
  432. cmake -B build -S . \
  433. -DGGML_MUSA=ON
  434. cmake --build build --config Release -j $(nproc)
  435. ubuntu-22-cmake-sycl:
  436. runs-on: ubuntu-22.04
  437. continue-on-error: true
  438. steps:
  439. - uses: actions/checkout@v4
  440. - name: add oneAPI to apt
  441. shell: bash
  442. run: |
  443. cd /tmp
  444. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  445. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  446. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  447. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  448. - name: install oneAPI dpcpp compiler
  449. shell: bash
  450. run: |
  451. sudo apt update
  452. sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev
  453. - name: install oneAPI MKL library
  454. shell: bash
  455. run: |
  456. sudo apt install intel-oneapi-mkl-devel
  457. - name: Clone
  458. id: checkout
  459. uses: actions/checkout@v4
  460. - name: ccache
  461. uses: hendrikmuhs/ccache-action@v1.2.16
  462. with:
  463. key: ubuntu-22-cmake-sycl
  464. evict-old-files: 1d
  465. - name: Build
  466. id: cmake_build
  467. run: |
  468. source /opt/intel/oneapi/setvars.sh
  469. cmake -B build \
  470. -DGGML_SYCL=ON \
  471. -DCMAKE_C_COMPILER=icx \
  472. -DCMAKE_CXX_COMPILER=icpx
  473. cmake --build build --config Release -j $(nproc)
  474. ubuntu-22-cmake-sycl-fp16:
  475. runs-on: ubuntu-22.04
  476. continue-on-error: true
  477. steps:
  478. - uses: actions/checkout@v4
  479. - name: add oneAPI to apt
  480. shell: bash
  481. run: |
  482. cd /tmp
  483. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  484. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  485. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  486. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  487. - name: install oneAPI dpcpp compiler
  488. shell: bash
  489. run: |
  490. sudo apt update
  491. sudo apt install intel-oneapi-compiler-dpcpp-cpp libcurl4-openssl-dev
  492. - name: install oneAPI MKL library
  493. shell: bash
  494. run: |
  495. sudo apt install intel-oneapi-mkl-devel
  496. - name: Clone
  497. id: checkout
  498. uses: actions/checkout@v4
  499. - name: ccache
  500. uses: hendrikmuhs/ccache-action@v1.2.16
  501. with:
  502. key: ubuntu-22-cmake-sycl-fp16
  503. evict-old-files: 1d
  504. - name: Build
  505. id: cmake_build
  506. run: |
  507. source /opt/intel/oneapi/setvars.sh
  508. cmake -B build \
  509. -DGGML_SYCL=ON \
  510. -DCMAKE_C_COMPILER=icx \
  511. -DCMAKE_CXX_COMPILER=icpx \
  512. -DGGML_SYCL_F16=ON
  513. cmake --build build --config Release -j $(nproc)
  514. build-linux-cross:
  515. uses: ./.github/workflows/build-linux-cross.yml
  516. build-cmake-pkg:
  517. uses: ./.github/workflows/build-cmake-pkg.yml
  518. macOS-latest-cmake-ios:
  519. runs-on: macos-latest
  520. steps:
  521. - name: Clone
  522. id: checkout
  523. uses: actions/checkout@v4
  524. - name: ccache
  525. uses: hendrikmuhs/ccache-action@v1.2.16
  526. with:
  527. key: macOS-latest-cmake-ios
  528. evict-old-files: 1d
  529. - name: Dependencies
  530. id: depends
  531. continue-on-error: true
  532. run: |
  533. brew update
  534. - name: Build
  535. id: cmake_build
  536. run: |
  537. sysctl -a
  538. cmake -B build -G Xcode \
  539. -DGGML_METAL_USE_BF16=ON \
  540. -DGGML_METAL_EMBED_LIBRARY=ON \
  541. -DLLAMA_BUILD_COMMON=OFF \
  542. -DLLAMA_BUILD_EXAMPLES=OFF \
  543. -DLLAMA_BUILD_TOOLS=OFF \
  544. -DLLAMA_BUILD_TESTS=OFF \
  545. -DLLAMA_BUILD_SERVER=OFF \
  546. -DCMAKE_SYSTEM_NAME=iOS \
  547. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  548. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  549. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  550. macOS-latest-cmake-tvos:
  551. runs-on: macos-latest
  552. steps:
  553. - name: Clone
  554. id: checkout
  555. uses: actions/checkout@v4
  556. - name: ccache
  557. uses: hendrikmuhs/ccache-action@v1.2.16
  558. with:
  559. key: macOS-latest-cmake-tvos
  560. evict-old-files: 1d
  561. - name: Dependencies
  562. id: depends
  563. continue-on-error: true
  564. run: |
  565. brew update
  566. - name: Build
  567. id: cmake_build
  568. run: |
  569. sysctl -a
  570. cmake -B build -G Xcode \
  571. -DGGML_METAL_USE_BF16=ON \
  572. -DGGML_METAL_EMBED_LIBRARY=ON \
  573. -DLLAMA_BUILD_COMMON=OFF \
  574. -DLLAMA_BUILD_EXAMPLES=OFF \
  575. -DLLAMA_BUILD_TOOLS=OFF \
  576. -DLLAMA_BUILD_TESTS=OFF \
  577. -DLLAMA_BUILD_SERVER=OFF \
  578. -DCMAKE_SYSTEM_NAME=tvOS \
  579. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  580. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  581. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  582. macOS-latest-cmake-visionos:
  583. runs-on: macos-latest
  584. steps:
  585. - name: Clone
  586. id: checkout
  587. uses: actions/checkout@v4
  588. - name: Dependencies
  589. id: depends
  590. continue-on-error: true
  591. run: |
  592. brew update
  593. - name: Build
  594. id: cmake_build
  595. run: |
  596. sysctl -a
  597. cmake -B build -G Xcode \
  598. -DGGML_METAL_USE_BF16=ON \
  599. -DGGML_METAL_EMBED_LIBRARY=ON \
  600. -DLLAMA_BUILD_COMMON=OFF \
  601. -DLLAMA_BUILD_EXAMPLES=OFF \
  602. -DLLAMA_BUILD_TOOLS=OFF \
  603. -DLLAMA_BUILD_TESTS=OFF \
  604. -DLLAMA_BUILD_SERVER=OFF \
  605. -DCMAKE_SYSTEM_NAME=visionOS \
  606. -DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
  607. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  608. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  609. macOS-latest-swift:
  610. runs-on: macos-latest
  611. strategy:
  612. matrix:
  613. destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
  614. steps:
  615. - name: Clone
  616. id: checkout
  617. uses: actions/checkout@v4
  618. - name: ccache
  619. uses: hendrikmuhs/ccache-action@v1.2.16
  620. with:
  621. key: macOS-latest-swift
  622. evict-old-files: 1d
  623. - name: Dependencies
  624. id: depends
  625. continue-on-error: true
  626. run: |
  627. brew update
  628. - name: Build llama.cpp with CMake
  629. id: cmake_build
  630. run: |
  631. sysctl -a
  632. cmake -B build -G Xcode \
  633. -DGGML_METAL_USE_BF16=ON \
  634. -DGGML_METAL_EMBED_LIBRARY=ON \
  635. -DLLAMA_CURL=OFF \
  636. -DLLAMA_BUILD_EXAMPLES=OFF \
  637. -DLLAMA_BUILD_TOOLS=OFF \
  638. -DLLAMA_BUILD_TESTS=OFF \
  639. -DLLAMA_BUILD_SERVER=OFF \
  640. -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
  641. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  642. - name: xcodebuild for swift package
  643. id: xcodebuild
  644. run: |
  645. ./build-xcframework.sh
  646. windows-msys2:
  647. runs-on: windows-2025
  648. strategy:
  649. fail-fast: false
  650. matrix:
  651. include:
  652. - { sys: UCRT64, env: ucrt-x86_64, build: Release }
  653. - { sys: CLANG64, env: clang-x86_64, build: Release }
  654. steps:
  655. - name: Clone
  656. uses: actions/checkout@v4
  657. - name: ccache
  658. uses: hendrikmuhs/ccache-action@v1.2.16
  659. with:
  660. key: windows-msys2
  661. variant: ccache
  662. evict-old-files: 1d
  663. - name: Setup ${{ matrix.sys }}
  664. uses: msys2/setup-msys2@v2
  665. with:
  666. update: true
  667. msystem: ${{matrix.sys}}
  668. install: >-
  669. base-devel
  670. git
  671. mingw-w64-${{matrix.env}}-toolchain
  672. mingw-w64-${{matrix.env}}-cmake
  673. mingw-w64-${{matrix.env}}-openblas
  674. - name: Build using CMake
  675. shell: msys2 {0}
  676. run: |
  677. cmake -B build
  678. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  679. - name: Clean after building using CMake
  680. shell: msys2 {0}
  681. run: |
  682. rm -rf build
  683. - name: Build using CMake w/ OpenBLAS
  684. shell: msys2 {0}
  685. run: |
  686. cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
  687. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  688. windows-latest-cmake:
  689. runs-on: windows-2025
  690. env:
  691. OPENBLAS_VERSION: 0.3.23
  692. SDE_VERSION: 9.33.0-2024-01-07
  693. VULKAN_VERSION: 1.4.313.2
  694. strategy:
  695. matrix:
  696. include:
  697. - build: 'cpu-x64 (static)'
  698. arch: 'x64'
  699. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DBUILD_SHARED_LIBS=OFF'
  700. - build: 'openblas-x64'
  701. arch: 'x64'
  702. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/x64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_OPENMP=OFF -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
  703. - build: 'vulkan-x64'
  704. arch: 'x64'
  705. defines: '-DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_VULKAN=ON'
  706. - build: 'llvm-arm64'
  707. arch: 'arm64'
  708. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
  709. - build: 'llvm-arm64-opencl-adreno'
  710. arch: 'arm64'
  711. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON'
  712. steps:
  713. - name: Clone
  714. id: checkout
  715. uses: actions/checkout@v4
  716. - name: ccache
  717. uses: hendrikmuhs/ccache-action@v1.2.16
  718. with:
  719. key: windows-latest-cmake-${{ matrix.build }}
  720. variant: ccache
  721. evict-old-files: 1d
  722. - name: Download OpenBLAS
  723. id: get_openblas
  724. if: ${{ matrix.build == 'openblas-x64' }}
  725. run: |
  726. 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"
  727. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  728. mkdir $env:RUNNER_TEMP/openblas
  729. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  730. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  731. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  732. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  733. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  734. - name: Install Vulkan SDK
  735. id: get_vulkan
  736. if: ${{ matrix.build == 'vulkan-x64' }}
  737. run: |
  738. curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
  739. & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
  740. Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
  741. Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
  742. - name: Install Ninja
  743. id: install_ninja
  744. run: |
  745. choco install ninja
  746. - name: Install OpenCL Headers and Libs
  747. id: install_opencl
  748. if: ${{ matrix.build == 'llvm-arm64-opencl-adreno' }}
  749. run: |
  750. git clone https://github.com/KhronosGroup/OpenCL-Headers
  751. cd OpenCL-Headers
  752. cmake -B build `
  753. -DBUILD_TESTING=OFF `
  754. -DOPENCL_HEADERS_BUILD_TESTING=OFF `
  755. -DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF `
  756. -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
  757. cmake --build build --target install
  758. git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
  759. cd OpenCL-ICD-Loader
  760. cmake -B build-arm64-release `
  761. -A arm64 `
  762. -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" `
  763. -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
  764. cmake --build build-arm64-release --target install --config release
  765. - name: libCURL
  766. id: get_libcurl
  767. uses: ./.github/actions/windows-setup-curl
  768. with:
  769. architecture: ${{ matrix.arch == 'x64' && 'win64' || 'win64a' }}
  770. - name: Build
  771. id: cmake_build
  772. env:
  773. CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
  774. run: |
  775. cmake -S . -B build ${{ matrix.defines }} `
  776. -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
  777. cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
  778. cp $env:CURL_PATH/bin/libcurl-*.dll build/bin/Release
  779. - name: Add libopenblas.dll
  780. id: add_libopenblas_dll
  781. if: ${{ matrix.build == 'openblas-x64' }}
  782. run: |
  783. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  784. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  785. - name: Test
  786. id: cmake_test
  787. if: ${{ matrix.arch == 'x64' }}
  788. run: |
  789. cd build
  790. ctest -L main -C Release --verbose --timeout 900
  791. # TODO: disabled for now, consider adding tests for all CPU variants instead
  792. # - name: Test (Intel SDE)
  793. # id: cmake_test_sde
  794. # if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
  795. # run: |
  796. # curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
  797. # # for some weird reason windows tar doesn't like sde tar.xz
  798. # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
  799. # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
  800. # $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
  801. # cd build
  802. # $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
  803. # & $sde -future -- ctest -L main -C Release --verbose --timeout 900
  804. ubuntu-latest-cmake-cuda:
  805. runs-on: ubuntu-latest
  806. container: nvidia/cuda:12.6.2-devel-ubuntu24.04
  807. steps:
  808. - name: Clone
  809. id: checkout
  810. uses: actions/checkout@v4
  811. - name: Install dependencies
  812. env:
  813. DEBIAN_FRONTEND: noninteractive
  814. run: |
  815. apt update
  816. apt install -y cmake build-essential ninja-build libgomp1 git libcurl4-openssl-dev
  817. - name: ccache
  818. uses: hendrikmuhs/ccache-action@v1.2.16
  819. with:
  820. key: ubuntu-latest-cmake-cuda
  821. evict-old-files: 1d
  822. - name: Build with CMake
  823. run: |
  824. cmake -S . -B build -G Ninja \
  825. -DCMAKE_BUILD_TYPE=Release \
  826. -DCMAKE_CUDA_ARCHITECTURES=89-real \
  827. -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
  828. -DLLAMA_FATAL_WARNINGS=ON \
  829. -DGGML_NATIVE=OFF \
  830. -DGGML_CUDA=ON
  831. cmake --build build
  832. windows-2022-cmake-cuda:
  833. runs-on: windows-2022
  834. strategy:
  835. matrix:
  836. cuda: ['12.4']
  837. steps:
  838. - name: Clone
  839. id: checkout
  840. uses: actions/checkout@v4
  841. - name: Install ccache
  842. uses: hendrikmuhs/ccache-action@v1.2.16
  843. with:
  844. key: windows-cuda-${{ matrix.cuda }}
  845. variant: ccache
  846. evict-old-files: 1d
  847. - name: Install Cuda Toolkit
  848. uses: ./.github/actions/windows-setup-cuda
  849. with:
  850. cuda_version: ${{ matrix.cuda }}
  851. - name: Install Ninja
  852. id: install_ninja
  853. run: |
  854. choco install ninja
  855. - name: libCURL
  856. id: get_libcurl
  857. uses: ./.github/actions/windows-setup-curl
  858. - name: Build
  859. id: cmake_build
  860. shell: cmd
  861. env:
  862. CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
  863. run: |
  864. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  865. cmake -S . -B build -G "Ninja Multi-Config" ^
  866. -DLLAMA_BUILD_SERVER=ON ^
  867. -DGGML_NATIVE=OFF ^
  868. -DGGML_BACKEND_DL=ON ^
  869. -DGGML_CPU_ALL_VARIANTS=ON ^
  870. -DGGML_CUDA=ON ^
  871. -DGGML_RPC=ON ^
  872. -DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include"
  873. set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
  874. cmake --build build --config Release -j %NINJA_JOBS% -t ggml
  875. cmake --build build --config Release
  876. windows-latest-cmake-sycl:
  877. runs-on: windows-2022
  878. defaults:
  879. run:
  880. shell: bash
  881. env:
  882. WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7cd9bba0-7aab-4e30-b3ae-2221006a4a05/intel-oneapi-base-toolkit-2025.1.1.34_offline.exe
  883. WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
  884. ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
  885. steps:
  886. - name: Clone
  887. id: checkout
  888. uses: actions/checkout@v4
  889. - name: ccache
  890. uses: hendrikmuhs/ccache-action@v1.2.16
  891. with:
  892. key: windows-latest-cmake-sycl
  893. variant: ccache
  894. evict-old-files: 1d
  895. - name: Install
  896. run: |
  897. scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
  898. # TODO: add libcurl support ; we will also need to modify win-build-sycl.bat to accept user-specified args
  899. - name: Build
  900. id: cmake_build
  901. run: examples/sycl/win-build-sycl.bat
  902. windows-latest-cmake-hip:
  903. if: ${{ github.event.inputs.create_release != 'true' }}
  904. runs-on: windows-2022
  905. steps:
  906. - name: Clone
  907. id: checkout
  908. uses: actions/checkout@v4
  909. - name: Clone rocWMMA repository
  910. id: clone_rocwmma
  911. run: |
  912. git clone https://github.com/rocm/rocwmma --branch rocm-6.2.4 --depth 1
  913. - name: Install
  914. id: depends
  915. run: |
  916. $ErrorActionPreference = "Stop"
  917. write-host "Downloading AMD HIP SDK Installer"
  918. 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"
  919. write-host "Installing AMD HIP SDK"
  920. Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
  921. write-host "Completed AMD HIP SDK installation"
  922. - name: Verify ROCm
  923. id: verify
  924. run: |
  925. & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
  926. - name: Install ccache
  927. uses: hendrikmuhs/ccache-action@v1.2.16
  928. with:
  929. key: ${{ github.job }}
  930. evict-old-files: 1d
  931. - name: libCURL
  932. id: get_libcurl
  933. uses: ./.github/actions/windows-setup-curl
  934. - name: Build
  935. id: cmake_build
  936. env:
  937. CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
  938. run: |
  939. $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
  940. $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
  941. cmake -G "Unix Makefiles" -B build -S . `
  942. -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
  943. -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
  944. -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/rocwmma/library/include/" `
  945. -DCMAKE_BUILD_TYPE=Release `
  946. -DGGML_HIP=ON `
  947. -DGGML_HIP_ROCWMMA_FATTN=ON `
  948. -DGGML_RPC=ON `
  949. -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
  950. cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
  951. ios-xcode-build:
  952. runs-on: macos-latest
  953. steps:
  954. - name: Checkout code
  955. uses: actions/checkout@v4
  956. - name: Build
  957. id: cmake_build
  958. run: |
  959. sysctl -a
  960. cmake -B build -G Xcode \
  961. -DGGML_METAL_USE_BF16=ON \
  962. -DGGML_METAL_EMBED_LIBRARY=ON \
  963. -DLLAMA_CURL=OFF \
  964. -DLLAMA_BUILD_EXAMPLES=OFF \
  965. -DLLAMA_BUILD_TOOLS=OFF \
  966. -DLLAMA_BUILD_TESTS=OFF \
  967. -DLLAMA_BUILD_SERVER=OFF \
  968. -DCMAKE_SYSTEM_NAME=iOS \
  969. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  970. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  971. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  972. - name: xcodebuild for swift package
  973. id: xcodebuild
  974. run: |
  975. ./build-xcframework.sh
  976. - name: Build Xcode project
  977. run: xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build
  978. android-build:
  979. runs-on: ubuntu-latest
  980. steps:
  981. - name: Clone
  982. uses: actions/checkout@v4
  983. - name: ccache
  984. uses: hendrikmuhs/ccache-action@v1.2.16
  985. with:
  986. key: android-build
  987. evict-old-files: 1d
  988. - name: Set up JDK
  989. uses: actions/setup-java@v3
  990. with:
  991. java-version: 17
  992. distribution: zulu
  993. - name: Setup Android SDK
  994. uses: android-actions/setup-android@v3
  995. with:
  996. log-accepted-android-sdk-licenses: false
  997. - name: Build
  998. run: |
  999. cd examples/llama.android
  1000. ./gradlew build --no-daemon
  1001. openEuler-latest-cmake-cann:
  1002. if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'Ascend NPU') }}
  1003. defaults:
  1004. run:
  1005. shell: bash -el {0}
  1006. strategy:
  1007. matrix:
  1008. arch: [x86, aarch64]
  1009. cann:
  1010. - '8.1.RC1.alpha001-910b-openeuler22.03-py3.10'
  1011. device:
  1012. - 'ascend910b3'
  1013. build:
  1014. - 'Release'
  1015. runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
  1016. container: ascendai/cann:${{ matrix.cann }}
  1017. steps:
  1018. - name: Checkout
  1019. uses: actions/checkout@v4
  1020. - name: Dependencies
  1021. run: |
  1022. yum update -y
  1023. yum install -y git gcc gcc-c++ make cmake libcurl-devel
  1024. - name: Build
  1025. run: |
  1026. export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
  1027. cmake -S . -B build \
  1028. -DCMAKE_BUILD_TYPE=${{ matrix.build }} \
  1029. -DGGML_CANN=on \
  1030. -DSOC_TYPE=${{ matrix.device }}
  1031. cmake --build build -j $(nproc)