char-fork/llama.cpp

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

Eveci: fix sanitizer tests (#28583)434ddbbc0

char/aliceai-t5-moe
3.1 KiB108 linesraw
1name: CI (riscv)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-riscv.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-riscv.yml',
22      'ggml/src/ggml-cpu/arch/riscv/**'
23    ]
24
25concurrency:
26  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
27  cancel-in-progress: true
28
29env:
30  GGML_NLOOP: 3
31  GGML_N_THREADS: 1
32  LLAMA_ARG_LOG_COLORS: 1
33  LLAMA_ARG_LOG_PREFIX: 1
34  LLAMA_ARG_LOG_TIMESTAMPS: 1
35
36jobs:
37  ubuntu-cpu-riscv64-native:
38    runs-on: ubuntu-24.04-riscv
39
40    steps:
41      - name: Install dependencies
42        run: |
43          # Install necessary packages
44          sudo apt-get update
45          sudo apt-get install -y libssl-dev
46
47          # Set gcc-14 and g++-14 as the default compilers
48          sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
49          sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
50
51          git lfs install
52
53      - name: Check environment
54        run: |
55          uname -a
56          gcc --version
57          g++ --version
58          ldd --version
59          cmake --version
60          rustc --version
61          env
62          echo "nproc=$(nproc)"
63
64      - name: Clone
65        id: checkout
66        uses: actions/checkout@v6
67
68      # note: sparing some ccache since these jobs run on dedicated runners that are not part of the organitzation
69      #- name: ccache
70      #  uses: ggml-org/ccache-action@v1.2.24
71      #  with:
72      #    key: riscv-ubuntu-native
73      #    evict-old-files: 1d
74      #    save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
75
76      - name: Build
77        id: cmake_build
78        run: |
79          cmake -B build \
80            -DCMAKE_BUILD_TYPE=Release \
81            -DGGML_OPENMP=OFF \
82            -DLLAMA_BUILD_EXAMPLES=ON \
83            -DLLAMA_BUILD_TOOLS=ON \
84            -DLLAMA_BUILD_TESTS=ON \
85            -DCMAKE_C_COMPILER_LAUNCHER=ccache \
86            -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
87            -DGGML_RPC=ON \
88            -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc-14 \
89            -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-14
90
91          time cmake --build build --config Release -j $(nproc)
92
93      - name: Test
94        id: cmake_test
95        run: |
96          cd build
97          ctest -L main --verbose --timeout 900
98
99      - name: Test llama2c conversion
100        id: llama2c_test
101        run: |
102          cd build
103          echo "Fetch tokenizer"
104          wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
105          echo "Fetch llama2c model"
106          wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
107          ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
108          ./bin/llama-completion -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256