mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 07:46:59 +00:00
ml/backend/ggml: set cpu n_threads
This commit is contained in:
@@ -301,6 +301,10 @@ func New(r *os.File, params ml.BackendParams) (ml.Backend, error) {
|
||||
bufts = append(bufts, bt)
|
||||
|
||||
slog.Info("compute graph", "backend", C.GoString(C.ggml_backend_name(b)), "buffer_type", C.GoString(C.ggml_backend_buft_name(bt)))
|
||||
|
||||
if C.ggml_backend_is_cpu(b) {
|
||||
C.ggml_backend_cpu_set_n_threads(b, C.int(params.NumThreads))
|
||||
}
|
||||
}
|
||||
|
||||
return &Backend{
|
||||
|
||||
Reference in New Issue
Block a user