ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

linux cross-compile errors from unused variable warnings when compiling onnxruntime 1.3.1 with ACL v19.05

Open dhunt-ambarella opened this issue 6 years ago • 2 comments

Compile error shown below.

I'm wondering if my environment is OK, or if I truly need to make source changes to ACL 19.05 in order to compile onnxruntime v1.3.1 with ACL 19.05. I get the same errors with ACL v19.08. Maybe I need onnxruntime v1.3.0?

I am cross-compiling onnxruntime with linaro gcc 8.2.

I can successfully compile and run onnxruntime without ACL.

Maybe CPATH needs linaro include path?

dhunt@ubu-sw4:/dump/dump201/dhunt/onnxruntime$ printenv CPATH /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/include:/dump/dump201/dhunt/arm_compute-v19.05-bin-linux:

Compile error: [ 9%] Building CXX object CMakeFiles/onnxruntime_providers_acl.dir/onnxruntime/core/providers/acl/acl_common.cc.o /usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu-g++ -DACL_1905=1 -DEIGEN_MPL2_ONLY -DNSYNC_ATOMIC_CPP11 -DONNX_ML -DONNX_NAMESPACE=onnx -DONNX_USE_LITE_PROTO -DPLATFORM_POSIX -DUSE_ACL=1 -DUSE_EIGEN_FOR_BLAS -D__ONNX_NO_DOC_STRINGS -I/dump/dump201/dhunt/onnxruntime/include/onnxruntime -I/dump/dump201/dhunt/onnxruntime/include/onnxruntime/core/session -I/dump/dump201/dhunt/onnxruntime/cmake/external/SafeInt -I/dump/dump201/dhunt/onnxruntime/cmake/external/nsync/public -I/dump/dump201/dhunt/onnxruntime -I/dump/dump201/dhunt/onnxruntime/cmake/external/onnx -I/dump/dump201/dhunt/onnxruntime/cmake/external/protobuf/src -I/dump/dump201/dhunt/onnxruntime/onnx/.. -I/dump/dump201/dhunt/onnxruntime/onnxruntime -I/dump/dump201/dhunt/onnxruntime/cmake/external/eigen -fopenmp -Wno-error=attributes -Dgsl_CONFIG_CONTRACT_VIOLATION_THROWS -Wall -Wextra -ffunction-sections -fdata-sections -Werror -Wno-parentheses -O2 -g -DNDEBUG -DGSL_UNENFORCED_ON_CONTRACT_VIOLATION -fPIC -std=gnu++14 -o CMakeFiles/onnxruntime_providers_acl.dir/onnxruntime/core/providers/acl/acl_common.cc.o -c /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc: In instantiation of ‘void onnxruntime::acl::importDataFromTensor(arm_compute::Tensor*, T*) [with T = float]’: /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc:79:71: required from here /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc:73:43: error: unused parameter ‘co’ [-Werror=unused-parameter] [&](const arm_compute::Coordinates& co) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ In file included from /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.h:798, from /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/TensorInfo.h:31, from /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/runtime/ITensorAllocator.h:27, from /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/runtime/TensorAllocator.h:27, from /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/runtime/Tensor.h:28, from /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.h:10, from /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc:9: /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.inl: In instantiation of ‘static void arm_compute::ForEachDimension<0>::unroll(const arm_compute::Window&, arm_compute::Coordinates&, L&&, Ts&& ...) [with L = onnxruntime::acl::importDataFromTensor(arm_compute::Tensor*, T*) [with T = float]::<lambda(const arm_compute::Coordinates&)>&; Ts = {arm_compute::Iterator&}]’: /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.inl:106:49: recursively required from ‘static void arm_compute::ForEachDimension::unroll(const arm_compute::Window&, arm_compute::Coordinates&, L&&, Ts&& ...) [with L = onnxruntime::acl::importDataFromTensor(arm_compute::Tensor*, T*) [with T = float]::<lambda(const arm_compute::Coordinates&)>&; Ts = {arm_compute::Iterator&}; long unsigned int dim = 5]’ /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.inl:106:49: required from ‘static void arm_compute::ForEachDimension::unroll(const arm_compute::Window&, arm_compute::Coordinates&, L&&, Ts&& ...) [with L = onnxruntime::acl::importDataFromTensor(arm_compute::Tensor*, T*) [with T = float]::<lambda(const arm_compute::Coordinates&)>; Ts = {arm_compute::Iterator&}; long unsigned int dim = 6]’ /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.inl:132:62: required from ‘void arm_compute::execute_window_loop(const arm_compute::Window&, L&&, Ts&& ...) [with L = onnxruntime::acl::importDataFromTensor(arm_compute::Tensor*, T*) [with T = float]::<lambda(const arm_compute::Coordinates&)>; Ts = {arm_compute::Iterator&}]’ /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc:71:35: required from ‘void onnxruntime::acl::importDataFromTensor(arm_compute::Tensor*, T*) [with T = float]’ /dump/dump201/dhunt/onnxruntime/onnxruntime/core/providers/acl/acl_common.cc:79:71: required from here /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.inl:115:38: error: unused parameter ‘w’ [-Werror=unused-parameter] static void unroll(const Window &w, Coordinates &id, L &&lambda_function, Ts &&... iterators) ~~~~~~~~~~~~~~^ /dump/dump201/dhunt/arm_compute-v19.05-bin-linux/arm_compute/core/Helpers.inl:115:84: error: unused parameter ‘iterators#0’ [-Werror=unused-parameter] static void unroll(const Window &w, Coordinates &id, L &&lambda_function, Ts &&... iterators) ~~~~~^~~~~~~~~~~~~ cc1plus: all warnings being treated as errors CMakeFiles/onnxruntime_providers_acl.dir/build.make:85: recipe for target 'CMakeFiles/onnxruntime_providers_acl.dir/onnxruntime/core/providers/acl/acl_common.cc.o' failed

