File tree 5 files changed +272
-89
lines changed
5 files changed +272
-89
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,11 @@ source /opt/intel/oneapi/setvars.sh
13
13
# for FP32
14
14
cmake .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
15
15
16
- # build example/main only
16
+ # build example/main
17
17
# cmake --build . --config Release --target main
18
18
19
+ # build example/llama-bench
20
+ # cmake --build . --config Release --target llama-bench
21
+
19
22
# build all binary
20
23
cmake --build . --config Release -v
Original file line number Diff line number Diff line change @@ -9,18 +9,28 @@ source /opt/intel/oneapi/setvars.sh
9
9
10
10
if [ $# -gt 0 ]; then
11
11
GGML_SYCL_DEVICE=$1
12
+ GGML_SYCL_SINGLE_GPU=1
12
13
else
13
14
GGML_SYCL_DEVICE=0
14
15
fi
15
- echo " use $GGML_SYCL_DEVICE as main GPU "
16
+
16
17
# export GGML_SYCL_DEBUG=1
17
18
18
19
19
20
# 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.
20
21
21
- # use all GPUs with same max compute units
22
- ZES_ENABLE_SYSMAN=1 ./build/bin/main -m models/llama-2-7b.Q4_0.gguf -p " ${INPUT2} " -n 400 -e -ngl 33 -s 0
22
+ if [ $GGML_SYCL_SINGLE_GPU -eq 1 ]; then
23
+ echo " use $GGML_SYCL_DEVICE as main GPU"
24
+ # use signle GPU only
25
+ 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
26
+ else
27
+ # use multiple GPUs with same max compute units
28
+ ZES_ENABLE_SYSMAN=1 ./build/bin/main -m models/llama-2-7b.Q4_0.gguf -p " ${INPUT2} " -n 400 -e -ngl 33 -s 0
29
+ fi
23
30
24
31
# use main GPU only
25
32
# 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
26
33
34
+ # use multiple GPUs with same max compute units
35
+ # ZES_ENABLE_SYSMAN=1 ./build/bin/main -m models/llama-2-7b.Q4_0.gguf -p "${INPUT2}" -n 400 -e -ngl 33 -s 0
36
+
You can’t perform that action at this time.
0 commit comments