build.yml 21 KB

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