summaryrefslogtreecommitdiff
path: root/examples/gguf-split/gguf-split.cpp
diff options
context:
space:
mode:
authorIwan Kawrakow <iwan.kawrakow@gmail.com>2024-07-24 07:57:47 +0200
committerIwan Kawrakow <iwan.kawrakow@gmail.com>2024-07-24 08:04:47 +0200
commit2e49f0172f6c11b286a410039ad87433099bc1b9 (patch)
tree0c3689efb3f86fa7c660f03bde8b5b94b4527118 /examples/gguf-split/gguf-split.cpp
parentabb740c9a4b65dd6b2facc4780a1e9f2f515bd86 (diff)
ggml: thread syncronization on Arm
For x86 slaren was genereous enough to add _mm_pause() to the busy spin wait loop in ggml_barrier(), but everything else just busy spins, loading an atomic int on every iteration, thus forcing cache sync between the cores. This results in a massive drop in performance on my M2-Max laptop when using 8 threads. The closest approximation to _mm_pause() on Arm seems to be __asm__ __volatile__("isb\n"); After adding this to the busy spin loop, performance for 8 threads recovers back to expected levels.
Diffstat (limited to 'examples/gguf-split/gguf-split.cpp')
0 files changed, 0 insertions, 0 deletions