build.yml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  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@v1
  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
  36. - name: Test
  37. id: make_test
  38. run: |
  39. CC=gcc-8 make tests
  40. make test
  41. ubuntu-latest-cmake:
  42. runs-on: ubuntu-latest
  43. steps:
  44. - name: Clone
  45. id: checkout
  46. uses: actions/checkout@v1
  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
  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@v1
  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 }}
  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@v1
  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
  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@v1
  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
  134. - name: Test
  135. id: make_test
  136. run: |
  137. make tests
  138. make test
  139. macOS-latest-cmake:
  140. runs-on: macos-latest
  141. steps:
  142. - name: Clone
  143. id: checkout
  144. uses: actions/checkout@v1
  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 -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF ..
  157. cmake --build . --config Release
  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
  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
  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_BUILD_SERVER=ON -DLLAMA_AVX=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF'
  222. - build: 'avx2'
  223. defines: '-DLLAMA_BUILD_SERVER=ON'
  224. - build: 'avx'
  225. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF'
  226. - build: 'avx512'
  227. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
  228. - build: 'clblast'
  229. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
  230. - build: 'openblas'
  231. defines: '-DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=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@v1
  236. - name: Download OpenCL SDK
  237. id: get_opencl
  238. if: ${{ matrix.build == 'clblast' }}
  239. run: |
  240. 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"
  241. mkdir $env:RUNNER_TEMP/opencl
  242. tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
  243. - name: Download CLBlast
  244. id: get_clblast
  245. if: ${{ matrix.build == 'clblast' }}
  246. run: |
  247. 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"
  248. curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE"
  249. 7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/clblast.7z
  250. rename-item $env:RUNNER_TEMP/CLBlast-${env:CLBLAST_VERSION}-windows-x64 clblast
  251. foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
  252. $txt = Get-Content -Path $f -Raw
  253. $txt.Replace('C:/vcpkg/packages/opencl_x64-windows/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
  254. }
  255. - name: Download OpenBLAS
  256. id: get_openblas
  257. if: ${{ matrix.build == 'openblas' }}
  258. run: |
  259. 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"
  260. curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE"
  261. mkdir $env:RUNNER_TEMP/openblas
  262. tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas
  263. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  264. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  265. $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe')
  266. & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll
  267. - name: Build
  268. id: cmake_build
  269. run: |
  270. mkdir build
  271. cd build
  272. cmake .. ${{ matrix.defines }}
  273. cmake --build . --config Release
  274. - name: Add clblast.dll
  275. id: add_clblast_dll
  276. if: ${{ matrix.build == 'clblast' }}
  277. run: |
  278. cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release
  279. cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt
  280. - name: Add libopenblas.dll
  281. id: add_libopenblas_dll
  282. if: ${{ matrix.build == 'openblas' }}
  283. run: |
  284. cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll
  285. cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt
  286. - name: Check AVX512F support
  287. id: check_avx512f
  288. if: ${{ matrix.build == 'avx512' }}
  289. continue-on-error: true
  290. run: |
  291. cd build
  292. $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
  293. $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
  294. $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
  295. echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
  296. & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
  297. .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
  298. - name: Test
  299. id: cmake_test
  300. if: ${{ matrix.build != 'clblast' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible
  301. run: |
  302. cd build
  303. ctest -C Release --verbose --timeout 900
  304. - name: Determine tag name
  305. id: tag
  306. shell: bash
  307. run: |
  308. BUILD_NUMBER="$(git rev-list --count HEAD)"
  309. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  310. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  311. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  312. else
  313. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  314. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  315. fi
  316. - name: Pack artifacts
  317. id: pack_artifacts
  318. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  319. run: |
  320. Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
  321. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip .\build\bin\Release\*
  322. - name: Upload artifacts
  323. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  324. uses: actions/upload-artifact@v3
  325. with:
  326. path: |
  327. llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip
  328. windows-latest-cmake-cublas:
  329. runs-on: windows-latest
  330. strategy:
  331. matrix:
  332. cuda: ['12.1.0', '11.7.1']
  333. build: ['cublas']
  334. steps:
  335. - name: Clone
  336. id: checkout
  337. uses: actions/checkout@v1
  338. - uses: Jimver/cuda-toolkit@v0.2.10
  339. id: cuda-toolkit
  340. with:
  341. cuda: ${{ matrix.cuda }}
  342. # TODO(green-sky): _dev seems to fail, and non dev are not enought
  343. #sub-packages: '["nvcc", "cudart", "cublas", "cudart_dev", "cublas_dev"]'
  344. - name: Build
  345. id: cmake_build
  346. run: |
  347. mkdir build
  348. cd build
  349. cmake .. -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON
  350. cmake --build . --config Release
  351. - name: Determine tag name
  352. id: tag
  353. shell: bash
  354. run: |
  355. BUILD_NUMBER="$(git rev-list --count HEAD)"
  356. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  357. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  358. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  359. else
  360. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  361. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  362. fi
  363. - name: Pack artifacts
  364. id: pack_artifacts
  365. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  366. run: |
  367. 7z a llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip .\build\bin\Release\*
  368. - name: Upload artifacts
  369. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  370. uses: actions/upload-artifact@v3
  371. with:
  372. path: |
  373. llama-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-cu${{ matrix.cuda }}-x64.zip
  374. - name: Copy and pack Cuda runtime
  375. if: ${{ matrix.cuda == '12.1.0' }}
  376. # TODO(green-sky): paths are cuda 12 specific
  377. run: |
  378. echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
  379. mkdir '.\build\bin\cudart\'
  380. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cudart64_12.dll" '.\build\bin\cudart\'
  381. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublas64_12.dll" '.\build\bin\cudart\'
  382. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublasLt64_12.dll" '.\build\bin\cudart\'
  383. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip .\build\bin\cudart\*
  384. - name: Copy and pack Cuda runtime
  385. if: ${{ matrix.cuda == '11.7.1' }}
  386. # TODO(green-sky): paths are cuda 11 specific
  387. run: |
  388. echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
  389. mkdir '.\build\bin\cudart\'
  390. ls "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin"
  391. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cudart64_110.dll" '.\build\bin\cudart\'
  392. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublas64_11.dll" '.\build\bin\cudart\'
  393. cp "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin\cublasLt64_11.dll" '.\build\bin\cudart\'
  394. 7z a cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip .\build\bin\cudart\*
  395. - name: Upload Cuda runtime
  396. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  397. uses: actions/upload-artifact@v3
  398. with:
  399. path: |
  400. cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
  401. release:
  402. if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
  403. runs-on: ubuntu-latest
  404. needs:
  405. - ubuntu-focal-make
  406. - ubuntu-latest-cmake
  407. - macOS-latest-make
  408. - macOS-latest-cmake
  409. - windows-latest-cmake
  410. - windows-latest-cmake-cublas
  411. steps:
  412. - name: Clone
  413. id: checkout
  414. uses: actions/checkout@v1
  415. - name: Determine tag name
  416. id: tag
  417. shell: bash
  418. run: |
  419. BUILD_NUMBER="$(git rev-list --count HEAD)"
  420. SHORT_HASH="$(git rev-parse --short=7 HEAD)"
  421. if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
  422. echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
  423. else
  424. SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
  425. echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
  426. fi
  427. - name: Download artifacts
  428. id: download-artifact
  429. uses: actions/download-artifact@v3
  430. - name: Create release
  431. id: create_release
  432. uses: anzz1/action-create-release@v1
  433. env:
  434. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  435. with:
  436. tag_name: ${{ steps.tag.outputs.name }}
  437. - name: Upload release
  438. id: upload_release
  439. uses: actions/github-script@v3
  440. with:
  441. github-token: ${{secrets.GITHUB_TOKEN}}
  442. script: |
  443. const path = require('path');
  444. const fs = require('fs');
  445. const release_id = '${{ steps.create_release.outputs.id }}';
  446. for (let file of await fs.readdirSync('./artifact')) {
  447. if (path.extname(file) === '.zip') {
  448. console.log('uploadReleaseAsset', file);
  449. await github.repos.uploadReleaseAsset({
  450. owner: context.repo.owner,
  451. repo: context.repo.repo,
  452. release_id: release_id,
  453. name: file,
  454. data: await fs.readFileSync(`./artifact/${file}`)
  455. });
  456. }
  457. }
  458. # ubuntu-latest-gcc:
  459. # runs-on: ubuntu-latest
  460. #
  461. # strategy:
  462. # matrix:
  463. # build: [Debug, Release]
  464. #
  465. # steps:
  466. # - name: Clone
  467. # uses: actions/checkout@v1
  468. #
  469. # - name: Dependencies
  470. # run: |
  471. # sudo apt-get update
  472. # sudo apt-get install build-essential
  473. # sudo apt-get install cmake
  474. #
  475. # - name: Configure
  476. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  477. #
  478. # - name: Build
  479. # run: |
  480. # make
  481. #
  482. # ubuntu-latest-clang:
  483. # runs-on: ubuntu-latest
  484. #
  485. # strategy:
  486. # matrix:
  487. # build: [Debug, Release]
  488. #
  489. # steps:
  490. # - name: Clone
  491. # uses: actions/checkout@v1
  492. #
  493. # - name: Dependencies
  494. # run: |
  495. # sudo apt-get update
  496. # sudo apt-get install build-essential
  497. # sudo apt-get install cmake
  498. #
  499. # - name: Configure
  500. # run: cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  501. #
  502. # - name: Build
  503. # run: |
  504. # make
  505. #
  506. # ubuntu-latest-gcc-sanitized:
  507. # runs-on: ubuntu-latest
  508. #
  509. # strategy:
  510. # matrix:
  511. # sanitizer: [ADDRESS, THREAD, UNDEFINED]
  512. #
  513. # steps:
  514. # - name: Clone
  515. # uses: actions/checkout@v1
  516. #
  517. # - name: Dependencies
  518. # run: |
  519. # sudo apt-get update
  520. # sudo apt-get install build-essential
  521. # sudo apt-get install cmake
  522. #
  523. # - name: Configure
  524. # run: cmake . -DCMAKE_BUILD_TYPE=Debug -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON
  525. #
  526. # - name: Build
  527. # run: |
  528. # make
  529. #
  530. # windows:
  531. # runs-on: windows-latest
  532. #
  533. # strategy:
  534. # matrix:
  535. # build: [Release]
  536. # arch: [Win32, x64]
  537. # include:
  538. # - arch: Win32
  539. # s2arc: x86
  540. # - arch: x64
  541. # s2arc: x64
  542. #
  543. # steps:
  544. # - name: Clone
  545. # uses: actions/checkout@v1
  546. #
  547. # - name: Add msbuild to PATH
  548. # uses: microsoft/setup-msbuild@v1
  549. #
  550. # - name: Configure
  551. # run: >
  552. # cmake -S . -B ./build -A ${{ matrix.arch }}
  553. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  554. #
  555. # - name: Build
  556. # run: |
  557. # cd ./build
  558. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  559. #
  560. # - name: Upload binaries
  561. # uses: actions/upload-artifact@v1
  562. # with:
  563. # name: llama-bin-${{ matrix.arch }}
  564. # path: build/bin/${{ matrix.build }}
  565. #
  566. # windows-blas:
  567. # runs-on: windows-latest
  568. #
  569. # strategy:
  570. # matrix:
  571. # build: [Release]
  572. # arch: [Win32, x64]
  573. # blas: [ON]
  574. # include:
  575. # - arch: Win32
  576. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x86.zip
  577. # s2arc: x86
  578. # - arch: x64
  579. # obzip: https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip
  580. # s2arc: x64
  581. #
  582. # steps:
  583. # - name: Clone
  584. # uses: actions/checkout@v1
  585. #
  586. # - name: Add msbuild to PATH
  587. # uses: microsoft/setup-msbuild@v1
  588. #
  589. # - name: Fetch OpenBLAS
  590. # if: matrix.blas == 'ON'
  591. # run: |
  592. # C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }}
  593. # 7z x blas.zip -oblas -y
  594. # copy blas/include/cblas.h .
  595. # copy blas/include/openblas_config.h .
  596. # echo "blasdir=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV
  597. #
  598. # - name: Configure
  599. # run: >
  600. # cmake -S . -B ./build -A ${{ matrix.arch }}
  601. # -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  602. # -DLLAMA_SUPPORT_OPENBLAS=${{ matrix.blas }}
  603. # -DCMAKE_LIBRARY_PATH="$env:blasdir/lib"
  604. #
  605. # - name: Build
  606. # run: |
  607. # cd ./build
  608. # msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
  609. #
  610. # - name: Copy libopenblas.dll
  611. # if: matrix.blas == 'ON'
  612. # run: copy "$env:blasdir/bin/libopenblas.dll" build/bin/${{ matrix.build }}
  613. #
  614. # - name: Upload binaries
  615. # if: matrix.blas == 'ON'
  616. # uses: actions/upload-artifact@v1
  617. # with:
  618. # name: llama-blas-bin-${{ matrix.arch }}
  619. # path: build/bin/${{ matrix.build }}
  620. #
  621. # emscripten:
  622. # runs-on: ubuntu-latest
  623. #
  624. # strategy:
  625. # matrix:
  626. # build: [Release]
  627. #
  628. # steps:
  629. # - name: Clone
  630. # uses: actions/checkout@v1
  631. #
  632. # - name: Dependencies
  633. # run: |
  634. # wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
  635. # tar -xvf master.tar.gz
  636. # emsdk-master/emsdk update
  637. # emsdk-master/emsdk install latest
  638. # emsdk-master/emsdk activate latest
  639. #
  640. # - name: Configure
  641. # run: echo "tmp"
  642. #
  643. # - name: Build
  644. # run: |
  645. # pushd emsdk-master
  646. # source ./emsdk_env.sh
  647. # popd
  648. # emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
  649. # make