ggml : mul_mat threads yield

ggml-ci
This commit is contained in:
Georgi Gerganov 2023-07-25 13:26:32 +03:00
parent 2076a9b3d9
commit 450a7c76de
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

6
ggml.c
View file

@ -10537,6 +10537,12 @@ static void ggml_compute_forward_mul_mat(
//printf("ir010 = %6lld, ir011 = %6lld, ir110 = %6lld, ir111 = %6lld\n", ir010, ir011, ir110, ir111); //printf("ir010 = %6lld, ir011 = %6lld, ir110 = %6lld, ir111 = %6lld\n", ir010, ir011, ir110, ir111);
// threads with no work simply yield (not sure if it helps)
if (ir010 >= ir011 || ir110 >= ir111) {
sched_yield();
return;
}
assert(ne12 % ne02 == 0); assert(ne12 % ne02 == 0);
assert(ne13 % ne03 == 0); assert(ne13 % ne03 == 0);