ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

graph_vgg16 aborted on hikey960 board

Open Zieng opened this issue 8 years ago • 5 comments

Output of 'strings libarm_compute.so | grep arm_compute_version':

arm_compute_version=v18.08 Build options: {'arch': 'armv7a', 'opencl': '0', 'neon': '1', 'build_dir': 'linux_32_debug', 'debug': '1', 'os': 'linux', 'Werror': '1'} Git hash=52ba29e936b8e711e8acdfe819e36f884d4f3fe1

Platform:

hikey960

Operating System:

Linux debian 4.4.74-00216-g10816f6 #3 SMP PREEMPT Thu Jul 6 14:38:42 BST 2017 aarch64 GNU/Linux

Problem description: After I compiled the ComputeLibrary, I tried the graph_vgg16 on my hikey960 board, but it abored.

The backtrace I got from gdb is:

 [GRAPH][06-09-2018 12:42:40][INFO]  Instantiated SoftmaxLayer Target NEON Data Type: F32 Input shape: 1000 Output shape: 1000

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Thread 1 "graph_vgg16" received signal SIGABRT, Aborted.
0xf68d56f6 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt
#0  0xf68d56f6 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#1  0xf68e33cc in raise () from /lib/arm-linux-gnueabihf/libc.so.6
#2  0xf68e40ba in abort () from /lib/arm-linux-gnueabihf/libc.so.6
#3  0xf6abfe8a in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0xf6abe89c in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#5  0xf6abe8f2 in std::terminate() () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#6  0xf6abeb16 in __cxa_throw () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#7  0xf6abef68 in operator new(unsigned int) () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#8  0xf74f9cf8 in arm_compute::MemoryRegion::MemoryRegion (this=0x11900c, size=67108864, alignment=0) at ./arm_compute/runtime/MemoryRegion.h:52
#9  0xf7530472 in __gnu_cxx::new_allocator<arm_compute::MemoryRegion>::construct<arm_compute::MemoryRegion, unsigned int, unsigned int>(arm_compute::MemoryRegion*, unsigned int&&, unsigned int&&) (
    this=0xfffeddfc, __p=0x11900c) at /usr/arm-linux-gnueabihf/include/c++/5/ext/new_allocator.h:120
#10 0xf753042c in std::allocator_traits<std::allocator<arm_compute::MemoryRegion> >::construct<arm_compute::MemoryRegion, unsigned int, unsigned int>(std::allocator<arm_compute::MemoryRegion>&, arm_compute::MemoryRegion*, unsigned int&&, unsigned int&&) (__a=..., __p=0x11900c) at /usr/arm-linux-gnueabihf/include/c++/5/bits/alloc_traits.h:530
#11 0xf75303c4 in std::_Sp_counted_ptr_inplace<arm_compute::MemoryRegion, std::allocator<arm_compute::MemoryRegion>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<unsigned int, unsigned int>(std::allocator<arm_compute::MemoryRegion>, unsigned int&&, unsigned int&&) (this=0x119000, __a=...) at /usr/arm-linux-gnueabihf/include/c++/5/bits/shared_ptr_base.h:522
#12 0xf75302c8 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<arm_compute::MemoryRegion, std::allocator<arm_compute::MemoryRegion>, unsigned int, unsigned int>(std::_Sp_make_shared_tag, arm_compute::MemoryRegion*, std::allocator<arm_compute::MemoryRegion> const&, unsigned int&&, unsigned int&&) (this=0xfffedf0c, __a=...) at /usr/arm-linux-gnueabihf/include/c++/5/bits/shared_ptr_base.h:617
#13 0xf75301f2 in std::__shared_ptr<arm_compute::MemoryRegion, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<arm_compute::MemoryRegion>, unsigned int, unsigned int>(std::_Sp_make_shared_tag, std::allocator<arm_compute::MemoryRegion> const&, unsigned int&&, unsigned int&&) (this=0xfffedf08, __tag=..., __a=...) at /usr/arm-linux-gnueabihf/include/c++/5/bits/shared_ptr_base.h:1097
#14 0xf75300da in std::shared_ptr<arm_compute::MemoryRegion>::shared_ptr<std::allocator<arm_compute::MemoryRegion>, unsigned int, unsigned int>(std::_Sp_make_shared_tag, std::allocator<arm_compute::MemoryRegion> const&, unsigned int&&, unsigned int&&) (this=0xfffedf08, __tag=..., __a=...) at /usr/arm-linux-gnueabihf/include/c++/5/bits/shared_ptr.h:319
#15 0xf752ffe0 in std::allocate_shared<arm_compute::MemoryRegion, std::allocator<arm_compute::MemoryRegion>, unsigned int, unsigned int>(std::allocator<arm_compute::MemoryRegion> const&, unsigned int&&, unsigned int&&) (__a=...) at /usr/arm-linux-gnueabihf/include/c++/5/bits/shared_ptr.h:620
#16 0xf752fd2a in std::make_shared<arm_compute::MemoryRegion, unsigned int, unsigned int>(unsigned int&&, unsigned int&&) () at /usr/arm-linux-gnueabihf/include/c++/5/bits/shared_ptr.h:636
#17 0xf752f27c in arm_compute::TensorAllocator::allocate (this=0x119234) at src/runtime/TensorAllocator.cpp:141
#18 0xf777c4e6 in arm_compute::graph::backends::NETensorHandle::allocate (this=0x119228) at src/graph/backends/NEON/NETensorHandle.cpp:43
#19 0xf7751c68 in arm_compute::graph::detail::allocate_all_output_tensors (node=...) at src/graph/detail/ExecutionHelpers.cpp:93
#20 0xf7751d46 in arm_compute::graph::detail::allocate_const_tensors (g=...) at src/graph/detail/ExecutionHelpers.cpp:108
#21 0xf7737484 in arm_compute::graph::GraphManager::finalize_graph (this=0x10d4cc, graph=..., ctx=..., pm=..., target=arm_compute::graph::Target::NEON) at src/graph/GraphManager.cpp:83
#22 0xf7753fc8 in arm_compute::graph::frontend::Stream::finalize (this=0x10d47c, target=arm_compute::graph::Target::NEON, config=...) at src/graph/frontend/Stream.cpp:44
#23 0x00083bf4 in GraphVGG16Example::do_setup (this=0x10d350, argc=1, argv=0xfffefbf4) at examples/graph_vgg16.cpp:224
#24 0x000a8fce in arm_compute::utils::run_example (argc=1, argv=0xfffefbf4, example=std::unique_ptr<arm_compute::utils::Example> containing 0x10d350) at utils/Utils.cpp:77
#25 0x000871ce in arm_compute::utils::run_example<GraphVGG16Example> (argc=1, argv=0xfffefbf4) at ./utils/Utils.h:104
#26 0x0007e22a in main (argc=1, argv=0xfffefbf4) at examples/graph_vgg16.cpp:250

