Closed abcdrm closed 11 months ago
Hi @abcdrm
From the callstack you shared I see the problem is when the program tries to compile OpenCL code. What GPU have you got? Is OpenCL working on your device? ACL is designed and optimised for MALI GPUs. It would be good if you could build the library with debug=1
and run your test again to get more information.
I've noticed another problem with your code: you need to move the code allocating and initializing the tensors after the call to configure()
as shown below
CLSoftmaxLayer softmax_op_;
softmax_op_.configure(&cl_in, &cl_out, 1.0f, 0);
cl_in.allocator()->allocate();
cl_out.allocator()->allocate();
cl_in.map(true);
auto ptr = reinterpret_cast< uint16_t* >(cl_in.buffer());
for (int i = 0; i < 32 * 32; ++i) {
ptr[i] = 10000 + i;
}
cl_in.unmap();
softmax_op_.run();
Please see our example https://github.com/ARM-software/ComputeLibrary/blob/main/examples/cl_sgemm.cpp#L139
Hope this helps
Hi @morgolock
My code is running on Adreno 730 from Qualcomm.
I have tested both DataType::F16
and DataType::F32
as input, only DataType::F16
has issue above, DataType::F32
works as expected.
For the order of tensor allocate and op configure, I tested both order using DataType::F32
, seems not causing any problems, may you explain more details about why allocate()
should appears after configure()
?
Hi @abcdrm
It looks like a problem when building the OpenCL kernel with the FP16 data type. Maybe if you build the debug version of the library you can get more details, you can use scons debug=1
to do this.
Have you tried any other OpenCL code using FP16 on your device?
For the order of the allocation, it's because of the padding in the tensors. For more details please see the documentation: https://arm-software.github.io/ComputeLibrary/latest/architecture.xhtml#architecture_images_tensors_padding_and_border
Hope this helps
Use
arm_compute-v23.08-bin-android-arm64-v8.2-a-neon-cl.tar.gz
downloaded from release page:Platform: Qualcomm 8475
Operating System: Android,use
aarch64-linux-android21-clang++
in android-ndk-r25b to compile the program.Problem description: GDB back trace: