server.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Server build and tests
  2. name: Server
  3. on:
  4. workflow_dispatch: # allows manual triggering
  5. push:
  6. branches:
  7. - master
  8. - test/server-add-ci-test # FIXME remove
  9. paths: ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*']
  10. pull_request:
  11. types: [opened, synchronize, reopened]
  12. paths: ['**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*']
  13. jobs:
  14. server:
  15. runs-on: ubuntu-latest
  16. strategy:
  17. matrix:
  18. build: [noavx, avx2, avx, avx512, cublas, clblast, openblas, kompute, vulkan]
  19. sanitizer: [ADDRESS, THREAD, UNDEFINED]
  20. build_type: [Debug, Release]
  21. include:
  22. - build: 'noavx'
  23. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF'
  24. image: ubuntu:latest
  25. - build: 'avx2'
  26. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON'
  27. image: ubuntu:latest
  28. - build: 'avx'
  29. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF'
  30. image: ubuntu:latest
  31. - build: 'avx512'
  32. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON'
  33. image: ubuntu:latest
  34. experimental: true
  35. - build: 'cublas'
  36. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON'
  37. image: nvidia/cuda:12.3.1-devel-ubuntu22.04
  38. arch_not_available: true # require nvidia docker engine
  39. - build: 'clblast'
  40. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON'
  41. image: ubuntu:latest
  42. arch_not_available: true
  43. - build: 'openblas'
  44. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS'
  45. image: ubuntu:latest
  46. - build: 'kompute'
  47. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON'
  48. image: ubuntu:latest
  49. arch_not_available: true
  50. - build: 'vulkan'
  51. defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_VULKAN=ON'
  52. image: ubuntu:latest
  53. arch_not_available: true
  54. container:
  55. image: ${{ matrix.image }}
  56. ports:
  57. - 8888
  58. options: --cpus 4
  59. steps:
  60. - name: Clone
  61. id: checkout
  62. uses: actions/checkout@v3
  63. - name: Dependencies
  64. id: depends
  65. run: |
  66. apt-get update
  67. apt-get -y install \
  68. build-essential \
  69. pkg-config \
  70. git \
  71. cmake \
  72. python3-pip \
  73. wget \
  74. psmisc
  75. - name: Download CLBlast
  76. id: get_clblast
  77. if: ${{ matrix.build == 'clblast' }}
  78. run: |
  79. apt install -y libclblast-dev
  80. - name: Download OpenBLAS
  81. id: get_openblas
  82. if: ${{ matrix.build == 'openblas' }}
  83. run: |
  84. apt-get -y install libopenblas-dev
  85. - name: Install Vulkan SDK
  86. id: get_vulkan
  87. if: ${{ matrix.build == 'kompute' || matrix.build == 'vulkan' }}
  88. run: |
  89. wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc
  90. wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
  91. apt-get update
  92. apt-get -y install vulkan-sdk
  93. - name: Build
  94. id: cmake_build
  95. run: |
  96. mkdir build
  97. cd build
  98. cmake .. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.defines }}
  99. cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server
  100. - name: Tests dependencies
  101. id: test_dependencies
  102. run: |
  103. pip install -r examples/server/tests/requirements.txt
  104. - name: Download models
  105. id: download_models
  106. run: |
  107. cd examples/server/tests
  108. ../../../scripts/hf.sh --repo ggml-org/models --file tinyllamas/stories260K.gguf
  109. - name: Tests
  110. id: server_integration_test
  111. continue-on-error: ${{ matrix.experimental || matrix.arch_not_available }}
  112. run: |
  113. cd examples/server/tests
  114. PORT=8888 ./tests.sh