char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Sigbjørn Skjæretci : remove leftover command (#28839)37b3a9e0c

char/aliceai-t5-moe
3.8 KiB127 linesraw
1name: Server (sanitize)
2
3on:
4  workflow_dispatch: # allows manual triggering
5    inputs:
6      sha:
7        description: 'Commit SHA1 to build'
8        required: false
9        type: string
10      slow_tests:
11        description: 'Run slow tests'
12        required: true
13        type: boolean
14  push:
15    branches:
16      - master
17    paths: [
18      '.github/workflows/server-sanitize.yml',
19      '**/CMakeLists.txt',
20      '**/Makefile',
21      '**/*.h',
22      '**/*.hpp',
23      '**/*.c',
24      '**/*.cpp',
25      'tools/server/**.*'
26    ]
27
28  pull_request:
29    types: [opened, synchronize, reopened]
30    paths: [
31      '.github/workflows/server-sanitize.yml'
32    ]
33
34env:
35  # note: this is dud token to avoid rate limiting (https://github.com/ggml-org/llama.cpp/pull/25706#issuecomment-4979941302)
36  HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
37  LLAMA_ARG_LOG_COLORS: 1
38  LLAMA_ARG_LOG_PREFIX: 1
39  LLAMA_ARG_LOG_TIMESTAMPS: 1
40  LLAMA_ARG_LOG_VERBOSITY: 10
41
42concurrency:
43  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
44  cancel-in-progress: true
45
46jobs:
47  server:
48    runs-on: hf-jobs-cpu-upgrade
49
50    strategy:
51      matrix:
52        sanitizer: [ADDRESS, UNDEFINED] # THREAD is very slow
53        build_type: [RelWithDebInfo]
54      fail-fast: false
55
56    steps:
57      - name: Clone
58        id: checkout
59        uses: actions/checkout@v6
60        with:
61          fetch-depth: 0
62          ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
63
64      - name: Install dependencies
65        run: |
66          sudo apt update
67          sudo apt install -y build-essential cmake python3-full
68
69      - name: ccache
70        uses: ggml-org/ccache-action@v1.2.24
71        with:
72          restore: false
73          save: false
74
75      - name: ccache-buckets-restore
76        uses: ./.github/actions/ccache-buckets
77        with:
78          key: server-sanitize-${{ matrix.sanitizer }}
79          folder: llama.cpp
80          hf_bucket: ggml-org/cache
81
82      - name: Build
83        id: cmake_build
84        run: |
85          cmake -B build \
86            -DLLAMA_BUILD_BORINGSSL=ON \
87            -DGGML_SCHED_NO_REALLOC=ON \
88            -DGGML_SANITIZE_ADDRESS=${{ matrix.sanitizer == 'ADDRESS' }} \
89            -DGGML_SANITIZE_THREAD=${{ matrix.sanitizer == 'THREAD' }} \
90            -DGGML_SANITIZE_UNDEFINED=${{ matrix.sanitizer == 'UNDEFINED' }} \
91            -DLLAMA_SANITIZE_ADDRESS=${{ matrix.sanitizer == 'ADDRESS' }} \
92            -DLLAMA_SANITIZE_THREAD=${{ matrix.sanitizer == 'THREAD' }} \
93            -DLLAMA_SANITIZE_UNDEFINED=${{ matrix.sanitizer == 'UNDEFINED' }}
94          cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server
95
96      - name: ccache-buckets-save
97        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
98        uses: ./.github/actions/ccache-buckets
99        env:
100          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
101        with:
102          key: server-sanitize-${{ matrix.sanitizer }}
103          folder: llama.cpp
104          evict-old-files: 1d
105          hf_bucket: ggml-org/cache
106          save: true
107
108      - name: Install Python dependencies
109        run: |
110          python3 -m venv .venv
111          .venv/bin/pip install -r tools/server/tests/requirements.txt
112
113      - name: Tests
114        id: server_integration_tests
115        if: ${{ (!matrix.disabled_on_pr || !github.event.pull_request) }}
116        run: |
117          source .venv/bin/activate
118          cd tools/server/tests
119          PYTEST_WORKERS=1 ./tests.sh
120
121      - name: Slow tests
122        id: server_integration_tests_slow
123        if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }}
124        run: |
125          source .venv/bin/activate
126          cd tools/server/tests
127          PYTEST_WORKERS=1 SLOW_TESTS=1 ./tests.sh