Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uponnxruntime_test_all --gtest_filter=ActivationOpTest.Relu fails, cross-compile onnxruntime v1.3.1 against ACL v19.08 #4463
Comments
|
Looks like import_memory() (called from ) is causing this issue.import_memory() is defined in ACL compute library(https://github.com/ARM-software/ComputeLibrary/blob/6a7771e460abeac7d401d6d38a0fcf0a0d2c3cbe/src/runtime/TensorAllocator.cpp#L154), could be an issue with the way it's getting freed in the class. |
|
@Andrews548, @mikecaraman any ideas what could be going wrong here? |
|
maybe this is the reason? are you building ACL from source or using pre-built binaries? |
|
This works when ACL is built from source(just tried it). You only run into error when using pre-built binaries. |
|
Yes. Using prebuilt libraries. I will ask my administrator to install scons. Any chance someone can share the libraries that will work? Also, I use v8a-neon libraries. Not sure how to know which ones I should be using: |
|
I did a native build of ACL library, so it may not work on a different type of machine. You can use ACL 19.08 with onnxruntime using the following steps:
|
|
This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
|
Native build of ACL libraries was the fix. |
|
Seems I can't close this myself. It can be closed. |
Note: Google Test filter = ActivationOpTest.Relu
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ActivationOpTest
[ RUN ] ActivationOpTest.Relu
free(): invalid pointer
Aborted (core dumped)
All tests preceding this test (hundreds) are OK. Some tests after fail also.
Also, but possibly not related:
onnxruntime_perf_test -e acl testdata/squeezenet/model.onnx result.csv
free(): invalid pointer
Aborted (core dumped)
onnxruntime v1.3.1 cross compiled with linaro-gcc8.2.
In onnxruntime, I changed these files:
onnxruntime/core/providers/acl/acl_execution_provider.cc
onnxruntime/core/providers/acl/acl_common.cc
onnxruntime/core/providers/acl/nn/conv.cc
In onnxruntime/core/providers/acl/acl_execution_provider.cc, pretend to use the return value from Register():
kernel_registry.Register(BuildKernelCreateInfo<ONNX_OPERATOR_KERNEL_CLASS_NAME(kAclExecutionProvider, kOnnxDomain, 6, Relu)>());
kernel_registry.Register(BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME(kAclExecutionProvider, kOnnxDomain, 7, 9, Gemm)>());
In onnxruntime/core/providers/acl/acl_common.cc, fixed an unused-variable warning:
--- a/onnxruntime/core/providers/acl/acl_common.cc
+++ b/onnxruntime/core/providers/acl/acl_common.cc
@@ -70,7 +70,8 @@ void importDataFromTensor(arm_compute::Tensor* tensor, T* data){
// copy input tensor into the larger buffer
arm_compute::execute_window_loop(
aclInpuWindow,
+// [&](const arm_compute::Coordinates& co) {
In onnxruntime/core/providers/acl/nn/conv.cc, fixed 'used uninitialized' error:
Also, to compile and link, there were changes to my environment.
In .bashrc, I added ACL include files to CPATH:
export ACL_VER="19.08"
export CPATH="/dump/dump201/dhunt/arm_compute-v${ACL_VER}-bin-linux/include:/dump/dump201/dhunt/arm_compute-v${ACL_VER}-bin-linux:$CPATH"
And for linking, I added this to environment:
export LD_RUN_PATH="/dump/dump201/dhunt/arm_compute-v${ACL_VER}-bin-linux/lib/linux-arm64-v8a-neon/"
export LD_LIBRARY_PATH="/dump/dump201/dhunt/arm_compute-v${ACL_VER}-bin-linux/lib/linux-arm64-v8a-neon/"
I provided soft links to the ACL libraries so onnxruntime could find them.
dhunt@ubu-sw4:/dump/dump201/dhunt/onnxruntime$ ln -s /dump/dump201/dhunt/arm_compute-v19.08-bin-linux/lib/linux-arm64-v8a-neon/libarm_compute.so libarm_compute.so
dhunt@ubu-sw4:/dump/dump201/dhunt/onnxruntime$ ln -s /dump/dump201/dhunt/arm_compute-v19.08-bin-linux/lib/linux-arm64-v8a-neon/libarm_compute_core.so libarm_compute_core.so
dhunt@ubu-sw4:/dump/dump201/dhunt/onnxruntime$ ln -s /dump/dump201/dhunt/arm_compute-v19.08-bin-linux/lib/linux-arm64-v8a-neon/libarm_compute_graph.so libarm_compute_graph.so
I used this cmake command, and 'make -j 6' to build:
cmake -DCMAKE_TOOLCHAIN_FILE=/dump/dump201/dhunt/tool.cmake -Donnxruntime_CROSS_COMPILING=ON -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_DEV_MODE=ON -DPYTHON_EXECUTABLE=/opt/amba/cv2_third/tv2/exe/python3 -Donnxruntime_USE_CUDA=OFF -Donnxruntime_USE_NSYNC=OFF -Donnxruntime_CUDNN_HOME= -Donnxruntime_USE_JEMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=OFF -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_SHARED_LIB=ON -Donnxruntime_USE_EIGEN_FOR_BLAS=ON -Donnxruntime_USE_OPENBLAS=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_MKLML=OFF -Donnxruntime_USE_OPENMP=ON -Donnxruntime_USE_TVM=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_BRAINSLICE=OFF -Donnxruntime_USE_NUPHAR=OFF -Donnxruntime_USE_EIGEN_THREADPOOL=OFF -Donnxruntime_BUILD_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dprotobuf_WITH_ZLIB=OFF -DONNX_CUSTOM_PROTOC_EXECUTABLE=/dump/dump201/dhunt/protoc_3.11.3/bin/protoc -DCMAKE_VERBOSE_MAKEFILE=ON -Donnxruntime_USE_ACL=ON -Donnxruntime_USE_ACL_1902=OFF -Donnxruntime_USE_ACL_1905=OFF -Donnxruntime_USE_ACL_1908=ON -Donnxruntime_USE_ACL_2005=OFF cmake
cat tool.cmake
After all that, the compile and link succeed.