Spaces:
Sleeping
Sleeping
Diego Devesa
commited on
Commit
·
276d920
1
Parent(s):
b154325
ggml-cpu : set openmp wait time if not set (llama/13758)
Browse files- ggml/src/ggml-cpu/ggml-cpu.c +13 -0
ggml/src/ggml-cpu/ggml-cpu.c
CHANGED
|
@@ -3484,6 +3484,19 @@ void ggml_cpu_init(void) {
|
|
| 3484 |
const uint64_t t_end = ggml_time_us(); UNUSED(t_end);
|
| 3485 |
|
| 3486 |
GGML_PRINT_DEBUG("%s: GELU, Quick GELU, SILU and EXP tables initialized in %f ms\n", __func__, (t_end - t_start)/1000.0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3487 |
}
|
| 3488 |
|
| 3489 |
#if defined(__ARM_ARCH)
|
|
|
|
| 3484 |
const uint64_t t_end = ggml_time_us(); UNUSED(t_end);
|
| 3485 |
|
| 3486 |
GGML_PRINT_DEBUG("%s: GELU, Quick GELU, SILU and EXP tables initialized in %f ms\n", __func__, (t_end - t_start)/1000.0);
|
| 3487 |
+
|
| 3488 |
+
#ifdef GGML_USE_OPENMP
|
| 3489 |
+
//if (!getenv("OMP_WAIT_POLICY")) {
|
| 3490 |
+
// // set the wait policy to active, so that OpenMP threads don't sleep
|
| 3491 |
+
// putenv("OMP_WAIT_POLICY=active");
|
| 3492 |
+
//}
|
| 3493 |
+
|
| 3494 |
+
if (!getenv("KMP_BLOCKTIME")) {
|
| 3495 |
+
// set the time to wait before sleeping a thread
|
| 3496 |
+
// this is less aggressive than setting the wait policy to active, but should achieve similar results in most cases
|
| 3497 |
+
putenv("KMP_BLOCKTIME=200"); // 200ms
|
| 3498 |
+
}
|
| 3499 |
+
#endif
|
| 3500 |
}
|
| 3501 |
|
| 3502 |
#if defined(__ARM_ARCH)
|