llm, add function for benchmarking whether more threads adds latency.
This commit is contained in:
1 parent
4fd12ce45e
commit
5620e5a223
1 file changed
+17
@@ -904,6 +904,23 @@
|
|||||||
}
|
}
|
||||||
alias ollama-sizes="ollama_sizes "
|
alias ollama-sizes="ollama_sizes "
|
||||||
alias model-sizes="ollama_sizes "
|
alias model-sizes="ollama_sizes "
|
||||||
|
|
||||||
|
function ollama_threads() {
|
||||||
|
model="$1"
|
||||||
|
if [[ -z $model ]]; then
|
||||||
|
model="qwen3.5:4b"
|
||||||
|
fi
|
||||||
|
# Benchmark Thread Count
|
||||||
|
for t in {1..{{ ansible_processor_vcpus }}}; do
|
||||||
|
echo "`date` - $t Threads`"
|
||||||
|
curl -s http://localhost:11434/api/generate \
|
||||||
|
-d '{"model":"$model","prompt":"Hello","stream":false,"options":{"num_thread":$t}}' \
|
||||||
|
| jq .eval_count / .eval_duration
|
||||||
|
done
|
||||||
|
}
|
||||||
|
alias ollama-threads="ollama_threads "
|
||||||
|
alias ollama-cpus="ollama_threads "
|
||||||
|
alias ollama-cpu="ollama_threads "
|
||||||
state: present
|
state: present
|
||||||
create: false
|
create: false
|
||||||
backup: true
|
backup: true
|
||||||
|
|||||||
Reference in new issue
Block a user