Tencent / TurboTransformers

a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.
Other
1.49k stars 198 forks source link

failed to build the project. #231

Closed mmmeee1111 closed 3 years ago

mmmeee1111 commented 3 years ago

Hi, thanks for the open-sourced project. I tried to run the exp but failed to compile the project. I followed the instructions to build the project with docker. And i met these errors:

[192/262] Building CXX object turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/allocator_api.cpp.o FAILED: turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/allocator_api.cpp.o /usr/bin/c++ -DLOGURU_WITH_STREAMS=1 -DTT_BLAS_USE_MKL -DTT_WITH_CUDA -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/usr/local/cuda/include -I/src/TurboTransformers/3rd/cub -I/src/TurboTransformers/3rd/FP16/include -I/src/TurboTransformers -I/opt/miniconda3/include -I/src/TurboTransformers/3rd/abseil -I/src/TurboTransformers/3rd/dlpack/include -I/src/TurboTransformers/3rd/loguru -Wall -m64 -fopenmp -O3 -DNDEBUG -fPIC -std=gnu++14 -MD -MT turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/allocator_api.cpp.o -MF turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/allocator_api.cpp.o.d -o turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/allocator_api.cpp.o -c /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp In file included from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:21:0: /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h: In constructor 'turbo_transformers::core::allocator::ModelAwareAllocator::ModelAwareAllocator(const string&)': /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h:118:13: warning: 'turbo_transformers::core::allocator::ModelAwareAllocator::gpu_chunk_list_' will be initialized after [-Wreorder] ChunkList gpu_chunk_list_; ^ /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h:114:13: warning: 'turbo_transformers::core::allocator::ChunkList turbo_transformers::core::allocator::ModelAwareAllocator::cpu_chunk_list_' [-Wreorder] ChunkList cpu_chunk_list_; ^ /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h:34:12: warning: when initialized here [-Wreorder] explicit ModelAwareAllocator(const std::string& model_name) ^ In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _Args = {const char (&)[12], turbo_transformers::core::allocator::ModelAwareAllocator*}; _Tp = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >]': /usr/include/c++/5/bits/alloc_traits.h:530:4: required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _Args = {const char (&)[12], turbo_transformers::core::allocator::ModelAwareAllocator*}; _Tp = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > > >]' /usr/include/c++/5/bits/stl_tree.h:529:32: required from 'void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_construct_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type, _Args&& ...) [with _Args = {const char (&)[12], turbo_transformers::core::allocator::ModelAwareAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >*]' /usr/include/c++/5/bits/stl_tree.h:546:21: required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {const char (&)[12], turbo_transformers::core::allocator::ModelAwareAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >*]' /usr/include/c++/5/bits/stl_tree.h:2123:33: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_unique(_Args&& ...) [with _Args = {const char (&)[12], turbo_transformers::core::allocator::ModelAwareAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >]' /usr/include/c++/5/bits/stl_map.h:559:64: required from 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::emplace(_Args&& ...) [with _Args = {const char (&)[12], turbo_transformers::core::allocator::ModelAwareAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Tp = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >]' /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:78:77: required from here /usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >::pair(const char [12], turbo_transformers::core::allocator::ModelAwareAllocator*)' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:206:9: note: candidate: template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>) pair(tuple<_Args1...>&, tuple<_Args2...>&, ^ /usr/include/c++/5/bits/stl_pair.h:206:9: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: mismatched types 'std::tuple<_Args1 ...>' and 'const char [12]' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:155:9: note: candidate: template<class ... _Args1, class ... _Args2> std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>) pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); ^ /usr/include/c++/5/bits/stl_pair.h:155:9: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: cannot convert 'std::forward<const char (&)[12]>((* & __args#0))' (type 'const char [12]') to type 'std::piecewise_construct_t' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:150:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) constexpr pair(pair<_U1, _U2>&& __p) ^ /usr/include/c++/5/bits/stl_pair.h:150:12: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: mismatched types 'std::pair<_T1, _T2>' and 'const char [12]' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:144:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) constexpr pair(_U1&& __x, _U2&& __y) ^ /usr/include/c++/5/bits/stl_pair.h:144:12: note: template argument deduction/substitution failed: /usr/include/c++/5/bits/stl_pair.h:141:38: error: no type named 'type' in 'struct std::enable_if<false, void>' template<class _U1, class _U2, class = typename ^ /usr/include/c++/5/bits/stl_pair.h:138:12: note: candidate: template<class _U2, class> constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&) constexpr pair(const _T1& __x, _U2&& __y) ^ /usr/include/c++/5/bits/stl_pair.h:138:12: note: template argument deduction/substitution failed: /usr/include/c++/5/bits/stl_pair.h:136:27: error: no type named 'type' in 'struct std::enable_if<false, void>' template<class _U2, class = typename ^ /usr/include/c++/5/bits/stl_pair.h:133:12: note: candidate: template<class _U1, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&) constexpr pair(_U1&& __x, const _T2& __y) ^ /usr/include/c++/5/bits/stl_pair.h:133:12: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: cannot convert 'std::forward<turbo_transformers::core::allocator::ModelAwareAllocator*>((* & __args#1))' (type 'turbo_transformers::core::allocator::ModelAwareAllocator*') to type 'const std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>&' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:128:17: note: candidate: constexpr std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>] constexpr pair(pair&&) = default; ^ /usr/include/c++/5/bits/stl_pair.h:128:17: note: candidate expects 1 argument, 2 provided /usr/include/c++/5/bits/stl_pair.h:124:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) constexpr pair(const pair<_U1, _U2>& __p) ^ /usr/include/c++/5/bits/stl_pair.h:124:12: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: mismatched types 'const std::pair<_T1, _T2>' and 'const char [12]' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:112:26: note: candidate: constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>] _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) ^ /usr/include/c++/5/bits/stl_pair.h:112:26: note: no known conversion for argument 2 from 'turbo_transformers::core::allocator::ModelAwareAllocator*' to 'const std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>&' /usr/include/c++/5/bits/stl_pair.h:108:26: note: candidate: constexpr std::pair<_T1, _T2>::pair() [with _T1 = const std::__cxx11::basic_string<char>; _T2 = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>] _GLIBCXX_CONSTEXPR pair() ^ /usr/include/c++/5/bits/stl_pair.h:108:26: note: candidate expects 0 arguments, 2 provided In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _Args = {const char (&)[6], turbo_transformers::core::allocator::NaiveAllocator*}; _Tp = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >]': /usr/include/c++/5/bits/alloc_traits.h:530:4: required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _Args = {const char (&)[6], turbo_transformers::core::allocator::NaiveAllocator*}; _Tp = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > > >]' /usr/include/c++/5/bits/stl_tree.h:529:32: required from 'void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_construct_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type, _Args&& ...) [with _Args = {const char (&)[6], turbo_transformers::core::allocator::NaiveAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >*]' /usr/include/c++/5/bits/stl_tree.h:546:21: required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {const char (&)[6], turbo_transformers::core::allocator::NaiveAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >*]' /usr/include/c++/5/bits/stl_tree.h:2123:33: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_unique(_Args&& ...) [with _Args = {const char (&)[6], turbo_transformers::core::allocator::NaiveAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >]' /usr/include/c++/5/bits/stl_map.h:559:64: required from 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::emplace(_Args&& ...) [with _Args = {const char (&)[6], turbo_transformers::core::allocator::NaiveAllocator*}; _Key = const std::__cxx11::basic_string<char>; _Tp = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>; _Compare = std::less<const std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> > >]' /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:80:60: required from here /usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator> >::pair(const char [6], turbo_transformers::core::allocator::NaiveAllocator*)' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:206:9: note: candidate: template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>) pair(tuple<_Args1...>&, tuple<_Args2...>&, ^ /usr/include/c++/5/bits/stl_pair.h:206:9: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: mismatched types 'std::tuple<_Args1 ...>' and 'const char [6]' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:155:9: note: candidate: template<class ... _Args1, class ... _Args2> std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>) pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); ^ /usr/include/c++/5/bits/stl_pair.h:155:9: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: cannot convert 'std::forward<const char (&)[6]>((* & __args#0))' (type 'const char [6]') to type 'std::piecewise_construct_t' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:150:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) constexpr pair(pair<_U1, _U2>&& __p) ^ /usr/include/c++/5/bits/stl_pair.h:150:12: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: mismatched types 'std::pair<_T1, _T2>' and 'const char [6]' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:144:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) constexpr pair(_U1&& __x, _U2&& __y) ^ /usr/include/c++/5/bits/stl_pair.h:144:12: note: template argument deduction/substitution failed: /usr/include/c++/5/bits/stl_pair.h:141:38: error: no type named 'type' in 'struct std::enable_if<false, void>' template<class _U1, class _U2, class = typename ^ /usr/include/c++/5/bits/stl_pair.h:138:12: note: candidate: template<class _U2, class> constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&) constexpr pair(const _T1& __x, _U2&& __y) ^ /usr/include/c++/5/bits/stl_pair.h:138:12: note: template argument deduction/substitution failed: /usr/include/c++/5/bits/stl_pair.h:136:27: error: no type named 'type' in 'struct std::enable_if<false, void>' template<class _U2, class = typename ^ /usr/include/c++/5/bits/stl_pair.h:133:12: note: candidate: template<class _U1, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&) constexpr pair(_U1&& __x, const _T2& __y) ^ /usr/include/c++/5/bits/stl_pair.h:133:12: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: cannot convert 'std::forward<turbo_transformers::core::allocator::NaiveAllocator*>((* & __args#1))' (type 'turbo_transformers::core::allocator::NaiveAllocator*') to type 'const std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>&' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:128:17: note: candidate: constexpr std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>] constexpr pair(pair&&) = default; ^ /usr/include/c++/5/bits/stl_pair.h:128:17: note: candidate expects 1 argument, 2 provided /usr/include/c++/5/bits/stl_pair.h:124:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) constexpr pair(const pair<_U1, _U2>& __p) ^ /usr/include/c++/5/bits/stl_pair.h:124:12: note: template argument deduction/substitution failed: In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/bits/stl_tree.h:64, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/ext/new_allocator.h:120:4: note: mismatched types 'const std::pair<_T1, _T2>' and 'const char [6]' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0, from /usr/include/c++/5/bits/stl_tree.h:63, from /usr/include/c++/5/map:60, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.h:17, from /src/TurboTransformers/turbo_transformers/core/allocator/allocator_api.cpp:14: /usr/include/c++/5/bits/stl_pair.h:112:26: note: candidate: constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>] _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) ^ /usr/include/c++/5/bits/stl_pair.h:112:26: note: no known conversion for argument 2 from 'turbo_transformers::core::allocator::NaiveAllocator*' to 'const std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>&' /usr/include/c++/5/bits/stl_pair.h:108:26: note: candidate: constexpr std::pair<_T1, _T2>::pair() [with _T1 = const std::__cxx11::basic_string<char>; _T2 = std::unique_ptr<turbo_transformers::core::allocator::BaseAllocator>] _GLIBCXX_CONSTEXPR pair() ^ /usr/include/c++/5/bits/stl_pair.h:108:26: note: candidate expects 0 arguments, 2 provided [193/262] Building CXX object turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/model_aware_allocator.cpp.o In file included from /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.cpp:18:0: /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h: In constructor 'turbo_transformers::core::allocator::ModelAwareAllocator::ModelAwareAllocator(const string&)': /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h:118:13: warning: 'turbo_transformers::core::allocator::ModelAwareAllocator::gpu_chunk_list_' will be initialized after [-Wreorder] ChunkList gpu_chunk_list_; ^ /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h:114:13: warning: 'turbo_transformers::core::allocator::ChunkList turbo_transformers::core::allocator::ModelAwareAllocator::cpu_chunk_list_' [-Wreorder] ChunkList cpu_chunk_list_; ^ /src/TurboTransformers/turbo_transformers/core/allocator/model_aware_allocator.h:34:12: warning: when initialized here [-Wreorder] explicit ModelAwareAllocator(const std::string& model_name) ^ [194/262] Building CXX object turbo_transformers/core/CMakeFiles/tt_core.dir/allocator/naive_allocator.cpp.o [195/262] Building CXX object turbo_transformers/core/CMakeFiles/tt_core_test.dir/device_context_test.cpp.o [196/262] Building CXX object turbo_transformers/core/CMakeFiles/tt_core_test.dir/enforce_test.cpp.o [197/262] Building CXX object turbo_transformers/core/CMakeFiles/tt_core_test.dir/tensor_test.cpp.o [198/262] Building CXX object turbo_transformers/core/CMakeFiles/catch2_test_main.dir/catch2_test_main.cpp.o [199/262] Building CUDA object turbo_transformers/layers/kernels/CMakeFiles/tt_kernels.dir/gpu_softmax_kernel.cu.o ninja: build stopped: subcommand failed. The command '/bin/sh -c mkdir -p /src && cd /src && git clone https://github.com/Tencent/TurboTransformers.git --recursive && cd ./TurboTransformers && sh ./tools/build_and_run_unittests.sh $PWD -DWITH_GPU=ON' returned a non-zero code: 1

