Convolution timings of CL are almost the same with or little slower than Neon
Output of 'strings libarm_compute.so | grep arm_compute_version': OpenCL: arm_compute_version=v18.11 Build options: {'pmu': '1', 'arch': 'arm64-v8a', 'opencl': '1', 'neon': '0', 'benchmark_tests': '1', 'validation_tests': '1', 'build': 'native', 'asserts': '0', 'mali': '1', 'debug': '0', 'os': 'linux', 'Werror': '1', 'examples': '1'}
NEON: arm_compute_version=v18.11 Build options: {'pmu': '1', 'arch': 'arm64-v8a', 'opencl': '0', 'neon': '1', 'benchmark_tests': '1', 'validation_tests': '1', 'openmp': '1', 'build': 'native', 'asserts': '0', 'debug': '0', 'os': 'linux', 'Werror': '1', 'examples': '1'}
Platform: Firefly RK3399
Operating System: Ubuntu 16.04
Problem description: I just run the benchmark tests of ComputeLibrary. I found that the convolution timings of the OpenCL test cases is almost the same with those of the Neon on my platform. I'm very confusing about this results. Take 'GEMMConvolution' case ('*/GEMMConvolutionLayer/Configuration@In=224x224x3:Weights=3x3x3x32:Biases=32:Out=112x112x32:Info=2,2;0,1,0,1:Dilation=1x1:DataType=F32:ActivationInfo=RELU') as an example: OpenCL: AVG=2.776ms, MAX=2.859ms, MIN=2.704ms, MEDIAN=2.786ms NEON: 2.779ms NEON_4: 0.875ms (using openmp with 4 threads)
I read the related issue 117. Therefore, the OpenCL cases are running 5 iterations on my platform. The commands I use are as follows: OpenCL: ./arm_compute_validation --mode=precommit --filter="^CL/." --interations=5 --instruments="MALI,WALL_CLOCK_TIMER" --log-file NEON: ./arm_compute_validation --mode=precommit --filter="^NEON/." --instruments="PMU,WALL_CLOCK_TIMER" --log-file NEON_4: ./arm_compute_validation --mode=precommit --filter="^NEON/.*" --threads=4 --instruments="PMU,WALL_CLOCK_TIMER" --log-file
This model of Firefly only has 2 big cores so you might want to only use 2 threads, and if it doesn't fix the issue you might want to use taskset or turn off the little cores to make sure only the big cores are being used.
This model of Firefly only has 2 big cores so you might want to only use 2 threads, and if it doesn't fix the issue you might want to use taskset or turn off the little cores to make sure only the big cores are being used.
Thanks to replying me. I will try this. And I also want to know how to fully utilize the GPU. Obviously, in my case, the delay of the OpenCL (based on GPU) is almost the same to NEON.
Actually, in another case, OpenCL is much slower than NEON: GEMMConvolutionLayer@In=23x27x5:Weights=3x3x5x21:Biases=21:Out=11x25x21:Info=2,1;0,0,0,0:Dilation=1x1:DataType=F32:ActivationInfo=RELU OpenCL NEON NEON with 4 threads 2.565ms 0.104 ms 0.086 ms
By the way, the OpenCL is all on GPU right?
Yes, OpenCL is all on GPU, however the execution time on the GPU is obtained by using the opencl_timer instrument.
The wall_clock_timer includes cache maintenance and dispatch time which might be why it ends up taking longer than NEON.
The other thing to consider is how big your workload is: if the sizes of the matrices are too small then the task won't be parallelisable enough to keep the whole GPU busy. (Whereas the number of threads to keep a CPU busy is much lower so it will perform better on smaller sizes).
Hope this helps