run-llama2.sh 803 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # MIT license
  3. # Copyright (C) 2024 Intel Corporation
  4. # SPDX-License-Identifier: MIT
  5. INPUT2="Building a website can be done in 10 simple steps:\nStep 1:"
  6. source /opt/intel/oneapi/setvars.sh
  7. if [ $# -gt 0 ]; then
  8. GGML_SYCL_DEVICE=$1
  9. else
  10. GGML_SYCL_DEVICE=0
  11. fi
  12. echo "use $GGML_SYCL_DEVICE as main GPU"
  13. #export GGML_SYCL_DEBUG=1
  14. #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.
  15. #use all GPUs with same max compute units
  16. ZES_ENABLE_SYSMAN=1 ./build/bin/main -m models/llama-2-7b.Q4_0.gguf -p "${INPUT2}" -n 400 -e -ngl 33 -s 0
  17. #use main GPU only
  18. #ZES_ENABLE_SYSMAN=1 ./build/bin/main -m models/llama-2-7b.Q4_0.gguf -p "${INPUT2}" -n 400 -e -ngl 33 -s 0 -mg $GGML_SYCL_DEVICE -sm none