armnn icon indicating copy to clipboard operation
armnn copied to clipboard

ArmNN v22.02 UnitTests failure with Mali-G31 and OpenCL

Open GW-Renesas opened this issue 2 years ago • 7 comments

Hi All,

I'm running UnitTests on a platform with duel Cortex-A55 CPUs and a Mali-G31. Neon and OpenCL are enabled. The build is also being completed from a Yocto environment.

I see the attached output with the CreateWorkloadNeon test suite errors: neon_unit_errors.txt

Has this been seen before at all?

Thanks, Gareth

GW-Renesas avatar Sep 12 '22 11:09 GW-Renesas

Hey @GW-Renesas

Could you please give me the full list of build parameters used? I will try to recreate.

Thanks, Keith

keidav01 avatar Sep 19 '22 15:09 keidav01

Hi @keidav01,

I've attached the parameter list for ArmNN and ACL. Please let me know if there's anything else I can provide.

buildParametersArmNN.txt

Thanks, Gareth

GW-Renesas avatar Sep 21 '22 08:09 GW-Renesas

Hey @GW-Renesas, thank you for feeding back. Could I also ask why you are specifying this as an option to UnitTests? -- --dynamic-backend-build-dir "/usr/bin/armnn/examples/UnitTests/"

Have you tried running without this? You do not appear to building with dynamic backends.

keidav01 avatar Sep 21 '22 11:09 keidav01

Hi @keidav01,

Removing the dynamic-backend-build-dir option when running unit tests still shows the same issue unfortunately. I have retested locally to be sure.

GW-Renesas avatar Sep 21 '22 13:09 GW-Renesas

Hi @GW-Renesas

Would you please let us know what target arch you are building for?

FP16 is enabled when building for armv8.2a. If you build for v8a there is not FP16.

morgolock avatar Oct 05 '22 10:10 morgolock

Hi @GW-Renesas

I have not managed to reproduce this with a new build from main. I built ACL both for v8a and v8.2a and the test passes.

Can you please try 22.08 or building from main?

root@odroid:~/pabtel01/armnn# LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./UnitTests -test-case=CreateActivationFloat16Workload
[doctest] doctest version is "2.4.6"
[doctest] run with "--help" for options
Can't load libOpenCL.so: libOpenCL.so: cannot open shared object file: No such file or directory
Can't load libGLES_mali.so: libGLES_mali.so: cannot open shared object file: No such file or directory
 [ComputeLibrary][06-10-2022 02:39:52][INFO]  arm_compute::opencl::ClActivation::configure() : 
 src: Shape=1,1,DataLayout=NCHW,DataType=F16
 dst: Shape=1,1,DataLayout=NCHW,DataType=F16
 act_info: RELU
 
===============================================================================
[doctest] test cases: 1 | 1 passed | 0 failed | 4971 skipped
[doctest] assertions: 9 | 9 passed | 0 failed |
[doctest] Status: SUCCESS!

morgolock avatar Oct 06 '22 14:10 morgolock

Hi @morgolock,

Thanks for testing on your side. The target arch I'm using is armv8.2a. I will move to v22.08 in my builds, retest and update the ticket with my results.

GW-Renesas avatar Oct 06 '22 15:10 GW-Renesas

Hi @morgolock,

I get the same errors on v22.08 unfortunately. I've included log output for reference, ran with and without the backend parameter.

2208-armnn.log

GW-Renesas avatar Oct 21 '22 08:10 GW-Renesas

Hi @GW-Renesas

I've noticed your ACL build is arch=arm64-v8a, would you please try building for arch=armv8.2-a ?

You then rebuild ArmNN and rerun the tests.

Hope this helps.

morgolock avatar Nov 25 '22 13:11 morgolock

The unit tests for Neon FP16 are only included if the preprocessor defines __ARM_FEATURE_FP16_VECTOR_ARITHMETIC when compiling Arm NN, which will only happen when Arm NN itself is compiled for a base architecture with fp16 instructions (ie. Arm v8.2-a). I don't know why this would be happening in your case, as your build params don't show any particular options controlling that sent to the compiler. Maybe your compiler is choosing that as the default? (I know of at least one vendor toolchain which does this. Mainline gcc and clang do not, as far as I know)

When Arm NN is compiled this way, the unit test assumes that Compute Library will also support fp16, which is not true in your case as you are compiling Compute Library for Arm v8.0-a which does not have the fp16 instructions.

I think the handling of fp16 could arguably be more dynamic (runtime-selected) on both the Arm NN and Compute Library sides, but I think this explains what you are seeing.

MatthewARM avatar Nov 25 '22 14:11 MatthewARM

Hi @morgolock / @MatthewARM ,

Changing the ACL build to use arch=armv8.2-a fixed the issue for me and the detailed explanation is appreciated.

Thanks for the great support,

Gareth

GW-Renesas avatar Dec 01 '22 10:12 GW-Renesas