gaintpd edited a comment on issue #7261:
URL: https://github.com/apache/tvm/issues/7261#issuecomment-759435642


   @leandron Thank you very much for the tips. As I want to build the Ethos-N 
backend with tvm in a minimal way, I just build the driver lib and it generates 
four files: `libEthosNDriver.a`,  `libEthosNDriver.so`, `libEthosNSupport.a`, 
`libEthosNSupport.so`. And install into the default directory, with the most 
updated version(20.11) of Ethos-N Driver stack. Another problem arises, I get 
the following errors:
   ```
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc: In member 
function ‘tvm::relay::contrib::ethosn::NetworkWithIDs 
tvm::relay::contrib::ethosn::ConstructNetworkVisitor::Construct(const 
tvm::relay::Function&)’:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc:202:32: error: too 
few arguments to function ‘std::shared_ptr<ethosn::support_library::Network> 
ethosn::support_library::CreateNetwork(const std::vector<char>&)’
     202 |   network_ = sl::CreateNetwork();
         |                                ^
   In file included from 
/home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api_version.h:20,
                    from 
/home/dyn/tvm/src/relay/backend/contrib/ethosn/capabilities.h:34,
                    from 
/home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc:27:
   /usr/local/include/ethosn_support_library/Support.hpp:1116:26: note: 
declared here
    1116 | std::shared_ptr<Network> CreateNetwork(const std::vector<char>& 
caps);
         |                          ^~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc: In static member 
function ‘static ethosn::support_library::CompilationOptions 
tvm::relay::contrib::ethosn::EthosnCompiler::CreateOptions()’:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc:564:64: error: no 
matching function for call to 
‘ethosn::support_library::CompilationOptions::CompilationOptions(std::vector<char>&)’
     564 |   sl::CompilationOptions options(variants[cfg.value()->variant]);
         |                                                                ^
   In file included from 
/home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api_version.h:20,
                    from 
/home/dyn/tvm/src/relay/backend/contrib/ethosn/capabilities.h:34,
                    from 
/home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc:27:
   /usr/local/include/ethosn_support_library/Support.hpp:69:8: note: candidate: 
‘constexpr ethosn::support_library::CompilationOptions::CompilationOptions()’
      69 | struct CompilationOptions
         |        ^~~~~~~~~~~~~~~~~~
   /usr/local/include/ethosn_support_library/Support.hpp:69:8: note:   
candidate expects 0 arguments, 1 provided
   /usr/local/include/ethosn_support_library/Support.hpp:69:8: note: candidate: 
‘ethosn::support_library::CompilationOptions::CompilationOptions(const 
ethosn::support_library::CompilationOptions&)’
   /usr/local/include/ethosn_support_library/Support.hpp:69:8: note:   no known 
conversion for argument 1 from ‘std::vector<char>’ to ‘const 
ethosn::support_library::CompilationOptions&’
   /usr/local/include/ethosn_support_library/Support.hpp:69:8: note: candidate: 
‘ethosn::support_library::CompilationOptions::CompilationOptions(ethosn::support_library::CompilationOptions&&)’
   /usr/local/include/ethosn_support_library/Support.hpp:69:8: note:   no known 
conversion for argument 1 from ‘std::vector<char>’ to 
‘ethosn::support_library::CompilationOptions&&’
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/codegen.cc:579:55: error: 
cannot convert ‘const bool’ to 
‘ethosn::support_library::CompilationOptions::DebugLevel’ in assignment
     579 |   options.m_DebugInfo.m_DumpDebugFiles = 
cfg.value()->dump_debug_files;
         |                                          
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
         |                                                       |
         |                                                       const bool
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:638:27: error: 
‘IsDepthwiseConvolutionSupported’ is not a member of 
‘tvm::relay::contrib::ethosn::sl’
     638 |         *rv = !err && 
sl::IsDepthwiseConvolutionSupported(params.bias_info, params.weights_info,
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:641:27: error: 
‘IsConvolutionSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     641 |         *rv = !err && sl::IsConvolutionSupported(params.bias_info, 
params.weights_info,
         |                           ^~~~~~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:651:25: error: 
‘IsFullyConnectedSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     651 |       *rv = !err && sl::IsFullyConnectedSupported(params.bias_info, 
params.weights_info,
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:660:25: error: 
‘IsPoolingSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     660 |       *rv = !err && sl::IsPoolingSupported(params.pool_info, 
params.input_info);
         |                         ^~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:668:25: error: 
‘IsPoolingSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     668 |       *rv = !err && sl::IsPoolingSupported(params.pool_info, 
params.input_info);
         |                         ^~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:676:25: error: 
‘IsReshapeSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     676 |       *rv = !err && sl::IsReshapeSupported(params.new_shape, 
params.input_info);
         |                         ^~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:684:25: error: 
‘IsAdditionSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     684 |       *rv = !err && sl::IsAdditionSupported(params.lhs_info, 
params.rhs_info,
         |                         ^~~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:693:25: error: 
‘IsSigmoidSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     693 |       *rv = !err && sl::IsSigmoidSupported(params.input_info);
         |                         ^~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:701:25: error: 
‘IsConcatenationSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     701 |       *rv = !err && sl::IsConcatenationSupported(params.input_infos, 
params.concat_info);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:709:25: error: 
‘IsSplitSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     709 |       *rv = !err && sl::IsSplitSupported(params.input_info, 
params.split_info);
         |                         ^~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:717:25: error: 
‘IsDepthToSpaceSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     717 |       *rv = !err && sl::IsDepthToSpaceSupported(params.input_info, 
params.depth_info);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc: In lambda 
function:
   /home/dyn/tvm/src/relay/backend/contrib/ethosn/ethosn_api.cc:725:25: error: 
‘IsReluSupported’ is not a member of ‘tvm::relay::contrib::ethosn::sl’
     725 |       *rv = !err && sl::IsReluSupported(params.relu_info, 
params.input_info);
         |                         ^~~~~~~~~~~~~~~
   make[2]: *** [CMakeFiles/tvm_objs.dir/build.make:4340: 
CMakeFiles/tvm_objs.dir/src/relay/backend/contrib/ethosn/ethosn_api.cc.o] Error 
1
   make[2]: *** Waiting for unfinished jobs....
   make[2]: *** [CMakeFiles/tvm_objs.dir/build.make:4327: 
CMakeFiles/tvm_objs.dir/src/relay/backend/contrib/ethosn/codegen.cc.o] Error 1
   make[1]: *** [CMakeFiles/Makefile2:193: CMakeFiles/tvm_objs.dir/all] Error 2
   make: *** [Makefile:130: all] Error 2
   ```
   @Leo-arm Thank you very much for your tips, When I check out the 20.08 
