build.yml 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751
  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-latest
  55. steps:
  56. - name: Clone
  57. id: checkout
  58. uses: actions/checkout@v4
  59. - name: ccache
  60. uses: ggml-org/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. leaks -atExit -- ./build/bin/test-thread-safety -hf ggml-org/gemma-3-270m-qat-GGUF -ngl 99 -p "$(printf 'hello %.0s' {1..128})" -n 16 -c 512 -ub 32 -np 2 -t 2 -lv 1
  83. - name: Test
  84. id: cmake_test
  85. run: |
  86. cd build
  87. ctest -L 'main|curl' --verbose --timeout 900
  88. macOS-latest-cmake-x64:
  89. runs-on: macos-15-intel
  90. steps:
  91. - name: Clone
  92. id: checkout
  93. uses: actions/checkout@v4
  94. - name: ccache
  95. uses: ggml-org/ccache-action@v1.2.16
  96. with:
  97. key: macOS-latest-cmake-x64
  98. evict-old-files: 1d
  99. - name: Dependencies
  100. id: depends
  101. continue-on-error: true
  102. run: |
  103. brew update
  104. brew install curl
  105. - name: Build
  106. id: cmake_build
  107. run: |
  108. sysctl -a
  109. # Metal is disabled due to intermittent failures with Github runners not having a GPU:
  110. # https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313
  111. cmake -B build \
  112. -DCMAKE_BUILD_RPATH="@loader_path" \
  113. -DLLAMA_FATAL_WARNINGS=ON \
  114. -DGGML_METAL=OFF \
  115. -DGGML_RPC=ON \
  116. -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3
  117. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  118. - name: Test
  119. id: cmake_test
  120. run: |
  121. cd build
  122. ctest -L main --verbose --timeout 900
  123. macOS-latest-cmake-arm64-webgpu:
  124. runs-on: macos-latest
  125. steps:
  126. - name: Clone
  127. id: checkout
  128. uses: actions/checkout@v4
  129. - name: ccache
  130. uses: ggml-org/ccache-action@v1.2.16
  131. with:
  132. key: macOS-latest-cmake-arm64-webgpu
  133. evict-old-files: 1d
  134. - name: Dependencies
  135. id: depends
  136. continue-on-error: true
  137. run: |
  138. brew update
  139. brew install curl
  140. - name: Dawn Dependency
  141. id: dawn-depends
  142. run: |
  143. DAWN_VERSION="v2.0.0"
  144. DAWN_OWNER="reeselevine"
  145. DAWN_REPO="dawn"
  146. DAWN_ASSET_NAME="Dawn-5e9a4865b1635796ccc77dd30057f2b4002a1355-macos-latest-Release.zip"
  147. echo "Fetching release asset from https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  148. curl -L -o artifact.zip \
  149. "https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  150. mkdir dawn
  151. unzip artifact.zip
  152. tar -xvf Dawn-5e9a4865b1635796ccc77dd30057f2b4002a1355-macos-latest-Release.tar.gz -C dawn --strip-components=1
  153. - name: Build
  154. id: cmake_build
  155. run: |
  156. export CMAKE_PREFIX_PATH=dawn
  157. cmake -B build -DGGML_WEBGPU=ON -DGGML_METAL=OFF -DGGML_BLAS=OFF
  158. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  159. - name: Test
  160. id: cmake_test
  161. run: |
  162. cd build
  163. ctest -L main --verbose --timeout 900
  164. ubuntu-cpu-cmake:
  165. strategy:
  166. matrix:
  167. include:
  168. - build: 'x64'
  169. os: ubuntu-22.04
  170. - build: 'arm64'
  171. os: ubuntu-22.04-arm
  172. - build: 's390x'
  173. os: ubuntu-24.04-s390x
  174. - build: 'ppc64le'
  175. os: ubuntu-24.04-ppc64le
  176. runs-on: ${{ matrix.os }}
  177. steps:
  178. - name: Clone
  179. id: checkout
  180. uses: actions/checkout@v4
  181. - name: ccache
  182. uses: ggml-org/ccache-action@v1.2.16
  183. with:
  184. key: ubuntu-cpu-cmake-${{ matrix.build }}
  185. evict-old-files: 1d
  186. - name: Build Dependencies
  187. id: build_depends
  188. run: |
  189. sudo apt-get update
  190. sudo apt-get install -y --no-install-recommends \
  191. python3 python3-pip python3-dev \
  192. libjpeg-dev build-essential libssl-dev \
  193. git-lfs
  194. - name: Python Dependencies
  195. id: python_depends
  196. run: |
  197. python3 -m pip install --upgrade pip
  198. pip3 install ./gguf-py
  199. - name: Swap Endianness
  200. id: endianness
  201. if: ${{ matrix.build == 's390x' }}
  202. run: |
  203. for f in models/*.gguf; do
  204. echo YES | python3 gguf-py/gguf/scripts/gguf_convert_endian.py $f big
  205. done
  206. - name: Build
  207. id: cmake_build
  208. run: |
  209. cmake -B build \
  210. -DLLAMA_CURL=OFF \
  211. -DLLAMA_OPENSSL=ON \
  212. -DLLAMA_FATAL_WARNINGS=ON \
  213. -DGGML_RPC=ON
  214. cmake --build build --config Release -j $(nproc)
  215. - name: Test
  216. id: cmake_test
  217. run: |
  218. cd build
  219. ctest -L 'main|curl' --verbose --timeout 900
  220. - name: Test llama2c conversion
  221. id: llama2c_test
  222. if: ${{ matrix.build != 's390x' }}
  223. run: |
  224. cd build
  225. echo "Fetch tokenizer"
  226. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
  227. echo "Fetch llama2c model"
  228. wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
  229. ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
  230. ./bin/llama-cli -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
  231. - name: Test llama2c (s390x)
  232. id: llama2c_test_s390x
  233. if: ${{ matrix.build == 's390x' }}
  234. run: |
  235. cd build
  236. echo "Fetch llama2c big-endian model"
  237. wget https://huggingface.co/ggml-org/models/resolve/main/tinyllamas/stories260K-be.gguf
  238. ./bin/llama-cli -m stories260K-be.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
  239. ubuntu-latest-cmake-sanitizer:
  240. runs-on: ubuntu-latest
  241. continue-on-error: true
  242. strategy:
  243. matrix:
  244. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  245. build_type: [Debug]
  246. steps:
  247. - name: Clone
  248. id: checkout
  249. uses: actions/checkout@v4
  250. - name: ccache
  251. uses: ggml-org/ccache-action@v1.2.16
  252. with:
  253. key: ubuntu-latest-cmake-sanitizer-${{ matrix.sanitizer }}
  254. evict-old-files: 1d
  255. - name: Dependencies
  256. id: depends
  257. run: |
  258. sudo apt-get update
  259. sudo apt-get install build-essential libssl-dev
  260. - name: Build
  261. id: cmake_build
  262. if: ${{ matrix.sanitizer != 'THREAD' }}
  263. run: |
  264. cmake -B build \
  265. -DLLAMA_CURL=OFF \
  266. -DLLAMA_OPENSSL=ON \
  267. -DLLAMA_FATAL_WARNINGS=ON \
  268. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
  269. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  270. cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
  271. - name: Build (no OpenMP)
  272. id: cmake_build_no_openmp
  273. if: ${{ matrix.sanitizer == 'THREAD' }}
  274. run: |
  275. cmake -B build \
  276. -DLLAMA_CURL=OFF \
  277. -DLLAMA_OPENSSL=ON \
  278. -DLLAMA_FATAL_WARNINGS=ON \
  279. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
  280. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
  281. -DGGML_OPENMP=OFF
  282. cmake --build build --config ${{ matrix.build_type }} -j $(nproc)
  283. - name: Test
  284. id: cmake_test
  285. run: |
  286. cd build
  287. ctest -L main --verbose --timeout 900
  288. ubuntu-latest-llguidance:
  289. runs-on: ubuntu-latest
  290. steps:
  291. - name: Clone
  292. id: checkout
  293. uses: actions/checkout@v4
  294. - name: Dependencies
  295. id: depends
  296. run: |
  297. sudo apt-get update
  298. sudo apt-get install build-essential libssl-dev
  299. - name: Build
  300. id: cmake_build
  301. run: |
  302. mkdir build
  303. cd build
  304. cmake .. \
  305. -DLLAMA_CURL=OFF \
  306. -DLLAMA_OPENSSL=ON \
  307. -DLLAMA_FATAL_WARNINGS=ON \
  308. -DLLAMA_LLGUIDANCE=ON
  309. cmake --build . --config Release -j $(nproc)
  310. - name: Test
  311. id: cmake_test
  312. run: |
  313. cd build
  314. ctest -L main --verbose --timeout 900
  315. ubuntu-latest-cmake-rpc:
  316. runs-on: ubuntu-latest
  317. continue-on-error: true
  318. steps:
  319. - name: Clone
  320. id: checkout
  321. uses: actions/checkout@v4
  322. # - name: ccache
  323. # uses: ggml-org/ccache-action@v1.2.16
  324. # with:
  325. # key: ubuntu-latest-cmake-rpc
  326. # evict-old-files: 1d
  327. - name: Dependencies
  328. id: depends
  329. run: |
  330. sudo apt-get update
  331. sudo apt-get install build-essential libssl-dev
  332. - name: Build
  333. id: cmake_build
  334. run: |
  335. cmake -B build \
  336. -DLLAMA_CURL=OFF \
  337. -DLLAMA_OPENSSL=ON \
  338. -DGGML_RPC=ON
  339. cmake --build build --config Release -j $(nproc)
  340. - name: Test
  341. id: cmake_test
  342. run: |
  343. cd build
  344. ctest -L main --verbose
  345. ubuntu-24-cmake-vulkan-deb:
  346. runs-on: ubuntu-24.04
  347. steps:
  348. - name: Clone
  349. id: checkout
  350. uses: actions/checkout@v4
  351. - name: ccache
  352. uses: ggml-org/ccache-action@v1.2.16
  353. with:
  354. key: ubuntu-24-cmake-vulkan-deb
  355. evict-old-files: 1d
  356. - name: Dependencies
  357. id: depends
  358. run: |
  359. sudo apt-get install -y glslc libvulkan-dev libssl-dev
  360. - name: Configure
  361. id: cmake_configure
  362. run: |
  363. cmake -B build \
  364. -DLLAMA_CURL=OFF \
  365. -DLLAMA_OPENSSL=ON \
  366. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  367. -DGGML_BACKEND_DL=ON \
  368. -DGGML_CPU_ALL_VARIANTS=ON \
  369. -DGGML_VULKAN=ON
  370. - name: Build
  371. id: cmake_build
  372. run: |
  373. cmake --build build -j $(nproc)
  374. ubuntu-24-cmake-vulkan:
  375. runs-on: ubuntu-24.04
  376. steps:
  377. - name: Clone
  378. id: checkout
  379. uses: actions/checkout@v4
  380. - name: ccache
  381. uses: ggml-org/ccache-action@v1.2.16
  382. with:
  383. key: ubuntu-24-cmake-vulkan
  384. evict-old-files: 1d
  385. - name: Dependencies
  386. id: depends
  387. run: |
  388. sudo add-apt-repository -y ppa:kisak/kisak-mesa
  389. sudo apt-get update -y
  390. sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev
  391. - name: Get latest Vulkan SDK version
  392. id: vulkan_sdk_version
  393. run: |
  394. echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
  395. - name: Use Vulkan SDK Cache
  396. uses: actions/cache@v4
  397. id: cache-sdk
  398. with:
  399. path: ./vulkan_sdk
  400. key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
  401. - name: Setup Vulkan SDK
  402. if: steps.cache-sdk.outputs.cache-hit != 'true'
  403. uses: ./.github/actions/linux-setup-vulkan
  404. with:
  405. path: ./vulkan_sdk
  406. version: ${{ env.VULKAN_SDK_VERSION }}
  407. - name: Build
  408. id: cmake_build
  409. run: |
  410. source ./vulkan_sdk/setup-env.sh
  411. cmake -B build \
  412. -DLLAMA_CURL=OFF \
  413. -DLLAMA_OPENSSL=ON \
  414. -DGGML_VULKAN=ON
  415. cmake --build build --config Release -j $(nproc)
  416. - name: Test
  417. id: cmake_test
  418. run: |
  419. cd build
  420. export GGML_VK_VISIBLE_DEVICES=0
  421. export GGML_VK_DISABLE_F16=1
  422. # This is using llvmpipe and runs slower than other backends
  423. ctest -L main --verbose --timeout 4200
  424. ubuntu-24-cmake-webgpu:
  425. runs-on: ubuntu-24.04
  426. steps:
  427. - name: Clone
  428. id: checkout
  429. uses: actions/checkout@v4
  430. - name: ccache
  431. uses: ggml-org/ccache-action@v1.2.16
  432. with:
  433. key: ubuntu-24-cmake-webgpu
  434. evict-old-files: 1d
  435. - name: Dependencies
  436. id: depends
  437. run: |
  438. sudo add-apt-repository -y ppa:kisak/kisak-mesa
  439. sudo apt-get update -y
  440. sudo apt-get install -y build-essential mesa-vulkan-drivers libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev
  441. - name: Get latest Vulkan SDK version
  442. id: vulkan_sdk_version
  443. run: |
  444. echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
  445. - name: Use Vulkan SDK Cache
  446. uses: actions/cache@v4
  447. id: cache-sdk
  448. with:
  449. path: ./vulkan_sdk
  450. key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
  451. - name: Setup Vulkan SDK
  452. if: steps.cache-sdk.outputs.cache-hit != 'true'
  453. uses: ./.github/actions/linux-setup-vulkan
  454. with:
  455. path: ./vulkan_sdk
  456. version: ${{ env.VULKAN_SDK_VERSION }}
  457. - name: Dawn Dependency
  458. id: dawn-depends
  459. run: |
  460. sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev libxi-dev
  461. DAWN_VERSION="v2.0.0"
  462. DAWN_OWNER="reeselevine"
  463. DAWN_REPO="dawn"
  464. DAWN_ASSET_NAME="Dawn-5e9a4865b1635796ccc77dd30057f2b4002a1355-ubuntu-latest-Release.zip"
  465. echo "Fetching release asset from https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  466. curl -L -o artifact.zip \
  467. "https://github.com/${DAWN_OWNER}/${DAWN_REPO}/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}"
  468. mkdir dawn
  469. unzip artifact.zip
  470. tar -xvf Dawn-5e9a4865b1635796ccc77dd30057f2b4002a1355-ubuntu-latest-Release.tar.gz -C dawn --strip-components=1
  471. - name: Build
  472. id: cmake_build
  473. run: |
  474. export Dawn_DIR=dawn/lib64/cmake/Dawn
  475. cmake -B build \
  476. -DLLAMA_CURL=OFF \
  477. -DLLAMA_OPENSSL=ON \
  478. -DGGML_WEBGPU=ON
  479. cmake --build build --config Release -j $(nproc)
  480. - name: Test
  481. id: cmake_test
  482. run: |
  483. cd build
  484. # This is using llvmpipe and runs slower than other backends
  485. ctest -L main --verbose --timeout 3600
  486. ubuntu-22-cmake-hip:
  487. runs-on: ubuntu-22.04
  488. container: rocm/dev-ubuntu-22.04:6.1.2
  489. steps:
  490. - name: Clone
  491. id: checkout
  492. uses: actions/checkout@v4
  493. - name: Dependencies
  494. id: depends
  495. run: |
  496. sudo apt-get update
  497. sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libssl-dev rocwmma-dev
  498. - name: ccache
  499. uses: ggml-org/ccache-action@v1.2.16
  500. with:
  501. key: ubuntu-22-cmake-hip
  502. evict-old-files: 1d
  503. - name: Build with native CMake HIP support
  504. id: cmake_build
  505. run: |
  506. cmake -B build -S . \
  507. -DLLAMA_CURL=OFF \
  508. -DLLAMA_OPENSSL=ON \
  509. -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
  510. -DGGML_HIP_ROCWMMA_FATTN=ON \
  511. -DGGML_HIP=ON
  512. cmake --build build --config Release -j $(nproc)
  513. ubuntu-22-cmake-musa:
  514. runs-on: ubuntu-22.04
  515. container: mthreads/musa:rc4.3.0-devel-ubuntu22.04-amd64
  516. steps:
  517. - name: Clone
  518. id: checkout
  519. uses: actions/checkout@v4
  520. - name: Dependencies
  521. id: depends
  522. run: |
  523. apt-get update
  524. apt-get install -y build-essential git cmake libssl-dev
  525. - name: ccache
  526. uses: ggml-org/ccache-action@v1.2.16
  527. with:
  528. key: ubuntu-22-cmake-musa
  529. evict-old-files: 1d
  530. - name: Build with native CMake MUSA support
  531. id: cmake_build
  532. run: |
  533. cmake -B build -S . \
  534. -DLLAMA_CURL=OFF \
  535. -DLLAMA_OPENSSL=ON \
  536. -DGGML_MUSA=ON
  537. cmake --build build --config Release -j $(nproc)
  538. ubuntu-22-cmake-sycl:
  539. runs-on: ubuntu-22.04
  540. continue-on-error: true
  541. steps:
  542. - uses: actions/checkout@v4
  543. - name: add oneAPI to apt
  544. shell: bash
  545. run: |
  546. cd /tmp
  547. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  548. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  549. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  550. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  551. - name: install oneAPI dpcpp compiler
  552. shell: bash
  553. run: |
  554. sudo apt update
  555. sudo apt install intel-oneapi-compiler-dpcpp-cpp libssl-dev
  556. - name: install oneAPI MKL library
  557. shell: bash
  558. run: |
  559. sudo apt install intel-oneapi-mkl-devel
  560. - name: Clone
  561. id: checkout
  562. uses: actions/checkout@v4
  563. - name: ccache
  564. uses: ggml-org/ccache-action@v1.2.16
  565. with:
  566. key: ubuntu-22-cmake-sycl
  567. evict-old-files: 1d
  568. - name: Build
  569. id: cmake_build
  570. run: |
  571. source /opt/intel/oneapi/setvars.sh
  572. cmake -B build \
  573. -DLLAMA_CURL=OFF \
  574. -DLLAMA_OPENSSL=ON \
  575. -DGGML_SYCL=ON \
  576. -DCMAKE_C_COMPILER=icx \
  577. -DCMAKE_CXX_COMPILER=icpx
  578. cmake --build build --config Release -j $(nproc)
  579. ubuntu-22-cmake-sycl-fp16:
  580. runs-on: ubuntu-22.04
  581. continue-on-error: true
  582. steps:
  583. - uses: actions/checkout@v4
  584. - name: add oneAPI to apt
  585. shell: bash
  586. run: |
  587. cd /tmp
  588. wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  589. sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  590. rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
  591. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  592. - name: install oneAPI dpcpp compiler
  593. shell: bash
  594. run: |
  595. sudo apt update
  596. sudo apt install intel-oneapi-compiler-dpcpp-cpp libssl-dev
  597. - name: install oneAPI MKL library
  598. shell: bash
  599. run: |
  600. sudo apt install intel-oneapi-mkl-devel
  601. - name: Clone
  602. id: checkout
  603. uses: actions/checkout@v4
  604. - name: ccache
  605. uses: ggml-org/ccache-action@v1.2.16
  606. with:
  607. key: ubuntu-22-cmake-sycl-fp16
  608. evict-old-files: 1d
  609. - name: Build
  610. id: cmake_build
  611. run: |
  612. source /opt/intel/oneapi/setvars.sh
  613. cmake -B build \
  614. -DLLAMA_CURL=OFF \
  615. -DLLAMA_OPENSSL=ON \
  616. -DGGML_SYCL=ON \
  617. -DCMAKE_C_COMPILER=icx \
  618. -DCMAKE_CXX_COMPILER=icpx \
  619. -DGGML_SYCL_F16=ON
  620. cmake --build build --config Release -j $(nproc)
  621. build-linux-cross:
  622. uses: ./.github/workflows/build-linux-cross.yml
  623. build-cmake-pkg:
  624. uses: ./.github/workflows/build-cmake-pkg.yml
  625. macOS-latest-cmake-ios:
  626. runs-on: macos-latest
  627. steps:
  628. - name: Clone
  629. id: checkout
  630. uses: actions/checkout@v4
  631. - name: ccache
  632. uses: ggml-org/ccache-action@v1.2.16
  633. with:
  634. key: macOS-latest-cmake-ios
  635. evict-old-files: 1d
  636. - name: Dependencies
  637. id: depends
  638. continue-on-error: true
  639. run: |
  640. brew update
  641. - name: Build
  642. id: cmake_build
  643. run: |
  644. sysctl -a
  645. cmake -B build -G Xcode \
  646. -DGGML_METAL_USE_BF16=ON \
  647. -DGGML_METAL_EMBED_LIBRARY=ON \
  648. -DLLAMA_BUILD_COMMON=OFF \
  649. -DLLAMA_BUILD_EXAMPLES=OFF \
  650. -DLLAMA_BUILD_TOOLS=OFF \
  651. -DLLAMA_BUILD_TESTS=OFF \
  652. -DLLAMA_BUILD_SERVER=OFF \
  653. -DCMAKE_SYSTEM_NAME=iOS \
  654. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  655. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  656. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  657. macOS-latest-cmake-tvos:
  658. runs-on: macos-latest
  659. steps:
  660. - name: Clone
  661. id: checkout
  662. uses: actions/checkout@v4
  663. - name: ccache
  664. uses: ggml-org/ccache-action@v1.2.16
  665. with:
  666. key: macOS-latest-cmake-tvos
  667. evict-old-files: 1d
  668. - name: Dependencies
  669. id: depends
  670. continue-on-error: true
  671. run: |
  672. brew update
  673. - name: Build
  674. id: cmake_build
  675. run: |
  676. sysctl -a
  677. cmake -B build -G Xcode \
  678. -DGGML_METAL_USE_BF16=ON \
  679. -DGGML_METAL_EMBED_LIBRARY=ON \
  680. -DLLAMA_BUILD_COMMON=OFF \
  681. -DLLAMA_BUILD_EXAMPLES=OFF \
  682. -DLLAMA_BUILD_TOOLS=OFF \
  683. -DLLAMA_BUILD_TESTS=OFF \
  684. -DLLAMA_BUILD_SERVER=OFF \
  685. -DCMAKE_SYSTEM_NAME=tvOS \
  686. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  687. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  688. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  689. macOS-latest-cmake-visionos:
  690. runs-on: macos-latest
  691. steps:
  692. - name: Clone
  693. id: checkout
  694. uses: actions/checkout@v4
  695. - name: Dependencies
  696. id: depends
  697. continue-on-error: true
  698. run: |
  699. brew update
  700. - name: Build
  701. id: cmake_build
  702. run: |
  703. sysctl -a
  704. cmake -B build -G Xcode \
  705. -DGGML_METAL_USE_BF16=ON \
  706. -DGGML_METAL_EMBED_LIBRARY=ON \
  707. -DLLAMA_BUILD_COMMON=OFF \
  708. -DLLAMA_BUILD_EXAMPLES=OFF \
  709. -DLLAMA_BUILD_TOOLS=OFF \
  710. -DLLAMA_BUILD_TESTS=OFF \
  711. -DLLAMA_BUILD_SERVER=OFF \
  712. -DCMAKE_SYSTEM_NAME=visionOS \
  713. -DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
  714. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  715. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  716. macOS-latest-swift:
  717. runs-on: macos-latest
  718. needs: ios-xcode-build
  719. strategy:
  720. matrix:
  721. destination: ['generic/platform=macOS', 'generic/platform=iOS', 'generic/platform=tvOS']
  722. steps:
  723. - name: Clone
  724. id: checkout
  725. uses: actions/checkout@v4
  726. - name: ccache
  727. uses: ggml-org/ccache-action@v1.2.16
  728. with:
  729. key: macOS-latest-swift
  730. evict-old-files: 1d
  731. - name: Download xcframework artifact
  732. uses: actions/download-artifact@v4
  733. with:
  734. name: llama-xcframework
  735. path: build-apple/llama.xcframework/
  736. - name: Dependencies
  737. id: depends
  738. continue-on-error: true
  739. run: |
  740. brew update
  741. - name: Build llama.cpp with CMake
  742. id: cmake_build
  743. run: |
  744. sysctl -a
  745. cmake -B build -G Xcode \
  746. -DGGML_METAL_USE_BF16=ON \
  747. -DGGML_METAL_EMBED_LIBRARY=ON \
  748. -DLLAMA_CURL=OFF \
  749. -DLLAMA_BUILD_EXAMPLES=OFF \
  750. -DLLAMA_BUILD_TOOLS=OFF \
  751. -DLLAMA_BUILD_TESTS=OFF \
  752. -DLLAMA_BUILD_SERVER=OFF \
  753. -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
  754. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
  755. windows-msys2:
  756. runs-on: windows-2025
  757. strategy:
  758. fail-fast: false
  759. matrix:
  760. include:
  761. - { sys: UCRT64, env: ucrt-x86_64, build: Release }
  762. - { sys: CLANG64, env: clang-x86_64, build: Release }
  763. steps:
  764. - name: Clone
  765. uses: actions/checkout@v4
  766. - name: ccache
  767. uses: ggml-org/ccache-action@v1.2.16
  768. with:
  769. key: windows-msys2
  770. variant: ccache
  771. evict-old-files: 1d
  772. - name: Setup ${{ matrix.sys }}
  773. uses: msys2/setup-msys2@v2
  774. with:
  775. update: true
  776. msystem: ${{matrix.sys}}
  777. install: >-
  778. base-devel
  779. git
  780. mingw-w64-${{matrix.env}}-toolchain
  781. mingw-w64-${{matrix.env}}-cmake
  782. mingw-w64-${{matrix.env}}-openblas
  783. - name: Build using CMake
  784. shell: msys2 {0}
  785. run: |
  786. cmake -B build
  787. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  788. - name: Clean after building using CMake
  789. shell: msys2 {0}
  790. run: |
  791. rm -rf build
  792. - name: Build using CMake w/ OpenBLAS
  793. shell: msys2 {0}
  794. run: |
  795. cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
  796. cmake --build build --config ${{ matrix.build }} -j $(nproc)
  797. windows-latest-cmake:
  798. runs-on: windows-2025
  799. env:
  800. OPENBLAS_VERSION: 0.3.23
  801. SDE_VERSION: 9.33.0-2024-01-07
  802. VULKAN_VERSION: 1.4.313.2
  803. strategy:
  804. matrix:
  805. include:
  806. - build: 'cpu-x64 (static)'
  807. arch: 'x64'
  808. 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'
  809. - build: 'openblas-x64'
  810. arch: 'x64'
  811. 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"'
  812. - build: 'vulkan-x64'
  813. arch: 'x64'
  814. 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'
  815. - build: 'llvm-arm64'
  816. arch: 'arm64'
  817. defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
  818. - build: 'llvm-arm64-opencl-adreno'
  819. arch: 'arm64'
  820. 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'
  821. steps:
  822. - name: Clone
  823. id: checkout
  824. uses: actions/checkout@v4
  825. - name: ccache
  826. uses: ggml-org/ccache-action@v1.2.16
  827. with:
  828. key: windows-latest-cmake-${{ matrix.build }}
  829. variant: ccache
  830. evict-old-files: 1d
  831. - name: Download OpenBLAS
  832. id: get_openblas
  833. if: ${{ matrix.build == 'openblas-x64' }}
  834. run: |
  835. 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"
  836. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  837. mkdir $env:RUNNER_TEMP/openblas
  838. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  839. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  840. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  841. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  842. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  843. - name: Install Vulkan SDK
  844. id: get_vulkan
  845. if: ${{ matrix.build == 'vulkan-x64' }}
  846. run: |
  847. 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"
  848. & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
  849. Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}"
  850. Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin"
  851. - name: Install Ninja
  852. id: install_ninja
  853. run: |
  854. choco install ninja
  855. - name: Install OpenCL Headers and Libs
  856. id: install_opencl
  857. if: ${{ matrix.build == 'llvm-arm64-opencl-adreno' }}
  858. run: |
  859. git clone https://github.com/KhronosGroup/OpenCL-Headers
  860. cd OpenCL-Headers
  861. cmake -B build `
  862. -DBUILD_TESTING=OFF `
  863. -DOPENCL_HEADERS_BUILD_TESTING=OFF `
  864. -DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF `
  865. -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
  866. cmake --build build --target install
  867. git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader
  868. cd OpenCL-ICD-Loader
  869. cmake -B build-arm64-release `
  870. -A arm64 `
  871. -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" `
  872. -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release"
  873. cmake --build build-arm64-release --target install --config release
  874. - name: libCURL
  875. id: get_libcurl
  876. uses: ./.github/actions/windows-setup-curl
  877. with:
  878. architecture: ${{ matrix.arch == 'x64' && 'win64' || 'win64a' }}
  879. - name: Build
  880. id: cmake_build
  881. env:
  882. CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
  883. run: |
  884. cmake -S . -B build ${{ matrix.defines }} `
  885. -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
  886. cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS}
  887. cp $env:CURL_PATH/bin/libcurl-*.dll build/bin/Release
  888. - name: Add libopenblas.dll
  889. id: add_libopenblas_dll
  890. if: ${{ matrix.build == 'openblas-x64' }}
  891. run: |
  892. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  893. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  894. - name: Test
  895. id: cmake_test
  896. if: ${{ matrix.arch == 'x64' }}
  897. run: |
  898. cd build
  899. ctest -L main -C Release --verbose --timeout 900
  900. # TODO: disabled for now, consider adding tests for all CPU variants instead
  901. # - name: Test (Intel SDE)
  902. # id: cmake_test_sde
  903. # if: ${{ matrix.build == 'avx512-x64' && env.HAS_AVX512F == '0' }} # use Intel SDE for AVX-512 emulation
  904. # run: |
  905. # curl.exe -o $env:RUNNER_TEMP/sde.tar.xz -L "https://downloadmirror.intel.com/813591/sde-external-${env:SDE_VERSION}-win.tar.xz"
  906. # # for some weird reason windows tar doesn't like sde tar.xz
  907. # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar.xz
  908. # 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/sde.tar
  909. # $sde = $(join-path $env:RUNNER_TEMP sde-external-${env:SDE_VERSION}-win/sde.exe)
  910. # cd build
  911. # $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1
  912. # & $sde -future -- ctest -L main -C Release --verbose --timeout 900
  913. ubuntu-latest-cmake-cuda:
  914. runs-on: ubuntu-latest
  915. container: nvidia/cuda:12.6.2-devel-ubuntu24.04
  916. steps:
  917. - name: Clone
  918. id: checkout
  919. uses: actions/checkout@v4
  920. - name: Install dependencies
  921. env:
  922. DEBIAN_FRONTEND: noninteractive
  923. run: |
  924. apt update
  925. apt install -y cmake build-essential ninja-build libgomp1 git libssl-dev
  926. - name: ccache
  927. uses: ggml-org/ccache-action@v1.2.16
  928. with:
  929. key: ubuntu-latest-cmake-cuda
  930. evict-old-files: 1d
  931. - name: Build with CMake
  932. run: |
  933. cmake -S . -B build -G Ninja \
  934. -DLLAMA_CURL=OFF \
  935. -DLLAMA_OPENSSL=ON \
  936. -DLLAMA_FATAL_WARNINGS=ON \
  937. -DCMAKE_BUILD_TYPE=Release \
  938. -DCMAKE_CUDA_ARCHITECTURES=89-real \
  939. -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
  940. -DGGML_NATIVE=OFF \
  941. -DGGML_CUDA=ON
  942. cmake --build build
  943. windows-2022-cmake-cuda:
  944. runs-on: windows-2022
  945. strategy:
  946. matrix:
  947. cuda: ['12.4']
  948. steps:
  949. - name: Clone
  950. id: checkout
  951. uses: actions/checkout@v4
  952. - name: Install ccache
  953. uses: ggml-org/ccache-action@v1.2.16
  954. with:
  955. key: windows-cuda-${{ matrix.cuda }}
  956. variant: ccache
  957. evict-old-files: 1d
  958. - name: Install Cuda Toolkit
  959. uses: ./.github/actions/windows-setup-cuda
  960. with:
  961. cuda_version: ${{ matrix.cuda }}
  962. - name: Install Ninja
  963. id: install_ninja
  964. run: |
  965. choco install ninja
  966. - name: libCURL
  967. id: get_libcurl
  968. uses: ./.github/actions/windows-setup-curl
  969. - name: Build
  970. id: cmake_build
  971. shell: cmd
  972. env:
  973. CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
  974. run: |
  975. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
  976. cmake -S . -B build -G "Ninja Multi-Config" ^
  977. -DLLAMA_BUILD_SERVER=ON ^
  978. -DGGML_NATIVE=OFF ^
  979. -DGGML_BACKEND_DL=ON ^
  980. -DGGML_CPU_ALL_VARIANTS=ON ^
  981. -DGGML_CUDA=ON ^
  982. -DGGML_RPC=ON ^
  983. -DCURL_LIBRARY="%CURL_PATH%/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="%CURL_PATH%/include"
  984. set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1
  985. cmake --build build --config Release -j %NINJA_JOBS% -t ggml
  986. cmake --build build --config Release
  987. windows-latest-cmake-sycl:
  988. runs-on: windows-2022
  989. defaults:
  990. run:
  991. shell: bash
  992. env:
  993. WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/24751ead-ddc5-4479-b9e6-f9fe2ff8b9f2/intel-deep-learning-essentials-2025.2.1.25_offline.exe
  994. WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
  995. ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
  996. steps:
  997. - name: Clone
  998. id: checkout
  999. uses: actions/checkout@v4
  1000. - name: ccache
  1001. uses: ggml-org/ccache-action@v1.2.16
  1002. with:
  1003. key: windows-latest-cmake-sycl
  1004. variant: ccache
  1005. evict-old-files: 1d
  1006. - name: Install
  1007. run: |
  1008. scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
  1009. # TODO: add libcurl support ; we will also need to modify win-build-sycl.bat to accept user-specified args
  1010. - name: Build
  1011. id: cmake_build
  1012. run: examples/sycl/win-build-sycl.bat
  1013. windows-latest-cmake-hip:
  1014. runs-on: windows-2022
  1015. env:
  1016. # The ROCm version must correspond to the version used in the HIP SDK.
  1017. ROCM_VERSION: "6.4.2"
  1018. # Make sure this is in sync with build-cache.yml
  1019. HIPSDK_INSTALLER_VERSION: "25.Q3"
  1020. steps:
  1021. - name: Clone
  1022. id: checkout
  1023. uses: actions/checkout@v4
  1024. - name: Grab rocWMMA package
  1025. id: grab_rocwmma
  1026. run: |
  1027. curl -o rocwmma.deb "https://repo.radeon.com/rocm/apt/${{ env.ROCM_VERSION }}/pool/main/r/rocwmma-dev/rocwmma-dev_1.7.0.60402-120~24.04_amd64.deb"
  1028. 7z x rocwmma.deb
  1029. 7z x data.tar
  1030. - name: Use ROCm Installation Cache
  1031. uses: actions/cache@v4
  1032. id: cache-rocm
  1033. with:
  1034. path: C:\Program Files\AMD\ROCm
  1035. key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
  1036. - name: Setup ROCm
  1037. if: steps.cache-rocm.outputs.cache-hit != 'true'
  1038. uses: ./.github/actions/windows-setup-rocm
  1039. with:
  1040. version: ${{ env.HIPSDK_INSTALLER_VERSION }}
  1041. - name: Verify ROCm
  1042. id: verify
  1043. run: |
  1044. # Find and test ROCm installation
  1045. $clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
  1046. if (-not $clangPath) {
  1047. Write-Error "ROCm installation not found"
  1048. exit 1
  1049. }
  1050. & $clangPath.FullName --version
  1051. - name: Install ccache
  1052. uses: ggml-org/ccache-action@v1.2.16
  1053. with:
  1054. key: ${{ github.job }}
  1055. evict-old-files: 1d
  1056. - name: libCURL
  1057. id: get_libcurl
  1058. uses: ./.github/actions/windows-setup-curl
  1059. - name: Build
  1060. id: cmake_build
  1061. env:
  1062. CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }}
  1063. run: |
  1064. $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
  1065. $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
  1066. cmake -G "Unix Makefiles" -B build -S . `
  1067. -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" `
  1068. -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" `
  1069. -DCMAKE_CXX_FLAGS="-I$($PWD.Path.Replace('\', '/'))/opt/rocm-${{ env.ROCM_VERSION }}/include/" `
  1070. -DCMAKE_BUILD_TYPE=Release `
  1071. -DROCM_DIR="${env:HIP_PATH}" `
  1072. -DGGML_HIP=ON `
  1073. -DGGML_HIP_ROCWMMA_FATTN=ON `
  1074. -DGGML_RPC=ON `
  1075. -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include"
  1076. cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
  1077. ios-xcode-build:
  1078. runs-on: macos-latest
  1079. steps:
  1080. - name: Checkout code
  1081. uses: actions/checkout@v4
  1082. - name: Setup Xcode
  1083. uses: maxim-lobanov/setup-xcode@v1
  1084. with:
  1085. xcode-version: latest-stable
  1086. - name: Build
  1087. id: cmake_build
  1088. run: |
  1089. sysctl -a
  1090. cmake -B build -G Xcode \
  1091. -DGGML_METAL_USE_BF16=ON \
  1092. -DGGML_METAL_EMBED_LIBRARY=ON \
  1093. -DLLAMA_CURL=OFF \
  1094. -DLLAMA_BUILD_EXAMPLES=OFF \
  1095. -DLLAMA_BUILD_TOOLS=OFF \
  1096. -DLLAMA_BUILD_TESTS=OFF \
  1097. -DLLAMA_BUILD_SERVER=OFF \
  1098. -DCMAKE_SYSTEM_NAME=iOS \
  1099. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
  1100. -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
  1101. cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
  1102. - name: xcodebuild for swift package
  1103. id: xcodebuild
  1104. run: |
  1105. ./build-xcframework.sh
  1106. - name: Upload xcframework artifact
  1107. uses: actions/upload-artifact@v4
  1108. with:
  1109. name: llama-xcframework
  1110. path: build-apple/llama.xcframework/
  1111. retention-days: 1
  1112. - name: Build Xcode project
  1113. run: |
  1114. xcodebuild -downloadPlatform iOS
  1115. 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
  1116. android-build:
  1117. runs-on: ubuntu-latest
  1118. steps:
  1119. - name: Clone
  1120. uses: actions/checkout@v4
  1121. # Disabled due to size (400MB) and always 0 cache hits
  1122. # - name: ccache
  1123. # uses: ggml-org/ccache-action@v1.2.16
  1124. # with:
  1125. # key: android-build
  1126. # evict-old-files: 1d
  1127. - name: Set up JDK
  1128. uses: actions/setup-java@v3
  1129. with:
  1130. java-version: 17
  1131. distribution: zulu
  1132. - name: Setup Android SDK
  1133. uses: android-actions/setup-android@v3
  1134. with:
  1135. log-accepted-android-sdk-licenses: false
  1136. - name: Build
  1137. run: |
  1138. cd examples/llama.android
  1139. ./gradlew build --no-daemon
  1140. android-ndk-build:
  1141. runs-on: ubuntu-latest
  1142. env:
  1143. OPENCL_VERSION: 2025.07.22
  1144. strategy:
  1145. matrix:
  1146. include:
  1147. - build: 'arm64-cpu'
  1148. defines: '-D ANDROID_ABI=arm64-v8a -D ANDROID_PLATFORM=android-31 -D CMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -D GGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.5-a+fp16+i8mm -G Ninja -D LLAMA_CURL=OFF -D GGML_OPENMP=OFF'
  1149. - build: 'arm64-snapdragon'
  1150. defines: '--preset arm64-android-snapdragon-release'
  1151. steps:
  1152. - name: Clone
  1153. id: checkout
  1154. uses: actions/checkout@v4
  1155. - name: Install OpenCL Headers and Libs
  1156. id: install_opencl
  1157. if: ${{ matrix.build == 'arm64-snapdragon' }}
  1158. run: |
  1159. mkdir opencl
  1160. curl -L -o opencl/clhpp.tar.gz https://github.com/KhronosGroup/OpenCL-CLHPP/archive/refs/tags/v${OPENCL_VERSION}.tar.gz
  1161. curl -L -o opencl/headers.tar.gz https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v${OPENCL_VERSION}.tar.gz
  1162. curl -L -o opencl/icd-loader.tar.gz https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/refs/tags/v${OPENCL_VERSION}.tar.gz
  1163. tar -xaf opencl/headers.tar.gz -C opencl
  1164. tar -xaf opencl/clhpp.tar.gz -C opencl
  1165. tar -xaf opencl/icd-loader.tar.gz -C opencl
  1166. sudo cp -r opencl/OpenCL-Headers-${OPENCL_VERSION}/CL ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
  1167. sudo cp -r opencl/OpenCL-CLHPP-${OPENCL_VERSION}/include/CL/* ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/CL
  1168. cd opencl/OpenCL-ICD-Loader-${OPENCL_VERSION}
  1169. cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=31 -DANDROID_STL=c++_shared
  1170. cmake --build build
  1171. sudo cp build/libOpenCL.so ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android
  1172. rm -rf opencl
  1173. - name: Install Hexagon SDK
  1174. id: install_hexsdk
  1175. if: ${{ matrix.build == 'arm64-snapdragon' }}
  1176. env:
  1177. HEXSDK_VER: 6.4.0.2
  1178. HEXTLS_VER: 19.0.04
  1179. run: |
  1180. curl -L -o hex-sdk.tar.gz https://github.com/snapdragon-toolchain/hexagon-sdk/releases/download/v$HEXSDK_VER/hexagon-sdk-v$HEXSDK_VER-amd64-lnx.tar.xz
  1181. mkdir hex-sdk
  1182. tar -xaf hex-sdk.tar.gz -C hex-sdk
  1183. ls -l hex-sdk
  1184. sudo mv hex-sdk /opt/hexagon
  1185. echo "HEXAGON_SDK_ROOT=/opt/hexagon/$HEXSDK_VER" >> "$GITHUB_ENV"
  1186. echo "HEXAGON_TOOLS_ROOT=/opt/hexagon/$HEXSDK_VER/tools/HEXAGON_Tools/$HEXTLS_VER" >> "$GITHUB_ENV"
  1187. echo "DEFAULT_HLOS_ARCH=64" >> "$GITHUB_ENV"
  1188. echo "DEFAULT_TOOLS_VARIANT=toolv19" >> "$GITHUB_ENV"
  1189. echo "DEFAULT_NO_QURT_INC=0" >> "$GITHUB_ENV"
  1190. echo "DEFAULT_DSP_ARCH=v73" >> "$GITHUB_ENV"
  1191. - name: Update CMake presets
  1192. id: update_presets
  1193. if: ${{ matrix.build == 'arm64-snapdragon' }}
  1194. run: |
  1195. cp docs/backend/hexagon/CMakeUserPresets.json .
  1196. - name: Build
  1197. id: ndk_build
  1198. run: |
  1199. cmake ${{ matrix.defines }} -B build
  1200. cmake --build build
  1201. cmake --install build --prefix pkg-adb/llama.cpp
  1202. - name: Test
  1203. id: cmake_test
  1204. run: |
  1205. echo "FIXME: test on devices"
  1206. openEuler-latest-cmake-cann:
  1207. if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'Ascend NPU') }}
  1208. defaults:
  1209. run:
  1210. shell: bash -el {0}
  1211. strategy:
  1212. matrix:
  1213. arch: [x86, aarch64]
  1214. chip_type: ['910b', '310p']
  1215. build: ['Release']
  1216. runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
  1217. container: ascendai/cann:${{ matrix.chip_type == '910b' && '8.3.rc1.alpha001-910b-openeuler22.03-py3.11' || '8.2.rc1-310p-openeuler22.03-py3.11' }}
  1218. steps:
  1219. - name: Checkout
  1220. uses: actions/checkout@v4
  1221. - name: Dependencies
  1222. run: |
  1223. yum update -y
  1224. yum install -y git gcc gcc-c++ make cmake libcurl-devel
  1225. - name: Build
  1226. run: |
  1227. export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
  1228. cmake -S . -B build \
  1229. -DCMAKE_BUILD_TYPE=${{ matrix.build }} \
  1230. -DGGML_CANN=on \
  1231. -DSOC_TYPE=ascend${{ matrix.chip_type }}
  1232. cmake --build build -j $(nproc)
  1233. # TODO: simplify the following workflows using a matrix
  1234. # TODO: run lighter CI on PRs and the full CI only on master (if needed)
  1235. ggml-ci-x64-cpu-low-perf:
  1236. runs-on: ubuntu-22.04
  1237. steps:
  1238. - name: Clone
  1239. id: checkout
  1240. uses: actions/checkout@v4
  1241. - name: ccache
  1242. uses: ggml-org/ccache-action@v1.2.16
  1243. with:
  1244. key: ggml-ci-x64-cpu-low-perf
  1245. evict-old-files: 1d
  1246. - name: Dependencies
  1247. id: depends
  1248. run: |
  1249. sudo apt-get update
  1250. sudo apt-get install build-essential libcurl4-openssl-dev
  1251. - name: Test
  1252. id: ggml-ci
  1253. run: |
  1254. LLAMA_ARG_THREADS=$(nproc) GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
  1255. ggml-ci-arm64-cpu-low-perf:
  1256. runs-on: ubuntu-22.04-arm
  1257. steps:
  1258. - name: Clone
  1259. id: checkout
  1260. uses: actions/checkout@v4
  1261. - name: ccache
  1262. uses: ggml-org/ccache-action@v1.2.16
  1263. with:
  1264. key: ggml-ci-arm64-cpu-low-perf
  1265. evict-old-files: 1d
  1266. - name: Dependencies
  1267. id: depends
  1268. run: |
  1269. sudo apt-get update
  1270. sudo apt-get install build-essential libcurl4-openssl-dev
  1271. - name: Test
  1272. id: ggml-ci
  1273. run: |
  1274. LLAMA_ARG_THREADS=$(nproc) GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
  1275. ggml-ci-x64-cpu-high-perf:
  1276. runs-on: ubuntu-22.04
  1277. steps:
  1278. - name: Clone
  1279. id: checkout
  1280. uses: actions/checkout@v4
  1281. - name: ccache
  1282. uses: ggml-org/ccache-action@v1.2.16
  1283. with:
  1284. key: ggml-ci-x64-cpu-high-perf
  1285. evict-old-files: 1d
  1286. - name: Dependencies
  1287. id: depends
  1288. run: |
  1289. sudo apt-get update
  1290. sudo apt-get install build-essential libcurl4-openssl-dev
  1291. - name: Test
  1292. id: ggml-ci
  1293. run: |
  1294. LLAMA_ARG_THREADS=$(nproc) bash ./ci/run.sh ./tmp/results ./tmp/mnt
  1295. ggml-ci-arm64-cpu-high-perf:
  1296. runs-on: ubuntu-22.04-arm
  1297. steps:
  1298. - name: Clone
  1299. id: checkout
  1300. uses: actions/checkout@v4
  1301. - name: ccache
  1302. uses: ggml-org/ccache-action@v1.2.16
  1303. with:
  1304. key: ggml-ci-arm64-cpu-high-perf
  1305. evict-old-files: 1d
  1306. - name: Dependencies
  1307. id: depends
  1308. run: |
  1309. sudo apt-get update
  1310. sudo apt-get install build-essential libcurl4-openssl-dev
  1311. - name: Test
  1312. id: ggml-ci
  1313. run: |
  1314. LLAMA_ARG_THREADS=$(nproc) GG_BUILD_NO_SVE=1 GG_BUILD_NO_BF16=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
  1315. ggml-ci-arm64-cpu-high-perf-sve:
  1316. runs-on: ubuntu-22.04-arm
  1317. steps:
  1318. - name: Clone
  1319. id: checkout
  1320. uses: actions/checkout@v4
  1321. - name: ccache
  1322. uses: ggml-org/ccache-action@v1.2.16
  1323. with:
  1324. key: ggml-ci-arm64-cpu-high-perf-sve
  1325. evict-old-files: 1d
  1326. - name: Dependencies
  1327. id: depends
  1328. run: |
  1329. sudo apt-get update
  1330. sudo apt-get install build-essential libcurl4-openssl-dev
  1331. - name: Test
  1332. id: ggml-ci
  1333. run: |
  1334. LLAMA_ARG_THREADS=$(nproc) GG_BUILD_NO_BF16=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
  1335. ggml-ci-x64-nvidia-cuda:
  1336. runs-on: [self-hosted, Linux, X64, NVIDIA]
  1337. steps:
  1338. - name: Clone
  1339. id: checkout
  1340. uses: actions/checkout@v4
  1341. - name: Test
  1342. id: ggml-ci
  1343. run: |
  1344. nvidia-smi
  1345. GG_BUILD_CUDA=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
  1346. ggml-ci-x64-nvidia-vulkan-cm:
  1347. runs-on: [self-hosted, Linux, X64, NVIDIA]
  1348. steps:
  1349. - name: Clone
  1350. id: checkout
  1351. uses: actions/checkout@v4
  1352. - name: Test
  1353. id: ggml-ci
  1354. run: |
  1355. vulkaninfo --summary
  1356. GG_BUILD_VULKAN=1 GGML_VK_DISABLE_COOPMAT2=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
  1357. ggml-ci-x64-nvidia-vulkan-cm2:
  1358. runs-on: [self-hosted, Linux, X64, NVIDIA, COOPMAT2]
  1359. steps:
  1360. - name: Clone
  1361. id: checkout
  1362. uses: actions/checkout@v4
  1363. - name: Test
  1364. id: ggml-ci
  1365. run: |
  1366. vulkaninfo --summary
  1367. GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
  1368. ggml-ci-x64-cpu-amx:
  1369. runs-on: [self-hosted, Linux, X64, CPU, AMX]
  1370. steps:
  1371. - name: Clone
  1372. id: checkout
  1373. uses: actions/checkout@v4
  1374. - name: Test
  1375. id: ggml-ci
  1376. run: |
  1377. bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
  1378. ggml-ci-x64-amd-vulkan:
  1379. runs-on: [self-hosted, Linux, X64, AMD]
  1380. steps:
  1381. - name: Clone
  1382. id: checkout
  1383. uses: actions/checkout@v4
  1384. - name: Test
  1385. id: ggml-ci
  1386. run: |
  1387. vulkaninfo --summary
  1388. GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
  1389. ggml-ci-x64-amd-rocm:
  1390. runs-on: [self-hosted, Linux, X64, AMD]
  1391. steps:
  1392. - name: Clone
  1393. id: checkout
  1394. uses: actions/checkout@v4
  1395. - name: Test
  1396. id: ggml-ci
  1397. run: |
  1398. amd-smi static
  1399. GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS="gfx1101" bash ./ci/run.sh ~/results/llama.cpp /mnt/llama.cpp
  1400. ggml-ci-mac-metal:
  1401. runs-on: [self-hosted, macOS, ARM64]
  1402. steps:
  1403. - name: Clone
  1404. id: checkout
  1405. uses: actions/checkout@v4
  1406. - name: Test
  1407. id: ggml-ci
  1408. run: |
  1409. GG_BUILD_METAL=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
  1410. ggml-ci-mac-vulkan:
  1411. runs-on: [self-hosted, macOS, ARM64]
  1412. steps:
  1413. - name: Clone
  1414. id: checkout
  1415. uses: actions/checkout@v4
  1416. - name: Test
  1417. id: ggml-ci
  1418. run: |
  1419. vulkaninfo --summary
  1420. GG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp
  1421. ggml-ci-arm64-cpu-kleidiai:
  1422. runs-on: ubuntu-22.04-arm
  1423. steps:
  1424. - name: Clone
  1425. id: checkout
  1426. uses: actions/checkout@v4
  1427. - name: ccache
  1428. uses: ggml-org/ccache-action@v1.2.16
  1429. with:
  1430. key: ggml-ci-arm64-cpu-kleidiai
  1431. evict-old-files: 1d
  1432. - name: Dependencies
  1433. id: depends
  1434. run: |
  1435. sudo apt-get update
  1436. sudo apt-get install -y build-essential libcurl4-openssl-dev
  1437. - name: Test
  1438. id: ggml-ci
  1439. run: |
  1440. GG_BUILD_KLEIDIAI=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
  1441. ggml-ci-arm64-graviton4-kleidiai:
  1442. runs-on: ah-ubuntu_22_04-c8g_8x
  1443. steps:
  1444. - name: Clone
  1445. id: checkout
  1446. uses: actions/checkout@v4
  1447. - name: Dependencies
  1448. id: depends
  1449. run: |
  1450. set -euxo pipefail
  1451. sudo apt-get update
  1452. sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
  1453. apt-get install -y \
  1454. build-essential \
  1455. libcurl4-openssl-dev \
  1456. python3-venv \
  1457. gpg \
  1458. wget \
  1459. time \
  1460. git-lfs
  1461. git lfs install
  1462. # install the latest cmake
  1463. sudo install -d /usr/share/keyrings
  1464. wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
  1465. | gpg --dearmor \
  1466. | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
  1467. echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \
  1468. | sudo tee /etc/apt/sources.list.d/kitware.list
  1469. sudo apt-get update
  1470. sudo apt-get install -y cmake
  1471. - name: ccache
  1472. uses: ggml-org/ccache-action@v1.2.16
  1473. with:
  1474. key: ggml-ci-arm64-graviton4-kleidiai
  1475. evict-old-files: 1d
  1476. - name: Test
  1477. id: ggml-ci
  1478. run: |
  1479. GG_BUILD_KLEIDIAI=1 \
  1480. GG_BUILD_EXTRA_TESTS_0=1 \
  1481. bash ./ci/run.sh ./tmp/results ./tmp/mnt