onnxruntime cmake command: 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_1905=ON -Donnxruntime_USE_ACL_1908=OFF cmake

dhunt@ubu-sw4:/dump/dump201/dhunt/onnxruntime$ cat ../tool.cmake SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) SET(CMAKE_C_COMPILER /usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu-gcc) SET(CMAKE_CXX_COMPILER /usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu-g++)

dhunt-ambarella avatar Jun 30 '20 22:06 dhunt-ambarella

Thanks for your question, @dhunt-ambarella,

From the warning message itself, I think issues reside on both sides.

  • ONNX-side (more specifically, provider code) https://github.com/microsoft/onnxruntime/blob/6365760906ebf7f2198a48b6612440b333dbd32e/onnxruntime/core/providers/acl/acl_common.cc#L73 The argument "co" should be removed (or somehow marked as an unused variable) to avoid this compiler warning.

  • ACL-side https://github.com/ARM-software/ComputeLibrary/blob/1132fdba356a81e54234e5e24c6551d48bd688ec/arm_compute/core/Helpers.inl#L115 The argument "w" is causing the issue and it should be fixed by 19.11.1 and later as shown below. https://github.com/ARM-software/ComputeLibrary/blob/7f09cf7dfba61aad6d6d588b1b096f56bafaad5e/arm_compute/core/Helpers.inl#L117

From ACL's point of view, I'd recommend using a more recent release of ACL if possible.

If any changes are not possible in your environment, as they are all warnings, a non-ideal but fast solution would be using Werror=0.

I hope it helps.

sanpar02 avatar Jul 01 '20 09:07 sanpar02

Thanks!

I will use the newest version of ACL that I can. 20.05 brings new errors and warnings with onnxruntime v1.3.1.

ARM_COMPUTE_UNUSED() will be helpful.

This issue (question) can be closed.

dhunt-ambarella avatar Jul 03 '20 01:07 dhunt-ambarella