diff --git a/tasks/workstation/linux/software/llm.yml b/tasks/workstation/linux/software/llm.yml index 4d65e20..1fd8aea 100644 --- a/tasks/workstation/linux/software/llm.yml +++ b/tasks/workstation/linux/software/llm.yml @@ -922,11 +922,16 @@ context=',"num_ctx":'$num_ctx'' fi + # Physical CPU Count (no longer using ansible_processor_vcpus, {{ ansible_processor_vcpus }}) + # Will be something like 0-7, then get expanded to 0 1 2 3 4 5 6 7. + # Runnning with 0 causes default behavior, 1 per physical core, 8! + cores=$(cat /sys/devices/cpu_core/cpus | tr ',' '\n' | sed 's/-/ /' | xargs -L1 seq) + echo " Stopping all ollama usage..." sudo sv restart ollama >/dev/null 2>&1 # Benchmark Thread Count - for t in {1..{{ ansible_processor_vcpus | int }}}; do + for t in $cores; do start=$SECONDS echo -n "`date` - Model $model w/ $t Thread(s): " @@ -938,7 +943,7 @@ ctx="`ollama ps | grep $model | awk '{print $7}'`" time=$(( $finish - $start )) - echo ", tokens/sec: $speed @ context=$ctx, time: $time secs" + echo "tokens/sec: $speed @ context=$ctx, time: $time secs" ollama stop $model >/dev/null 2>&1 done