version of Ethos-N driver stack, I get the following errors:
   ```
   g++ -o support_library/build/release/src/Support.o -c -std=c++14 -O3 -Werror 
-Wall -Wextra -Wformat=2 -Wno-format-nonliteral -Wctor-dtor-privacy 
-Woverloaded-virtual -Wsign-promo -Wstrict-overflow=2 -Wswitch-default 
-Wlogical-op -Wnoexcept -Wstrict-null-sentinel -Wconversion -fPIC 
-Icommand_stream/include -Iutils/include -Isupport_library/build/release/src 
-Isupport_library/src -Isupport_library/build/release/include 
-Isupport_library/include support_library/src/Support.cpp
   In file included from support_library/src/Graph.hpp:9,
                    from support_library/src/Compiler.hpp:10,
                    from support_library/src/Support.cpp:9:
   /usr/include/c++/9/ext/new_allocator.h: In instantiation of 'void 
__gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = 
ethosn::support_library::Operand::Consumer; _Args = 
{ethosn::support_library::Operation&, const long unsigned int&}; _Tp = 
ethosn::support_library::Operand::Consumer]':
   /usr/include/c++/9/bits/alloc_traits.h:482:2:   required from 'static void 
std::allocator_traits<std::allocator<_CharT> 
>::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, 
_Up*, _Args&& ...) [with _Up = ethosn::support_library::Operand::Consumer; 
_Args = {ethosn::support_library::Operation&, const long unsigned int&}; _Tp = 
ethosn::support_library::Operand::Consumer; 
std::allocator_traits<std::allocator<_CharT> >::allocator_type = 
std::allocator<ethosn::support_library::Operand::Consumer>]'
   /usr/include/c++/9/bits/vector.tcc:115:30:   required from 'void 
std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = 
{ethosn::support_library::Operation&, const long unsigned int&}; _Tp = 
ethosn::support_library::Operand::Consumer; _Alloc = 
std::allocator<ethosn::support_library::Operand::Consumer>]'
   support_library/src/Network.hpp:46:50:   required from here
   support_library/src/Network.hpp:28:19: error: but 'constexpr 
ethosn::support_library::Operand::Consumer::Consumer(ethosn::support_library::Operation&,
 size_t)' does not throw; perhaps it should be declared 'noexcept' 
[-Werror=noexcept]
      28 |         constexpr Consumer(Operation& operation, const size_t 
inputIndex)
         |                   ^~~~~~~~
   /usr/include/c++/9/ext/new_allocator.h: In instantiation of 'void 
__gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = 
ethosn::support_library::Network; _Args = {}; _Tp = 
ethosn::support_library::Network]':
   /usr/include/c++/9/bits/alloc_traits.h:482:2:   required from 'static void 
std::allocator_traits<std::allocator<_CharT> 
>::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, 
_Up*, _Args&& ...) [with _Up = ethosn::support_library::Network; _Args = {}; 
_Tp = ethosn::support_library::Network; 
std::allocator_traits<std::allocator<_CharT> >::allocator_type = 
std::allocator<ethosn::support_library::Network>]'
   /usr/include/c++/9/bits/shared_ptr_base.h:548:39:   required from 
'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, 
_Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {}; _Tp = 
ethosn::support_library::Network; _Alloc = 
std::allocator<ethosn::support_library::Network>; __gnu_cxx::_Lock_policy _Lp = 
__gnu_cxx::_S_atomic]'
   /usr/include/c++/9/bits/shared_ptr_base.h:679:16:   required from 
'std::__shared_count<_Lp>::__shared_count(_Tp*&, 
std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = 
ethosn::support_library::Network; _Alloc = 
std::allocator<ethosn::support_library::Network>; _Args = {}; 
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]'
   /usr/include/c++/9/bits/shared_ptr_base.h:1344:71:   required from 
'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, 
_Args&& ...) [with _Alloc = std::allocator<ethosn::support_library::Network>; 
_Args = {}; _Tp = ethosn::support_library::Network; __gnu_cxx::_Lock_policy _Lp 
= __gnu_cxx::_S_atomic]'
   /usr/include/c++/9/bits/shared_ptr.h:359:59:   required from 
'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) 
[with _Alloc = std::allocator<ethosn::support_library::Network>; _Args = {}; 
_Tp = ethosn::support_library::Network]'
   /usr/include/c++/9/bits/shared_ptr.h:701:14:   required from 
'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with 
_Tp = ethosn::support_library::Network; _Alloc = 
std::allocator<ethosn::support_library::Network>; _Args = {}]'
   /usr/include/c++/9/bits/shared_ptr.h:717:39:   required from 
'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = 
ethosn::support_library::Network; _Args = {}]'
   support_library/src/Support.cpp:405:38:   required from here
   support_library/src/Network.hpp:81:5: error: but 
'ethosn::support_library::Network::Network(bool)' does not throw; perhaps it 
should be declared 'noexcept' [-Werror=noexcept]
      81 |     Network(bool estimatePerformance = false)
         |     ^~~~~~~
   /usr/include/c++/9/ext/new_allocator.h: In instantiation of 'void 
__gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = 
ethosn::support_library::Network; _Args = {bool}; _Tp = 
ethosn::support_library::Network]':
   /usr/include/c++/9/bits/alloc_traits.h:482:2:   required from 'static void 
std::allocator_traits<std::allocator<_CharT> 
>::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, 
_Up*, _Args&& ...) [with _Up = ethosn::support_library::Network; _Args = 
{bool}; _Tp = ethosn::support_library::Network; 
std::allocator_traits<std::allocator<_CharT> >::allocator_type = 
std::allocator<ethosn::support_library::Network>]'
   /usr/include/c++/9/bits/shared_ptr_base.h:548:39:   required from 
'std::_Sp_counted_ptr_inplace<_Tp, _Alloc, 
_Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {bool}; _Tp = 
ethosn::support_library::Network; _Alloc = 
std::allocator<ethosn::support_library::Network>; __gnu_cxx::_Lock_policy _Lp = 
__gnu_cxx::_S_atomic]'
   /usr/include/c++/9/bits/shared_ptr_base.h:679:16:   required from 
'std::__shared_count<_Lp>::__shared_count(_Tp*&, 
std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = 
ethosn::support_library::Network; _Alloc = 
std::allocator<ethosn::support_library::Network>; _Args = {bool}; 
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]'
   /usr/include/c++/9/bits/shared_ptr_base.h:1344:71:   required from 
'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, 
_Args&& ...) [with _Alloc = std::allocator<ethosn::support_library::Network>; 
_Args = {bool}; _Tp = ethosn::support_library::Network; __gnu_cxx::_Lock_policy 
_Lp = __gnu_cxx::_S_atomic]'
   /usr/include/c++/9/bits/shared_ptr.h:359:59:   required from 
'std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) 
[with _Alloc = std::allocator<ethosn::support_library::Network>; _Args = 
{bool}; _Tp = ethosn::support_library::Network]'
   /usr/include/c++/9/bits/shared_ptr.h:701:14:   required from 
'std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with 
_Tp = ethosn::support_library::Network; _Alloc = 
std::allocator<ethosn::support_library::Network>; _Args = {bool}]'
   /usr/include/c++/9/bits/shared_ptr.h:717:39:   required from 
'std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = 
ethosn::support_library::Network; _Args = {bool}]'
   support_library/src/Support.cpp:410:42:   required from here
   support_library/src/Network.hpp:81:5: error: but 
'ethosn::support_library::Network::Network(bool)' does not throw; perhaps it 
should be declared 'noexcept' [-Werror=noexcept]
   cc1plus: all warnings being treated as errors
   scons: *** [support_library/build/release/src/Support.o] Error 1
   scons: building terminated because of errors.
   ```
   I did not build the Ethos-N kernel driver, is this matter?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to