char-fork/llama.cpp

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

Eveci: fix sanitizer tests (#28583)434ddbbc0

char/aliceai-t5-moe
2.9 KiB106 linesraw
1name: CI (sanitize)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-sanitize.yml',
10      '**/CMakeLists.txt',
11      '**/.cmake',
12      '**/*.h',
13      '**/*.hpp',
14      '**/*.c',
15      '**/*.cpp'
16    ]
17
18  pull_request:
19    types: [opened, synchronize, reopened]
20    paths: [
21      '.github/workflows/build-sanitize.yml'
22    ]
23
24concurrency:
25  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
26  cancel-in-progress: true
27
28env:
29  GGML_NLOOP: 3
30  GGML_N_THREADS: 1
31  LLAMA_ARG_LOG_COLORS: 1
32  LLAMA_ARG_LOG_PREFIX: 1
33  LLAMA_ARG_LOG_TIMESTAMPS: 1
34
35jobs:
36  ctest:
37    continue-on-error: true
38
39    strategy:
40      matrix:
41        include:
42        # thread and address doesn't run properly on some self hosted machines, so run it on Github instead
43        - sanitizer: ADDRESS
44          machine: ubuntu-24.04
45        - sanitizer: THREAD
46          machine: ubuntu-24.04
47        - sanitizer: UNDEFINED
48          machine: [self-hosted, X64, Linux]
49
50    runs-on: ${{ matrix.machine }}
51
52    steps:
53      - name: Clone
54        id: checkout
55        uses: actions/checkout@v6
56
57      # - name: ccache
58      #   uses: ggml-org/ccache-action@v1.2.24
59      #   if: ${{ matrix.sanitizer != 'UNDEFINED' }}
60      #   with:
61      #     key: ctest-${{ matrix.sanitizer }}-ubuntu-24.04
62      #     variant: ccache
63      #     evict-old-files: 1d
64      #     save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
65
66      # with UNDEFINED sanitizer, we have to build in Debug to avoid GCC 13 false-positive warnings
67      - name: Build (undefined)
68        id: cmake_build_undefined
69        if: ${{ matrix.sanitizer == 'UNDEFINED' }}
70        run: |
71          cmake -B build \
72            -DCMAKE_BUILD_TYPE=Debug \
73            -DLLAMA_FATAL_WARNINGS=ON \
74            -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
75            -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON
76
77          cmake --build build --config Debug -j $(nproc)
78
79      - name: Build
80        id: cmake_build
81        if: ${{ matrix.sanitizer == 'ADDRESS' }}
82        run: |
83          cmake -B build \
84            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
85            -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
86            -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON
87
88          cmake --build build --config RelWithDebInfo -j $(nproc)
89
90      - name: Build (no OpenMP)
91        id: cmake_build_no_openmp
92        if: ${{ matrix.sanitizer == 'THREAD' }}
93        run: |
94          cmake -B build \
95            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
96            -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \
97            -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON \
98            -DGGML_OPENMP=OFF
99
100          cmake --build build --config RelWithDebInfo -j $(nproc)
101
102      - name: Test
103        id: cmake_test
104        run: |
105          cd build
106          ctest -L main -E tokenizer --verbose --timeout 900