- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been having an issue where scipy's svd hangs in mkl. My investigation seems to suggest its an issue where mkl is assuming it has 4 workers and is stuck waiting for them when it only has 1, due to me setting OMP_DYNAMIC=TRUE and omp reducing the number of workers when the machine is busy.
Repro which was using the python `mkl-devel==2026.1.0` package:
#define _GNU_SOURCE
#include <mkl.h>
#include <omp.h>
#include <sched.h>
#include <stdio.h>
static double a[3000 * 128];
static double tau[128]
int main(void) {
cpu_set_t cpus;
/*
We pin to one CPU to simulate OMP's behaviour when the load average on the machine is high.
In dynamic mode this causes it to lower the maximum threading.
*/
CPU_ZERO(&cpus);
CPU_SET(sched_getcpu(), &cpus);
if (sched_setaffinity(0, sizeof(cpus), &cpus) != 0) {
perror("sched_setaffinity");
return 1;
}
omp_set_dynamic(1);
mkl_set_dynamic(0);
mkl_set_num_threads_local(4);
puts("starting DGEQRF");
fflush(stdout);
return LAPACKE_dgeqrf(LAPACK_COL_MAJOR, 3000, 128, a, 3000, tau)
}Let me know if any more information would be useful
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page