char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
72be44f1d
char/aliceai-t5-moe
1#!/usr/bin/env bash 2# MIT license 3# Copyright (C) 2024 Intel Corporation 4# SPDX-License-Identifier: MIT 5 6print_usage () { 7echo "Usage: ./build.sh [fp32|fp16] [--help]" 8echo "" 9echo "Options:" 10echo " fp32 Build with FP32 precision (default)" 11echo " fp16 Build with FP16 precision (faster for long-prompt inference)" 12echo " --help Print this help message" 13} 14 15PRECISION =fp32 16 17for arg in " $ @" ;do 18case " $ arg " in 19 --help) 20print_usage 21exit 0 22 ;; 23 fp32| fp16) 24PRECISION =" $ arg " 25 ;; 26 *) 27echo "Error: unknown option ' $ arg '" 28print_usage 29exit 1 30 ;; 31esac 32done 33 34mkdir -p build 35cd build 36source /opt/intel/oneapi/setvars.sh 37 38if [" $ PRECISION " ="fp16" ];then 39#for FP16 40cmake ..-DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON -DLLAMA_OPENSSL=OFF # faster for long-prompt inference 41else 42#for FP32 43cmake ..-DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_OPENSSL=OFF 44fi 45 46#build example/main 47#cmake --build . --config Release --target main 48 49#build example/llama-bench 50#cmake --build . --config Release --target llama-bench 51 52#build all binary 53cmake --build .--config Release-j$((( $( nproc ) +1)/2)) -v