build.yml 21 KB

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