Commit bf920883 authored by Michael Yang's avatar Michael Yang
Browse files

ml/backend/ggml: set cpu n_threads

parent 58b9ec1f
......@@ -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{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment