-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine
executable file
·33 lines (23 loc) · 1.18 KB
/
engine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
LC0=~/lc0/lc0
WEIGHTS=~/weights/default
CACHE_SIZE=2000000
BATCH_SIZE=512
GPU_COUNT=$(nvidia-smi --query-gpu=count --format=csv,noheader)
case "$GPU_COUNT" in
1*)
exec $LC0 -t 4 --weights=$WEIGHTS --backend=cudnn-fp16 --nncache=$CACHE_SIZE --minibatch-size=$BATCH_SIZE $*
;;
2*)
exec $LC0 -t 4 --weights=$WEIGHTS --backend=multiplexing --backend-opts='(backend=cudnn-fp16,gpu=0),(backend=cudnn-fp16,gpu=1)' --nncache=$CACHE_SIZE --minibatch-size=$BATCH_SIZE $*
;;
4*)
exec $LC0 -t 8 --weights=$WEIGHTS --backend=multiplexing --backend-opts='(backend=cudnn-fp16,gpu=0),(backend=cudnn-fp16,gpu=1),(backend=cudnn-fp16,gpu=2),(backend=cudnn-fp16,gpu=3)' --nncache=$CACHE_SIZE --minibatch-size=$BATCH_SIZE $*
;;
8*)
exec $LC0 -t 16 --weights=$WEIGHTS --backend=multiplexing --backend-opts='(backend=cudnn-fp16,gpu=0),(backend=cudnn-fp16,gpu=1),(backend=cudnn-fp16,gpu=2),(backend=cudnn-fp16,gpu=3),(backend=cudnn-fp16,gpu=4),(backend=cudnn-fp16,gpu=5),(backend=cudnn-fp16,gpu=6),(backend=cudnn-fp16,gpu=7)' --nncache=$CACHE_SIZE --minibatch-size=$BATCH_SIZE $*
;;
*)
exec $LC0 --weights=$WEIGHTS --backend=eigen --nncache=$CACHE_SIZE --minibatch-size=$BATCH_SIZE $*
;;
esac