]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
threads: improve ggml_barrier scaling with large number of threads (llama/9598)
authorMax Krasnyansky <redacted>
Mon, 23 Sep 2024 18:42:43 +0000 (11:42 -0700)
committerGeorgi Gerganov <redacted>
Tue, 24 Sep 2024 10:04:37 +0000 (13:04 +0300)
commitd2309ecd3a853c97f2aee65319e3fd0a80f07676
treec8cd45246e72d6cb8b2c61277a599698492285d2
parent3e2f8e370ad3d2c7024d285ddde56014cf0b79ab
threads: improve ggml_barrier scaling with large number of threads (llama/9598)

Make sure n_barrier and n_barrier_passed do not share the cache line to avoid cache line bouncing.
This optimization shows performance improvements even for n_threads <= 8 cases.

Resurect TSAN (Thread Sanitizer) check so that we can avoid doing expensive read-modify-write
in the normal case and just use thread-fence as originally intended.
src/ggml.c