build.yml 21 KB

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