You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the OpenMP-enabled code called from gemm_cpu(), the inner loops' iteration variables are declared before the #pragma omp parallel for directives. This makes snek sad.
The OpenMP specification says that the outermost loop's iteration variable (in this case int i) is implicitly private, but otherwise any previously declared variables (in this case j and k) are shared. As j and k are actually used as loop iteration variables inside the parallel region, making them shared causes the threads to piss all over each other's shit (I believe that's the technical term used in the OpenMP spec).
The fix is to add a private(i,j,k) clause to the directives. Going to do a pull request shortly.
Crash:
$ ./darknet nightmare cfg/jnet-conv.cfg jnet-conv.weights data/scream.jpg 16 -iters 1 -rounds 30
policy: Using default 'constant'
max_batches: Using default '0'
layer filters size input output
0 conv 32 3 x 3 / 1 10 x 10 x 3 -> 10 x 10 x 32
1 conv 32 3 x 3 / 1 10 x 10 x 32 -> 10 x 10 x 32
2 max 2 x 2 / 2 10 x 10 x 32 -> 5 x 5 x 32
3 conv 64 3 x 3 / 1 5 x 5 x 32 -> 5 x 5 x 64
4 conv 64 3 x 3 / 1 5 x 5 x 64 -> 5 x 5 x 64
5 max 2 x 2 / 2 5 x 5 x 64 -> 3 x 3 x 64
6 conv 128 3 x 3 / 1 3 x 3 x 64 -> 3 x 3 x 128
7 conv 128 3 x 3 / 1 3 x 3 x 128 -> 3 x 3 x 128
8 max 2 x 2 / 2 3 x 3 x 128 -> 2 x 2 x 128
9 conv 256 3 x 3 / 1 2 x 2 x 128 -> 2 x 2 x 256
10 conv 256 3 x 3 / 1 2 x 2 x 256 -> 2 x 2 x 256
11 max 2 x 2 / 2 2 x 2 x 256 -> 1 x 1 x 256
12 conv 512 3 x 3 / 1 1 x 1 x 256 -> 1 x 1 x 512
13 conv 512 3 x 3 / 1 1 x 1 x 512 -> 1 x 1 x 512
14 max 2 x 2 / 2 1 x 1 x 512 -> 1 x 1 x 512
15 conv 1024 3 x 3 / 1 1 x 1 x 512 -> 1 x 1 x1024
16 conv 1024 3 x 3 / 1 1 x 1 x1024 -> 1 x 1 x1024
17 max 2 x 2 / 2 1 x 1 x1024 -> 1 x 1 x1024
Loading weights from jnet-conv.weights...Done!
Iteration: 0, done
0 scream_jnet-conv_16_000000
Iteration: 0, Segmentation fault (core dumped)
In the OpenMP-enabled code called from
gemm_cpu()
, the inner loops' iteration variables are declared before the#pragma omp parallel for
directives. This makes snek sad.The OpenMP specification says that the outermost loop's iteration variable (in this case
int i
) is implicitly private, but otherwise any previously declared variables (in this casej
andk
) are shared. Asj
andk
are actually used as loop iteration variables inside the parallel region, making them shared causes the threads to piss all over each other's shit (I believe that's the technical term used in the OpenMP spec).The fix is to add a
private(i,j,k)
clause to the directives. Going to do a pull request shortly.Crash:
GDB backtrace:
The text was updated successfully, but these errors were encountered: