]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/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 16:45:08 +0000 (19:45 +0300)
commit08e8414f277a1a559d52dd5a474f777353ec61fc
tree4703eff335c1edc93e19267bd62be73b3138da99
parent05c61396253b6f48524878055752cf32895c7df0
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.
ggml/src/ggml.c