OOM?

Zieng avatar Sep 06 '18 12:09 Zieng

Tried the same example on a new build

arm_compute_version=v18.08 Build options: {'arch': 'arm64-v8a', 'opencl': '0', 'neon': '1', 'build_dir': 'linux_arm64-v8a_debug', 'debug': '1', 'os': 'linux', 'Werror': '1'} Git hash=52ba29e936b8e711e8acdfe819e36f884d4f3fe1

it can pass.

I'm expecting that binary compiled for 32-bit should work on a 64-bit platform, or this is not true for embedded system?

Zieng avatar Sep 06 '18 13:09 Zieng

Hello @Zieng, Yes a 32-bit binary should work on a 64-bit platform. We will investigate the issue.

GeorgeARM avatar Sep 06 '18 14:09 GeorgeARM

Great!

Zieng avatar Sep 06 '18 23:09 Zieng

Hi @Zieng, I just tried with the release 18.11 and everything works, here are the details:

Operating System Details root@acl_hikey_dev:~/tmp/manbot01/build/linux_32_debug/examples# uname -a Linux acl_hikey_dev 4.4.74-00216-g10816f6 #3 SMP PREEMPT Thu Jul 6 14:38:42 BST 2017 aarch64 GNU/Linux

Compilation script scons arch=armv7a opencl=0 neon=1 build_dir=linux_32_debug debug=1 os=linux Werror=1

Output of 'strings libarm_compute.so | grep arm_compute_version': root@acl_hikey_dev:~/tmp/manbot01/build/linux_32_debug# strings libarm_compute.so | grep arm_compute_version arm_compute_version=v18.11 Build options: {'arch': 'armv7a', 'opencl': '0', 'neon': '1', 'build_dir': 'linux_32_debug', 'debug': '1', 'os': 'linux', 'Werror': '1'} Git hash=3d2d44ef55ab6b08afda8be48301ce3c55c7bc67

Running VGG16 ./examples/graph_vgg16 --target=NEON --type=F32

Output

Threads : 1 Target : NEON Data type : F32 Data layout : NHWC Tuner enabled? : false Tuner file : Fast math enabled? : false

[GRAPH][01-02-2019 03:45:04][INFO] Running mutating pass : NodeFusionMutator

[GRAPH][01-02-2019 03:45:04][INFO] Running mutating pass : GroupedConvolutionMutator

[GRAPH][01-02-2019 03:45:04][INFO] Running mutating pass : InPlaceOperationMutator

....

[GRAPH][01-02-2019 03:45:06][INFO] Instantiated prob Type: SoftmaxLayer Target: NEON Data Type: F32 Input shape: 1000 Output shape: 1000

Test passed

Let us know, Thanks Manuel

ManubARM avatar Feb 01 '19 15:02 ManubARM

Closing for inactivity, feel free to reopen otherwise

ManubARM avatar Feb 15 '19 10:02 ManubARM