CoolFace
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 5d agoView on Hugging Face
0likes1.1kdownloads
run-llama2.sh32 linesDownload Raw Back to sycl
1#!/usr/bin/env bash2 3#  MIT license4#  Copyright (C) 2024 Intel Corporation5#  SPDX-License-Identifier: MIT6export ONEAPI_DEVICE_SELECTOR="level_zero:0"7source /opt/intel/oneapi/setvars.sh8 9#export GGML_SYCL_DEBUG=110 11#ZES_ENABLE_SYSMAN=1, Support to get free memory of GPU by sycl::aspect::ext_intel_free_memory. Recommended to use when --split-mode = layer.12 13INPUT_PROMPT="Building a website can be done in 10 simple steps:\nStep 1:"14MODEL_FILE=models/llama-2-7b.Q4_0.gguf15NGL=9916CONTEXT=409617 18#support malloc device memory more than 4GB.19export UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS=120 21LOAD_MODE='--load-mode auto'22if [ $# -gt 0 ]; then23    GGML_SYCL_DEVICE=$124    echo "use $GGML_SYCL_DEVICE as main GPU"25    #use signle GPU only26    ZES_ENABLE_SYSMAN=1 ./build/bin/llama-completion -m ${MODEL_FILE} -no-cnv -p "${INPUT_PROMPT}" -n 200 -e -ngl ${NGL} -s 0 -c ${CONTEXT} -mg $GGML_SYCL_DEVICE -sm none ${LOAD_MODE}27 28else29    #use multiple GPUs with same max compute units30    ZES_ENABLE_SYSMAN=1 ./build/bin/llama-completion -m ${MODEL_FILE} -no-cnv -p "${INPUT_PROMPT}" -n 200 -e -ngl ${NGL} -s 0 -c ${CONTEXT} ${LOAD_MODE}31fi32