mmmeee1111 commented 3 years ago

any idea to fix it? or do you have scripts to build this project in ubuntu env without docker?

feifeibear commented 3 years ago

ppopp21_artifact_centos see this branch. You can build it on CenteOS without docker.

mmmeee1111 commented 3 years ago

@feifeibear good to know. Does it work on Ubuntu? I am using Ubuntu.

feifeibear commented 3 years ago

You can adapt it to Ubuntu by yourself in minutes.

mmmeee1111 commented 3 years ago

Hi @feifeibear Do you know how to fix this error? Though I changed this line to my local cuda directory /usr/local/cuda-10.0.

`-- The CUDA compiler identification is unknown -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - failed -- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc -- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - broken CMake Error at /usr/local/share/cmake-3.20/Modules/CMakeTestCUDACompiler.cmake:52 (message): The CUDA compiler

"/usr/local/cuda/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /root/TurboTransformers/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_840c9/fast && /usr/bin/make  -f CMakeFiles/cmTC_840c9.dir/build.make CMakeFiles/cmTC_840c9.dir/build
make[1]: Entering directory '/root/TurboTransformers/build/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_840c9.dir/main.cu.o

`

feifeibear commented 3 years ago

It seems your cuda is not installed correctly?

mmmeee1111 commented 3 years ago

