]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml-blas: set mkl threads from thread context (llama/20602)
authorKevin Hannon <redacted>
Tue, 17 Mar 2026 17:16:49 +0000 (13:16 -0400)
committerGeorgi Gerganov <redacted>
Sat, 28 Mar 2026 11:39:09 +0000 (13:39 +0200)
* ggml blas: set mkl threads from thread context

* add code to run blas locally

src/ggml-blas/ggml-blas.cpp

index 5de64b816fc8b3d2d60e8f1ba2e4f77938d26202..e7a1763b54d1a586c0f39c9025c632dae8f94e3d 100644 (file)
@@ -121,6 +121,8 @@ static void ggml_backend_blas_mul_mat(ggml_backend_blas_context * ctx, struct gg
     bli_thread_set_num_threads(ctx->n_threads);
 #elif defined(GGML_BLAS_USE_NVPL)
     nvpl_blas_set_num_threads(ctx->n_threads);
+#elif defined(GGML_BLAS_USE_MKL)
+    mkl_set_num_threads(ctx->n_threads);
 #endif
 
     for (int64_t i13 = 0; i13 < ne13; i13++) {