server: init functional tests #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Server test scenario | |
name: Server Integration Tests | |
on: | |
workflow_dispatch: # allows manual triggering | |
push: | |
branches: | |
- master | |
- test/server-add-ci-test # FIXME remove | |
paths: ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*'] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: ['**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'examples/server/**.*'] | |
jobs: | |
ubuntu-latest-cmake: | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:latest | |
ports: | |
- 8888 | |
options: --cpus 4 | |
continue-on-error: true | |
strategy: | |
matrix: | |
sanitizer: [ADDRESS, THREAD, UNDEFINED] | |
build_type: [Debug, Release] | |
build: [noavx, avx2, avx, avx512, clblast, openblas, kompute, cublas, cublas] | |
include: | |
- build: 'noavx' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF' | |
- build: 'avx2' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON' | |
- build: 'avx' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX2=OFF' | |
- build: 'avx512' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON' | |
- build: 'clblast' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON' | |
- build: 'openblas' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS' | |
- build: 'kompute' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_KOMPUTE=ON -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON' | |
- build: 'vulkan' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_VULKAN=ON' | |
- build: 'cublas' | |
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DCUDAToolkit_ROOT=/usr/local/cuda -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc' | |
steps: | |
- name: Clone | |
id: checkout | |
uses: actions/checkout@v3 | |
- name: Dependencies | |
id: depends | |
run: | | |
apt-get update | |
apt-get -y install \ | |
build-essential \ | |
git \ | |
cmake \ | |
python3-pip \ | |
wget \ | |
psmisc | |
- name: Download CLBlast | |
id: get_clblast | |
if: ${{ matrix.build == 'clblast' }} | |
run: | | |
apt install libclblast-dev | |
- name: Download OpenBLAS | |
id: get_openblas | |
if: ${{ matrix.build == 'openblas' }} | |
run: | | |
apt-get -y install libopenblas-dev | |
- name: Install Vulkan SDK | |
id: get_vulkan | |
if: ${{ matrix.build == 'kompute' || matrix.build == 'vulkan' }} | |
run: | | |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc | |
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list | |
apt-get update | |
apt-get -y install vulkan-sdk | |
- name: Install CUDA | |
id: get_cuda | |
if: ${{ matrix.build == 'cublas' }} | |
run: | | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb | |
dpkg -i cuda-keyring_1.1-1_all.deb | |
apt-get update | |
apt-get -y install cuda-toolkit | |
- name: Build | |
id: cmake_build | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.defines }} | |
cmake --build . --config ${{ matrix.build_type }} -j $(nproc) --target server | |
- name: Tests dependencies | |
id: test_dependencies | |
run: | | |
pip install -r examples/server/tests/requirements.txt | |
- name: Download test model | |
id: download_model | |
run: | | |
cd examples/server/tests | |
../../../scripts/hf.sh --repo ggml-org/models --file tinyllamas/stories260K.gguf | |
- name: Server Integration Tests | |
id: server_integration_test | |
run: | | |
cd examples/server/tests | |
PORT=8888 ./tests.sh |