Hi @feifeibear, this is quite weird. In the doc, it says that we need gcc >= 7.5.0. But the error from cuda shows that gcc versions later than 7 are not supported!

Do you have any idea?



CMake Error at /usr/local/share/cmake-3.20/Modules/CMakeTestCUDACompiler.cmake:52 (message):
  The CUDA compiler

    /usr/local/cuda/bin/nvcc

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /root/TurboTransformers/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make -f Makefile cmTC_d5826/fast && /usr/bin/make  -f CMakeFiles/cmTC_d5826.dir/build.make CMakeFiles/cmTC_d5826.dir/build
    make[1]: Entering directory '/root/TurboTransformers/build/CMakeFiles/CMakeTmp'
    Building CUDA object CMakeFiles/cmTC_d5826.dir/main.cu.o
    /usr/local/cuda/bin/nvcc      -c /root/TurboTransformers/build/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_d5826.dir/main.cu.o
    In file included from /usr/local/cuda/bin/..//include/cuda_runtime.h:83,
                     from <command-line>:
    /usr/local/cuda/bin/..//include/crt/host_config.h:129:2: error: #error -- unsupported GNU version! gcc versions later than 7 are not supported!
     #error -- unsupported GNU version! gcc versions later than 7 are not supported!
      ^~~~~
    CMakeFiles/cmTC_d5826.dir/build.make:77: recipe for target 'CMakeFiles/cmTC_d5826.dir/main.cu.o' failed
    make[1]: *** [CMakeFiles/cmTC_d5826.dir/main.cu.o] Error 1
    make[1]: Leaving directory '/root/TurboTransformers/build/CMakeFiles/CMakeTmp'
    Makefile:127: recipe for target 'cmTC_d5826/fast' failed
    make: *** [cmTC_d5826/fast] Error 2
`
mmmeee1111 commented 3 years ago

Btw, Im using cuda 10.0.

(base) root@lab:~/TurboTransformers# nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2018 NVIDIA Corporation Built on Sat_Aug_25_21:08:01_CDT_2018 Cuda compilation tools, release 10.0, V10.0.130

mmmeee1111 commented 3 years ago

Hmmm. it seems I have to switch to cuda_10.2.

mmmeee1111 commented 3 years ago

Its working fine now!! Thanks for your contribution. @feifeibear

One more question, Can I try this project on new model such as Big-bird?

feifeibear commented 3 years ago

You may need some modification. As far as I knew, the transformer models for long sequences require some sparse attention kernels, which are not supported in this project.

mmmeee1111 commented 3 years ago

@feifeibear Thanks. Will take a look.