build.yml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. name: CI
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. inputs:
  5. create_release:
  6. description: 'Create new release'
  7. required: true
  8. type: boolean
  9. push:
  10. branches:
  11. - master
  12. paths: ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
  13. pull_request:
  14. types: [opened, synchronize, reopened]
  15. paths: ['**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
  16. env:
  17. BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
  18. GGML_NLOOP: 3
  19. GGML_N_THREADS: 1
  20. jobs:
  21. ubuntu-focal-make:
  22. runs-on: ubuntu-20.04
  23. steps:
  24. - name: Clone
  25. id: checkout
  26. uses: actions/checkout@v3
  27. - name: Dependencies
  28. id: depends
  29. run: |
  30. sudo apt-get update
  31. sudo apt-get install build-essential gcc-8
  32. - name: Build
  33. id: make_build
  34. run: |
  35. CC=gcc-8 make -j $(nproc)
  36. - name: Test
  37. id: make_test
  38. run: |
  39. CC=gcc-8 make tests -j $(nproc)
  40. make test -j $(nproc)
  41. ubuntu-latest-cmake:
  42. runs-on: ubuntu-latest
  43. steps:
  44. - name: Clone
  45. id: checkout
  46. uses: actions/checkout@v3
  47. - name: Dependencies
  48. id: depends
  49. run: |
  50. sudo apt-get update
  51. sudo apt-get install build-essential
  52. - name: Build
  53. id: cmake_build
  54. run: |
  55. mkdir build
  56. cd build
  57. cmake ..
  58. cmake --build . --config Release -j $(nproc)
  59. - name: Test
  60. id: cmake_test
  61. run: |
  62. cd build
  63. ctest --verbose --timeout 900
  64. ubuntu-latest-cmake-sanitizer:
  65. runs-on: ubuntu-latest
  66. continue-on-error: true
  67. strategy:
  68. matrix:
  69. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  70. build_type: [Debug, Release]
  71. steps:
  72. - name: Clone
  73. id: checkout
  74. uses: actions/checkout@v3
  75. - name: Dependencies
  76. id: depends
  77. run: |
  78. sudo apt-get update
  79. sudo apt-get install build-essential
  80. - name: Build
  81. id: cmake_build
  82. run: |
  83. mkdir build
  84. cd build
  85. cmake .. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  86. cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
  87. - name: Test
  88. id: cmake_test
  89. run: |
  90. cd build
  91. ctest --verbose --timeout 900
  92. ubuntu-latest-cmake-mpi:
  93. runs-on: ubuntu-latest
  94. continue-on-error: true
  95. strategy:
  96. matrix:
  97. mpi_library: [mpich, libopenmpi-dev]
  98. steps:
  99. - name: Clone
  100. id: checkout
  101. uses: actions/checkout@v3
  102. - name: Dependencies
  103. id: depends
  104. run: |
  105. sudo apt-get update
  106. sudo apt-get install build-essential ${{ matrix.mpi_library }}
  107. - name: Build
  108. id: cmake_build
  109. run: |
  110. mkdir build
  111. cd build
  112. cmake -DLLAMA_MPI=ON ..
  113. cmake --build . --config Release -j $(nproc)
  114. - name: Test
  115. id: cmake_test
  116. run: |
  117. cd build
  118. ctest --verbose
  119. macOS-latest-make:
  120. runs-on: macos-latest
  121. steps:
  122. - name: Clone
  123. id: checkout
  124. uses: actions/checkout@v3
  125. - name: Dependencies
  126. id: depends
  127. continue-on-error: true
  128. run: |
  129. brew update
  130. - name: Build
  131. id: make_build
  132. run: |
  133. make -j $(sysctl -n hw.logicalcpu)
  134. - name: Test
  135. id: make_test
  136. run: |
  137. make tests -j $(sysctl -n hw.logicalcpu)
  138. make test -j $(sysctl -n hw.logicalcpu)
  139. macOS-latest-cmake:
  140. runs-on: macos-latest
  141. steps:
  142. - name: Clone
  143. id: checkout
  144. uses: actions/checkout@v3
  145. - name: Dependencies
  146. id: depends
  147. continue-on-error: true
  148. run: |
  149. brew update
  150. - name: Build
  151. id: cmake_build
  152. run: |
  153. sysctl -a
  154. mkdir build
  155. cd build
  156. cmake ..
  157. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  158. - name: Test
  159. id: cmake_test
  160. run: |
  161. cd build
  162. ctest --verbose --timeout 900
  163. macOS-latest-cmake-ios:
  164. runs-on: macos-latest
  165. steps:
  166. - name: Clone
  167. id: checkout
  168. uses: actions/checkout@v1
  169. - name: Dependencies
  170. id: depends
  171. continue-on-error: true
  172. run: |
  173. brew update
  174. - name: Build
  175. id: cmake_build
  176. run: |
  177. sysctl -a
  178. mkdir build
  179. cd build
  180. cmake -G Xcode .. \
  181. -DLLAMA_BUILD_EXAMPLES=OFF \
  182. -DLLAMA_BUILD_TESTS=OFF \
  183. -DLLAMA_BUILD_SERVER=OFF \
  184. -DCMAKE_SYSTEM_NAME=iOS \
  185. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
  186. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  187. macOS-latest-cmake-tvos:
  188. runs-on: macos-latest
  189. steps:
  190. - name: Clone
  191. id: checkout
  192. uses: actions/checkout@v1
  193. - name: Dependencies
  194. id: depends
  195. continue-on-error: true
  196. run: |
  197. brew update
  198. - name: Build
  199. id: cmake_build
  200. run: |
  201. sysctl -a
  202. mkdir build
  203. cd build
  204. cmake -G Xcode .. \
  205. -DLLAMA_BUILD_EXAMPLES=OFF \
  206. -DLLAMA_BUILD_TESTS=OFF \
  207. -DLLAMA_BUILD_SERVER=OFF \
  208. -DCMAKE_SYSTEM_NAME=tvOS \
  209. -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
  210. cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
  211. windows-latest-cmake:
  212. runs-on: windows-latest
  213. env:
  214. OPENBLAS_VERSION: 0.3.23
  215. OPENCL_VERSION: 2023.04.17
  216. CLBLAST_VERSION: 1.6.0
  217. strategy:
  218. matrix:
  219. include:
  220. - build: 'noavx'
  221. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DBUILD_SHARED_LIBS=ON'
  222. - build: 'avx2'
  223. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
  224. - build: 'avx'
  225. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF -DBUILD_SHARED_LIBS=ON'
  226. - build: 'avx512'
  227. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
  228. - build: 'clblast'
  229. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
  230. - build: 'openblas'
  231. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
  232. steps:
  233. - name: Clone
  234. id: checkout
  235. uses: actions/checkout@v3
  236. with:
  237. fetch-depth: 0
  238. - name: Download OpenCL SDK
  239. id: get_opencl
  240. if: ${{ matrix.build == 'clblast' }}
  241. run: |
  242. curl.exe -o $env:RUNNER_TEMP/opencl.zip -L "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v${env:OPENCL_VERSION}/OpenCL-SDK-v${env:OPENCL_VERSION}-Win-x64.zip"
  243. mkdir $env:RUNNER_TEMP/opencl
  244. tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
  245. - name: Download CLBlast
  246. id: get_clblast
  247. if: ${{ matrix.build == 'clblast' }}
  248. run: |
  249. curl.exe -o $env:RUNNER_TEMP/clblast.7z -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-windows-x64.7z"
  250. curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE"
  251. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/clblast.7z
  252. rename-item $env:RUNNER_TEMP/CLBlast-${env:CLBLAST_VERSION}-windows-x64 clblast
  253. foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
  254. $txt = Get-Content -Path $f -Raw
  255. $txt.Replace('C:/vcpkg/packages/opencl_x64-windows/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
  256. }
  257. - name: Download OpenBLAS
  258. id: get_openblas
  259. if: ${{ matrix.build == 'openblas' }}
  260. run: |
  261. 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"
  262. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  263. mkdir $env:RUNNER_TEMP/openblas
  264. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  265. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  266. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  267. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  268. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  269. - name: Build
  270. id: cmake_build
  271. run: |
  272. mkdir build
  273. cd build
  274. cmake .. ${{ matrix.defines }}
  275. cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
  276. - name: Add clblast.dll
  277. id: add_clblast_dll
  278. if: ${{ matrix.build == 'clblast' }}
  279. run: |
  280. cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release
  281. cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt
  282. - name: Add libopenblas.dll
  283. id: add_libopenblas_dll
  284. if: ${{ matrix.build == 'openblas' }}
  285. run: |
  286. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  287. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  288. - name: Check AVX512F support
  289. id: check_avx512f
  290. if: ${{ matrix.build == 'avx512' }}
  291. continue-on-error: true
  292. run: |
  293. cd build
  294. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  295. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  296. $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
  297. echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
  298. & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
  299. .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
  300. - name: Test
  301. id: cmake_test
  302. if: ${{ matrix.build != 'clblast' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible
  303. run: |
  304. cd build
  305. ctest -C Release --verbose --timeout 900
  306. - name: Determine tag name
  307. id: tag
  308. shell: bash
  309. run: |
  310. BUILD_NUMBER="$(git rev-list --count HEAD)"
  311. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  312. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  313. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  314. else
  315. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  316. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  317. fi
  318. - name: Pack artifacts
  319. id: pack_artifacts
  320. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  321. run: |
  322. Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
  323. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip .\build\bin\Release\*
  324. - name: Upload artifacts
  325. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  326. uses: actions/upload-artifact@v3
  327. with:
  328. path: |
  329. llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip
  330. windows-latest-cmake-cublas:
  331. runs-on: windows-latest
  332. strategy:
  333. matrix:
  334. cuda: ['12.2.0', '11.7.1']
  335. build: ['cublas']
  336. steps:
  337. - name: Clone
  338. id: checkout
  339. uses: actions/checkout@v3
  340. with:
  341. fetch-depth: 0
  342. - uses: Jimver/cuda-toolkit@v0.2.11
  343. id: cuda-toolkit
  344. with:
  345. cuda: ${{ matrix.cuda }}
  346. method: 'network'
  347. sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
  348. - name: Build
  349. id: cmake_build
  350. run: |
  351. mkdir build
  352. cd build
  353. cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=ON
  354. cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
  355. - name: Determine tag name
  356. id: tag
  357. shell: bash
  358. run: |
  359. BUILD_NUMBER="$(git rev-list --count HEAD)"
  360. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  361. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  362. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  363. else
  364. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  365. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  366. fi
  367. - name: Pack artifacts
  368. id: pack_artifacts
  369. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  370. run: |
  371. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
  372. - name: Upload artifacts
  373. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  374. uses: actions/upload-artifact@v3
  375. with:
  376. path: |
  377. llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
  378. - name: Copy and pack Cuda runtime
  379. run: |
  380. echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
  381. $dst='.\build\bin\cudart\'
  382. robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
  383. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip $dst\*
  384. - name: Upload Cuda runtime
  385. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  386. uses: actions/upload-artifact@v3
  387. with:
  388. path: |
  389. cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  390. # freeBSD-latest:
  391. # runs-on: macos-12
  392. # steps:
  393. # - name: Clone
  394. # uses: actions/checkout@v3
  395. #
  396. # - name: Build
  397. # uses: cross-platform-actions/action@v0.19.0
  398. # with:
  399. # operating_system: freebsd
  400. # version: '13.2'
  401. # hypervisor: 'qemu'
  402. # run: |
  403. # sudo pkg update
  404. # sudo pkg install -y gmake automake autoconf pkgconf llvm15 clinfo clover opencl clblast openblas
  405. # gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15 -j `sysctl -n hw.ncpu`
  406. release:
  407. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  408. runs-on: ubuntu-latest
  409. needs:
  410. - ubuntu-focal-make
  411. - ubuntu-latest-cmake
  412. - macOS-latest-make
  413. - macOS-latest-cmake
  414. - windows-latest-cmake
  415. - windows-latest-cmake-cublas
  416. steps:
  417. - name: Clone
  418. id: checkout
  419. uses: actions/checkout@v3
  420. with:
  421. fetch-depth: 0
  422. - name: Determine tag name
  423. id: tag
  424. shell: bash
  425. run: |
  426. BUILD_NUMBER="$(git rev-list --count HEAD)"
  427. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  428. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  429. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  430. else
  431. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  432. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  433. fi
  434. - name: Download artifacts
  435. id: download-artifact
  436. uses: actions/download-artifact@v3
  437. - name: Create release
  438. id: create_release
  439. uses: anzz1/action-create-release@v1
  440. env:
  441. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  442. with:
  443. tag_name: ${{ steps.tag.outputs.name }}
  444. - name: Upload release
  445. id: upload_release
  446. uses: actions/github-script@v3
  447. with:
  448. github-token: ${{secrets.GITHUB_TOKEN}}
  449. script: |
  450. const path = require('path');
  451. const fs = require('fs');
  452. const release_id = '${{ steps.create_release.outputs.id }}';
  453. for (let file of await fs.readdirSync('./artifact')) {
  454. if (path.extname(file) === '.zip') {
  455. console.log('uploadReleaseAsset', file);
  456. await github.repos.uploadReleaseAsset({
  457. owner: context.repo.owner,
  458. repo: context.repo.repo,
  459. release_id: release_id,
  460. name: file,
  461. data: await fs.readFileSync(`./artifact/${file}`)
  462. });
  463. }
  464. }
  465. # ubuntu-latest-gcc:
  466. # runs-on: ubuntu-latest
  467. #
  468. # strategy:
  469. # matrix:
  470. # build: [Debug, Release]
  471. #
  472. # steps:
  473. # - name: Clone
  474. # uses: actions/checkout@v3
  475. #
  476. # - name: Dependencies
  477. # run: |
  478. # sudo apt-get update
  479. # sudo apt-get install build-essential
  480. # sudo apt-get install cmake
  481. #
  482. # - name: Configure
  483. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  484. #
  485. # - name: Build
  486. # run: |
  487. # make
  488. #
  489. # ubuntu-latest-clang:
  490. # runs-on: ubuntu-latest
  491. #
  492. # strategy:
  493. # matrix:
  494. # build: [Debug, Release]
  495. #
  496. # steps:
  497. # - name: Clone
  498. # uses: actions/checkout@v3
  499. #
  500. # - name: Dependencies
  501. # run: |
  502. # sudo apt-get update
  503. # sudo apt-get install build-essential
  504. # sudo apt-get install cmake
  505. #
  506. # - name: Configure
  507. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  508. #
  509. # - name: Build
  510. # run: |
  511. # make
  512. #
  513. # ubuntu-latest-gcc-sanitized:
  514. # runs-on: ubuntu-latest
  515. #
  516. # strategy:
  517. # matrix:
  518. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  519. #
  520. # steps:
  521. # - name: Clone
  522. # uses: actions/checkout@v3
  523. #
  524. # - name: Dependencies
  525. # run: |
  526. # sudo apt-get update
  527. # sudo apt-get install build-essential
  528. # sudo apt-get install cmake
  529. #
  530. # - name: Configure
  531. # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
  532. #
  533. # - name: Build
  534. # run: |
  535. # make
  536. #
  537. # windows:
  538. # runs-on: windows-latest
  539. #
  540. # strategy:
  541. # matrix:
  542. # build: [Release]
  543. # arch: [Win32, x64]
  544. # include:
  545. # - arch: Win32
  546. # s2arc: x86
  547. # - arch: x64
  548. # s2arc: x64
  549. #
  550. # steps:
  551. # - name: Clone
  552. # uses: actions/checkout@v3
  553. #
  554. # - name: Add msbuild to PATH
  555. # uses: microsoft/setup-msbuild@v1
  556. #
  557. # - name: Configure
  558. # run: >
  559. # cmake -S . -B ./build -A ${{ matrix.arch }}
  560. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  561. #
  562. # - name: Build
  563. # run: |
  564. # cd ./build
  565. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  566. #
  567. # - name: Upload binaries
  568. # uses: actions/upload-artifact@v1
  569. # with:
  570. # name: llama-bin-${{ matrix.arch }}
  571. # path: build/bin/${{ matrix.build }}
  572. #
  573. # windows-blas:
  574. # runs-on: windows-latest
  575. #
  576. # strategy:
  577. # matrix:
  578. # build: [Release]
  579. # arch: [Win32, x64]
  580. # blas: [ON]
  581. # include:
  582. # - arch: Win32
  583. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
  584. # s2arc: x86
  585. # - arch: x64
  586. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
  587. # s2arc: x64
  588. #
  589. # steps:
  590. # - name: Clone
  591. # uses: actions/checkout@v3
  592. #
  593. # - name: Add msbuild to PATH
  594. # uses: microsoft/setup-msbuild@v1
  595. #
  596. # - name: Fetch OpenBLAS
  597. # if: matrix.blas == 'ON'
  598. # run: |
  599. # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
  600. # 7z x blas.zip -oblas -y
  601. # copy blas/include/cblas.h .
  602. # copy blas/include/openblas_config.h .
  603. # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
  604. #
  605. # - name: Configure
  606. # run: >
  607. # cmake -S . -B ./build -A ${{ matrix.arch }}
  608. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  609. # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
  610. # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
  611. #
  612. # - name: Build
  613. # run: |
  614. # cd ./build
  615. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  616. #
  617. # - name: Copy libopenblas.dll
  618. # if: matrix.blas == 'ON'
  619. # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
  620. #
  621. # - name: Upload binaries
  622. # if: matrix.blas == 'ON'
  623. # uses: actions/upload-artifact@v1
  624. # with:
  625. # name: llama-blas-bin-${{ matrix.arch }}
  626. # path: build/bin/${{ matrix.build }}
  627. #
  628. # emscripten:
  629. # runs-on: ubuntu-latest
  630. #
  631. # strategy:
  632. # matrix:
  633. # build: [Release]
  634. #
  635. # steps:
  636. # - name: Clone
  637. # uses: actions/checkout@v3
  638. #
  639. # - name: Dependencies
  640. # run: |
  641. # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  642. # tar -xvf master.tar.gz
  643. # emsdk-master/emsdk update
  644. # emsdk-master/emsdk install latest
  645. # emsdk-master/emsdk activate latest
  646. #
  647. # - name: Configure
  648. # run: echo "tmp"
  649. #
  650. # - name: Build
  651. # run: |
  652. # pushd emsdk-master
  653. # source ./emsdk_env.sh
  654. # popd
  655. # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  656. # make