char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
434ddbbc0
char/aliceai-t5-moe
1name : CI (riscv) 2 3on : 4workflow_dispatch : # allows manual triggering 5push : 6branches : 7- master 8paths : [ 9'.github/workflows/build-riscv.yml' , 10'**/CMakeLists.txt' , 11'**/.cmake' , 12'**/*.h' , 13'**/*.hpp' , 14'**/*.c' , 15'**/*.cpp' 16] 17 18pull_request : 19types : [ opened , synchronize , reopened ] 20paths : [ 21'.github/workflows/build-riscv.yml' , 22'ggml/src/ggml-cpu/arch/riscv/**' 23] 24 25concurrency : 26group : ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} 27cancel-in-progress : true 28 29env : 30GGML_NLOOP : 3 31GGML_N_THREADS : 1 32LLAMA_ARG_LOG_COLORS : 1 33LLAMA_ARG_LOG_PREFIX : 1 34LLAMA_ARG_LOG_TIMESTAMPS : 1 35 36jobs : 37ubuntu-cpu-riscv64-native : 38runs-on : ubuntu-24.04-riscv 39 40steps : 41- name : Install dependencies 42run : | 43# Install necessary packages 44sudo apt-get update 45sudo apt-get install -y libssl-dev 46 47# Set gcc-14 and g++-14 as the default compilers 48sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 49sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 50 51git lfs install 52 53- name : Check environment 54run : | 55uname -a 56gcc --version 57g++ --version 58ldd --version 59cmake --version 60rustc --version 61env 62echo "nproc=$(nproc)" 63 64- name : Clone 65id : checkout 66uses : 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 77id : cmake_build 78run : | 79cmake -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 91time cmake --build build --config Release -j $(nproc) 92 93- name : Test 94id : cmake_test 95run : | 96cd build 97ctest -L main --verbose --timeout 900 98 99- name : Test llama2c conversion 100id : llama2c_test 101run : | 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