char-fork/llama.cpp

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

Aaron Teotests(s390x): add non-vxe build to tests (#28776)be2c6d7d1

char/aliceai-t5-moe
4.3 KiB156 linesraw
1name: CI (ibm)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-ibm.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-ibm.yml',
22      'ggml/src/ggml-cpu/**'
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-24-s390x:
38    name: ubuntu-24-s390x (VXE ${{ matrix.vxe }})
39    runs-on: ubuntu-24.04-s390x
40
41    strategy:
42      fail-fast: false
43      matrix:
44        vxe: ["ON", "OFF"]  # `-DGGML_VXE=ON/OFF`
45
46    steps:
47      - name: Clone
48        id: checkout
49        uses: actions/checkout@v6
50
51      - name: Build Dependencies
52        id: build_depends
53        run: |
54          sudo apt-get update
55          sudo apt-get install -y --no-install-recommends \
56            python3 python3-pip python3-dev python3-wheel \
57            libjpeg-dev build-essential libssl-dev \
58            git-lfs
59
60      - name: Toolchain workaround (GCC 14)
61        run: |
62          sudo apt-get install -y gcc-14 g++-14
63          echo "CC=gcc-14" >> "$GITHUB_ENV"
64          echo "CXX=g++-14" >> "$GITHUB_ENV"
65
66      - name: Python Dependencies
67        id: python_depends
68        run: |
69          export PIP_BREAK_SYSTEM_PACKAGES="1"
70          python3 -m pip install --upgrade pip setuptools
71          pip3 install ./gguf-py
72
73      - name: Swap Endianness
74        id: endianness
75        run: |
76          for f in models/*.gguf; do
77            echo YES | python3 gguf-py/gguf/scripts/gguf_convert_endian.py $f big
78          done
79
80      - name: Build
81        id: cmake_build
82        run: |
83          cmake -B build \
84            -DLLAMA_FATAL_WARNINGS=ON \
85            -DGGML_RPC=ON \
86            -DGGML_VXE=${{ matrix.vxe }}
87          time cmake --build build --config Release -j $(nproc)
88
89      - name: Test
90        id: cmake_test
91        run: |
92          cd build
93          ctest -L main --verbose --timeout 900
94
95      - name: Test llama2c (s390x)
96        id: llama2c_test_s390x
97        run: |
98          cd build
99          echo "Fetch llama2c big-endian model"
100          wget https://huggingface.co/ggml-org/models/resolve/main/tinyllamas/stories260K-be.gguf
101          ./bin/llama-completion -m stories260K-be.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
102
103  ubuntu-24-ppc64le:
104    runs-on: ubuntu-24.04-ppc64le
105
106    steps:
107      - name: Clone
108        id: checkout
109        uses: actions/checkout@v6
110
111      - name: Build Dependencies
112        id: build_depends
113        run: |
114          sudo apt-get update
115          sudo apt-get install -y --no-install-recommends \
116            python3 python3-pip python3-dev python3-wheel \
117            libjpeg-dev build-essential libssl-dev \
118            git-lfs
119
120      - name: Toolchain workaround (GCC 14)
121        run: |
122          sudo apt-get install -y gcc-14 g++-14
123          echo "CC=gcc-14" >> "$GITHUB_ENV"
124          echo "CXX=g++-14" >> "$GITHUB_ENV"
125
126      - name: Python Dependencies
127        id: python_depends
128        run: |
129          export PIP_BREAK_SYSTEM_PACKAGES="1"
130          python3 -m pip install --upgrade pip setuptools
131          pip3 install ./gguf-py
132
133      - name: Build
134        id: cmake_build
135        run: |
136          cmake -B build \
137            -DLLAMA_FATAL_WARNINGS=ON \
138            -DGGML_RPC=ON
139          time cmake --build build --config Release -j $(nproc)
140
141      - name: Test
142        id: cmake_test
143        run: |
144          cd build
145          ctest -L main --verbose --timeout 900
146
147      - name: Test llama2c conversion
148        id: llama2c_test
149        run: |
150          cd build
151          echo "Fetch tokenizer"
152          wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/tok512.bin
153          echo "Fetch llama2c model"
154          wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories260K/stories260K.bin
155          ./bin/llama-convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
156          ./bin/llama-completion -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256