Team Ai
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 21d agoView on Hugging Face
0likes1.2kdownloads
server-sanitize.yml128 linesDownload Raw Back to workflows
1name: Server (sanitize)2 3on:4  workflow_dispatch: # allows manual triggering5    inputs:6      sha:7        description: 'Commit SHA1 to build'8        required: false9        type: string10      slow_tests:11        description: 'Run slow tests'12        required: true13        type: boolean14  push:15    branches:16      - master17    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: 138  LLAMA_ARG_LOG_PREFIX: 139  LLAMA_ARG_LOG_TIMESTAMPS: 140  LLAMA_ARG_LOG_VERBOSITY: 1041 42concurrency:43  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}44  cancel-in-progress: true45 46jobs:47  server:48    runs-on: hf-jobs-cpu-upgrade49 50    strategy:51      matrix:52        sanitizer: [ADDRESS, UNDEFINED] # THREAD is very slow53        build_type: [RelWithDebInfo]54      fail-fast: false55 56    steps:57      - name: Clone58        id: checkout59        uses: actions/checkout@v660        with:61          fetch-depth: 062          ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}63 64      - name: Install dependencies65        run: |66          sudo apt update67          sudo apt install -y build-essential cmake python3-full68 69      - name: ccache70        uses: ggml-org/ccache-action@v1.2.2471        with:72          restore: false73          save: false74 75      - name: ccache-buckets-restore76        uses: ./.github/actions/ccache-buckets77        with:78          key: server-sanitize-${{ matrix.sanitizer }}79          folder: llama.cpp80          hf_bucket: ggml-org/cache81 82      - name: Build83        id: cmake_build84        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-server95 96      - name: ccache-buckets-save97        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}98        uses: ./.github/actions/ccache-buckets99        env:100          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}101        with:102          key: server-sanitize-${{ matrix.sanitizer }}103          folder: llama.cpp104          evict-old-files: 1d105          hf_bucket: ggml-org/cache106          save: true107 108      - name: Install Python dependencies109        run: |110          python3 -m venv .venv111          .venv/bin/pip install -r tools/server/tests/requirements.txt112 113      - name: Tests114        id: server_integration_tests115        if: ${{ (!matrix.disabled_on_pr || !github.event.pull_request) }}116        run: |117          source .venv/bin/activate118          cd tools/server/tests119          PYTEST_WORKERS=1 ./tests.sh120 121      - name: Slow tests122        id: server_integration_tests_slow123        if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }}124        run: |125          source .venv/bin/activate126          cd tools/server/tests127          PYTEST_WORKERS=1 SLOW_TESTS=1 ./tests.sh128