Skip to content

Commit 9f8dbc4

Browse files
authored
use pause asm insn in busyloop to run the CPU (13600K) 10 °C cooler (#1314)
* use pause asm insn in busyloop to run the CPU (13600K) 10 °C cooler Tested with a 13B model. * use _mm_pause() in busyloop * use _mm_pause() in busyloop on x86_64 to reduce power consumption
1 parent 41654ef commit 9f8dbc4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ggml.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11663,7 +11663,11 @@ typedef int ggml_lock_t;
1166311663

1166411664
#define ggml_lock_init(x) UNUSED(x)
1166511665
#define ggml_lock_destroy(x) UNUSED(x)
11666+
#if defined(__x86_64__) || (defined(_MSC_VER) && defined(_M_AMD64))
11667+
#define ggml_lock_lock(x) _mm_pause()
11668+
#else
1166611669
#define ggml_lock_lock(x) UNUSED(x)
11670+
#endif
1166711671
#define ggml_lock_unlock(x) UNUSED(x)
1166811672

1166911673
#define GGML_LOCK_INITIALIZER 0

0 commit comments

Comments
 (0)