Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padlle源码编译错误,基于docker,with CINN #70728

Open
yanjianglu opened this issue Jan 9, 2025 · 5 comments
Open

Padlle源码编译错误,基于docker,with CINN #70728

yanjianglu opened this issue Jan 9, 2025 · 5 comments
Assignees
Labels
heco Hardware Ecosystem status/new-issue 新建 type/bug-report 报bug

Comments

@yanjianglu
Copy link

yanjianglu commented Jan 9, 2025

bug描述 Describe the Bug

曙光Z100平台,编译develop分支 附带CINN
CMAKE 指令

cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_FLAGS="-Wno-error -w" -DPY_VERSION=3.10 -DPYTHON_EXECUTABLE=`which python3` -DWITH_CUSTOM_DEVICE=OFF -DWITH_TESTING=OFF -DON_INFER=ON -DWITH_DISTRIBUTE=ON -DWITH_MKL=ON -DWITH_ROCM=ON -DWITH_RCCL=ON -DWITH_CINN=ON

其他补充信息 Additional Supplementary Information

问题1:在build目录下 编译中断后,再次执行make指令会出错

Automatic code generation for paddle/fluid/primitive
Automatic code generation for paddle/fluid/primitive succeed.
Automatic code generation for decomp interface succeed.
-- PYTHON_EXECUTABLE: /usr/local/bin/python3
-- Configuring done (310.8s)
CMake Error: Files to be generated by multiple different commands: "/root/Paddle/build/paddle/phi/CMakeFiles/phi_gpu.dir/kernels/gpu/phi_gpu_generated_abs_grad_kernel.cu.o.cmake"
-- Generating done (8.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
make: *** [Makefile:17474: cmake_check_build_system] Error 1

临时解决方案:手动删除CMakeCache.txt文件,重新cmake即可
希望得到更优雅的解决方案。

@yanjianglu
Copy link
Author

yanjianglu commented Jan 9, 2025

问题2:gelu_funcs.h文件编译不通过。

https://github.com/PaddlePaddle/Paddle/blob/84ab826e0f5404845a86b3d077099de7a182f744/paddle/phi/kernels/gpu/gelu_funcs.h#L109
出错信息

In file included from /root/Paddle/paddle/phi/kernels/fusion/gpu/fused_layernorm_kernel.cu:42:
In file included from /root/Paddle/paddle/phi/kernels/fusion/gpu/fused_dropout_helper.h:27:
In file included from /root/Paddle/paddle/phi/kernels/fusion/gpu/fused_bias_act_utils.h:27:
/root/Paddle/paddle/phi/kernels/gpu/gelu_funcs.h:109:20: error: no viable overloaded '='
      tmp_fp16_2.x = *reinterpret_cast<uint16_t*>(&x_in_arr[i]);
      ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:137:21: note: candidate function not viable: no known conversion from 'uint16_t' (aka 'unsigned short') to 'const __half' for 1st argument
            __half& operator=(const __half&) = default;
                    ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:139:21: note: candidate function not viable: no known conversion from 'uint16_t' (aka 'unsigned short') to '__half' for 1st argument
            __half& operator=(__half&&) = default;
                    ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:141:21: note: candidate function not viable: no known conversion from 'uint16_t' (aka 'unsigned short') to 'const __half_raw' for 1st argument
            __half& operator=(const __half_raw& x)
                    ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:147:30: note: candidate function not viable: no known conversion from 'uint16_t' (aka 'unsigned short') to 'const __half_raw' for 1st argument
            volatile __half& operator=(const __half_raw& x) volatile
                             ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:152:30: note: candidate function not viable: call to __host__ function from __global__ function
            volatile __half& operator=(const volatile __half_raw& x) volatile
                             ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:157:21: note: candidate function not viable: call to __host__ function from __global__ function
            __half& operator=(__half_raw&& x)
                    ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:162:30: note: candidate function not viable: call to __host__ function from __global__ function
            volatile __half& operator=(__half_raw&& x) volatile
                             ^
/opt/dtk-24.04.2/hip/include/hip/amd_detail/amd_hip_fp16.h:167:30: note: candidate function not viable: call to __host__ function from __global__ function
            volatile __half& operator=(volatile __half_raw&& x) volatile

出现error导致编译不过,大概猜测是因为类型不一致导致
将代码修改为

      tmp_fp16_2.x = *reinterpret_cast<__half*>(&x_in_arr[i]);
      tmp_fp16_2.y = *reinterpret_cast<__half*>(&y_g_in_arr[i]);

编译通过。请问这样改是否可以?

@onecatcn onecatcn added the heco Hardware Ecosystem label Jan 9, 2025
@yanjianglu
Copy link
Author

问题3 vectorize_loops.cc:769 这一行代码无法编译通过
https://github.com/PaddlePaddle/Paddle/blob/885318b1a7e9025bb8737c4deefe0f083a47df23/paddle/cinn/optim/vectorize_loops.cc#L769C5-L769C66
具体报错如下

In file included from /usr/include/c++/9/bits/move.h:55,
                 from /usr/include/c++/9/bits/nested_exception.h:40,
                 from /usr/include/c++/9/exception:144,
                 from /usr/include/c++/9/new:40,
                 from /root/Paddle/build/third_party/install/llvm/include/llvm/Support/Compiler.h:21,
                 from /root/Paddle/build/third_party/install/llvm/include/llvm/Support/ErrorHandling.h:17,
                 from /root/Paddle/build/third_party/install/llvm/include/llvm/ADT/Hashing.h:48,
                 from /root/Paddle/build/third_party/install/llvm/include/llvm/ADT/ArrayRef.h:12,
                 from /root/Paddle/paddle/cinn/ir/intrinsic_ops.h:17,
                 from /root/Paddle/paddle/cinn/ir/ir_mutator.h:20,
                 from /root/Paddle/paddle/cinn/optim/vectorize_loops.h:17,
                 from /root/Paddle/paddle/cinn/optim/vectorize_loops.cc:15:
/usr/include/c++/9/type_traits: In instantiation of ‘struct std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’:
/usr/include/c++/9/type_traits:150:27:   required from ‘constexpr const bool std::__and_v<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
/usr/include/c++/9/any:192:27:   required by substitution of ‘template<class _ValueType, class _Tp, class _Mgr, typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> > std::any::any(_ValueType&&) [with _ValueType = const std::tuple<const std::any&>&; _Tp = std::tuple<const std::any&>; _Mgr = std::any::_Manager_internal<std::tuple<const std::any&> >; typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> = <missing>]’
/usr/include/c++/9/type_traits:883:12:   required from ‘struct std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&>’
/usr/include/c++/9/type_traits:901:12:   required from ‘struct std::__is_copy_constructible_impl<std::tuple<const std::any&>, true>’
/usr/include/c++/9/type_traits:907:12:   required from ‘struct std::is_copy_constructible<std::tuple<const std::any&> >’
/usr/include/c++/9/type_traits:131:12:   [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/root/Paddle/build/third_party/install/absl/include/absl/container/flat_hash_map.h:577:58:   required by substitution of ‘template<class F, class ... Args> static decltype (absl::lts_20210324::container_internal::DecomposePair(declval<F>(), (declval<Args>)()...)) absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>::apply<F, Args ...>(F&&, Args&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Args = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/hash_policy_traits.h:169:27:   required by substitution of ‘template<class F, class ... Ts, class P> static decltype (P::apply(forward<F>(f), (forward<Ts>)(absl::lts_20210324::container_internal::hash_policy_traits::apply::ts)...)) absl::lts_20210324::container_internal::hash_policy_traits<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, void>::apply<F, Ts ..., P>(F&&, Ts&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Ts = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}; P = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1374:13:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&, size_t) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>; size_t = long unsigned int]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1386:37:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/common/info_registry.h:42:23:   required from ‘T& cinn::common::InfoRegistry::Get(const string&) [with T = int; std::string = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/optim/vectorize_loops.cc:769:62:   required from here
/usr/include/c++/9/type_traits:136:12: error: incomplete type ‘std::is_copy_constructible<std::tuple<const std::any&> >’ used in nested name specifier
  136 |     struct __and_<_B1, _B2, _B3, _Bn...>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/type_traits: In instantiation of ‘constexpr const bool std::__and_v<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’:
/usr/include/c++/9/any:192:27:   required by substitution of ‘template<class _ValueType, class _Tp, class _Mgr, typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> > std::any::any(_ValueType&&) [with _ValueType = const std::tuple<const std::any&>&; _Tp = std::tuple<const std::any&>; _Mgr = std::any::_Manager_internal<std::tuple<const std::any&> >; typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> = <missing>]’
/usr/include/c++/9/type_traits:883:12:   required from ‘struct std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&>’
/usr/include/c++/9/type_traits:901:12:   required from ‘struct std::__is_copy_constructible_impl<std::tuple<const std::any&>, true>’
/usr/include/c++/9/type_traits:907:12:   required from ‘struct std::is_copy_constructible<std::tuple<const std::any&> >’
/usr/include/c++/9/type_traits:131:12:   required from ‘struct std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&> >’
/usr/include/c++/9/any:181:58:   [ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/root/Paddle/build/third_party/install/absl/include/absl/container/flat_hash_map.h:577:58:   required by substitution of ‘template<class F, class ... Args> static decltype (absl::lts_20210324::container_internal::DecomposePair(declval<F>(), (declval<Args>)()...)) absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>::apply<F, Args ...>(F&&, Args&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Args = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/hash_policy_traits.h:169:27:   required by substitution of ‘template<class F, class ... Ts, class P> static decltype (P::apply(forward<F>(f), (forward<Ts>)(absl::lts_20210324::container_internal::hash_policy_traits::apply::ts)...)) absl::lts_20210324::container_internal::hash_policy_traits<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, void>::apply<F, Ts ..., P>(F&&, Ts&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Ts = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}; P = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1374:13:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&, size_t) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>; size_t = long unsigned int]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1386:37:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/common/info_registry.h:42:23:   required from ‘T& cinn::common::InfoRegistry::Get(const string&) [with T = int; std::string = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/optim/vectorize_loops.cc:769:62:   required from here
/usr/include/c++/9/type_traits:150:27: error: ‘value’ is not a member of ‘std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, const std::tuple<const std::any&>&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
  150 |     inline constexpr bool __and_v = __and_<_Bn...>::value;
      |                           ^~~~~~~
/usr/include/c++/9/type_traits: In instantiation of ‘struct std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >’:
/usr/include/c++/9/type_traits:131:12:   required from ‘struct std::__and_<std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
/usr/include/c++/9/type_traits:136:12:   required from ‘struct std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
/usr/include/c++/9/type_traits:150:27:   required from ‘constexpr const bool std::__and_v<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
/usr/include/c++/9/any:192:27:   required by substitution of ‘template<class _ValueType, class _Tp, class _Mgr, typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> > std::any::any(_ValueType&&) [with _ValueType = std::tuple<const std::any&>; _Tp = std::tuple<const std::any&>; _Mgr = std::any::_Manager_internal<std::tuple<const std::any&> >; typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> = <missing>]’
/usr/include/c++/9/type_traits:883:12:   required from ‘struct std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&>’
/usr/include/c++/9/type_traits:131:12:   [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/root/Paddle/build/third_party/install/absl/include/absl/container/flat_hash_map.h:577:58:   required by substitution of ‘template<class F, class ... Args> static decltype (absl::lts_20210324::container_internal::DecomposePair(declval<F>(), (declval<Args>)()...)) absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>::apply<F, Args ...>(F&&, Args&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Args = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/hash_policy_traits.h:169:27:   required by substitution of ‘template<class F, class ... Ts, class P> static decltype (P::apply(forward<F>(f), (forward<Ts>)(absl::lts_20210324::container_internal::hash_policy_traits::apply::ts)...)) absl::lts_20210324::container_internal::hash_policy_traits<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, void>::apply<F, Ts ..., P>(F&&, Ts&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Ts = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}; P = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1374:13:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&, size_t) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>; size_t = long unsigned int]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1386:37:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/common/info_registry.h:42:23:   required from ‘T& cinn::common::InfoRegistry::Get(const string&) [with T = int; std::string = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/optim/vectorize_loops.cc:769:62:   required from here
/usr/include/c++/9/type_traits:142:31: error: incomplete type ‘std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&>’ used in nested name specifier
  142 |     : public __bool_constant<!bool(_Pp::value)>
      |                               ^~~~~~~~~~~~~~~~
/usr/include/c++/9/type_traits: In instantiation of ‘struct std::__and_<std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’:
/usr/include/c++/9/type_traits:136:12:   required from ‘struct std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
/usr/include/c++/9/type_traits:150:27:   required from ‘constexpr const bool std::__and_v<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
/usr/include/c++/9/any:192:27:   required by substitution of ‘template<class _ValueType, class _Tp, class _Mgr, typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> > std::any::any(_ValueType&&) [with _ValueType = std::tuple<const std::any&>; _Tp = std::tuple<const std::any&>; _Mgr = std::any::_Manager_internal<std::tuple<const std::any&> >; typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> = <missing>]’
/usr/include/c++/9/type_traits:883:12:   required from ‘struct std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&>’
/usr/include/c++/9/type_traits:131:12:   required from ‘struct std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >’
/usr/include/c++/9/any:181:58:   [ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/root/Paddle/build/third_party/install/absl/include/absl/container/flat_hash_map.h:577:58:   required by substitution of ‘template<class F, class ... Args> static decltype (absl::lts_20210324::container_internal::DecomposePair(declval<F>(), (declval<Args>)()...)) absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>::apply<F, Args ...>(F&&, Args&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Args = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/hash_policy_traits.h:169:27:   required by substitution of ‘template<class F, class ... Ts, class P> static decltype (P::apply(forward<F>(f), (forward<Ts>)(absl::lts_20210324::container_internal::hash_policy_traits::apply::ts)...)) absl::lts_20210324::container_internal::hash_policy_traits<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, void>::apply<F, Ts ..., P>(F&&, Ts&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Ts = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}; P = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1374:13:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&, size_t) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>; size_t = long unsigned int]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1386:37:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/common/info_registry.h:42:23:   required from ‘T& cinn::common::InfoRegistry::Get(const string&) [with T = int; std::string = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/optim/vectorize_loops.cc:769:62:   required from here
/usr/include/c++/9/type_traits:131:12: error: ‘value’ is not a member of ‘std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >’
  131 |     struct __and_<_B1, _B2>
      |            ^~~~~~~~~~~~~~~~
/usr/include/c++/9/type_traits: In instantiation of ‘constexpr const bool std::__and_v<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’:
/usr/include/c++/9/any:192:27:   required by substitution of ‘template<class _ValueType, class _Tp, class _Mgr, typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> > std::any::any(_ValueType&&) [with _ValueType = std::tuple<const std::any&>; _Tp = std::tuple<const std::any&>; _Mgr = std::any::_Manager_internal<std::tuple<const std::any&> >; typename std::enable_if<__and_v<std::is_copy_constructible<_Tp>, std::__not_<std::is_constructible<_Tp, _ValueType&&> >, std::__not_<std::__is_in_place_type<_Tp> > >, bool>::type <anonymous> = <missing>]’
/usr/include/c++/9/type_traits:883:12:   required from ‘struct std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&>’
/usr/include/c++/9/type_traits:131:12:   required from ‘struct std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >’
/usr/include/c++/9/any:181:58:   required by substitution of ‘template<class _ValueType, class _Tp, class _Mgr, typename std::enable_if<std::__and_<std::is_copy_constructible<_Tp>, std::is_constructible<_Tp, _ValueType&&> >::value, bool>::type <anonymous>, typename std::enable_if<(! std::__is_in_place_type<_Tp>::value), bool>::type <anonymous> > std::any::any(_ValueType&&) [with _ValueType = std::tuple<const std::any&>; _Tp = std::tuple<const std::any&>; _Mgr = std::any::_Manager_internal<std::tuple<const std::any&> >; typename std::enable_if<std::__and_<std::is_copy_constructible<_Tp>, std::is_constructible<_Tp, _ValueType&&> >::value, bool>::type <anonymous> = <missing>; typename std::enable_if<(! std::__is_in_place_type<_Tp>::value), bool>::type <anonymous> = <missing>]’
/usr/include/c++/9/bits/stl_pair.h:208:12:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/root/Paddle/build/third_party/install/absl/include/absl/container/flat_hash_map.h:577:58:   required by substitution of ‘template<class F, class ... Args> static decltype (absl::lts_20210324::container_internal::DecomposePair(declval<F>(), (declval<Args>)()...)) absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>::apply<F, Args ...>(F&&, Args&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Args = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/hash_policy_traits.h:169:27:   required by substitution of ‘template<class F, class ... Ts, class P> static decltype (P::apply(forward<F>(f), (forward<Ts>)(absl::lts_20210324::container_internal::hash_policy_traits::apply::ts)...)) absl::lts_20210324::container_internal::hash_policy_traits<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, void>::apply<F, Ts ..., P>(F&&, Ts&& ...) [with F = absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>, absl::lts_20210324::container_internal::StringHash, absl::lts_20210324::container_internal::StringHashEq::Eq, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> > >::EqualElement<std::__cxx11::basic_string<char> >; Ts = {std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::any>&}; P = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1374:13:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&, size_t) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>; size_t = long unsigned int]’
/root/Paddle/build/third_party/install/absl/include/absl/container/internal/raw_hash_set.h:1386:37:   required from ‘absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::iterator absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::find(absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K>&) [with K = std::__cxx11::basic_string<char>; Policy = absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char>, std::any>; Hash = absl::lts_20210324::container_internal::StringHash; Eq = absl::lts_20210324::container_internal::StringHashEq::Eq; Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::any> >; absl::lts_20210324::container_internal::raw_hash_set<Policy, Hash, Eq, Alloc>::key_arg<K> = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/common/info_registry.h:42:23:   required from ‘T& cinn::common::InfoRegistry::Get(const string&) [with T = int; std::string = std::__cxx11::basic_string<char>]’
/root/Paddle/paddle/cinn/optim/vectorize_loops.cc:769:62:   required from here
/usr/include/c++/9/type_traits:150:27: error: ‘value’ is not a member of ‘std::__and_<std::is_copy_constructible<std::tuple<const std::any&> >, std::__not_<std::is_constructible<std::tuple<const std::any&>, std::tuple<const std::any&>&&> >, std::__not_<std::__is_in_place_type<std::tuple<const std::any&> > > >’
  150 |     inline constexpr bool __and_v = __and_<_Bn...>::value;
      | 

临时解决方案:暂时注释掉这一行了

@yanjianglu
Copy link
Author

问题4 编译eager_generator 链接的时候出错
错误信息

[ 96%] Built target eager_reducer
[ 96%] Building CXX object paddle/fluid/pybind/CMakeFiles/eager_generator.dir/eager_legacy_op_function_generator.cc.o
[ 96%] Building CXX object paddle/fluid/pybind/CMakeFiles/eager_generator.dir/generator.cc.o
[ 96%] Building CXX object paddle/fluid/pybind/CMakeFiles/eager_generator.dir/eager_generator.cc.o
[ 96%] Linking CXX executable eager_generator
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_Py_Dealloc'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThread_tss_free'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyByteArray_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyType_IsSubtype'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyBytes_FromString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyConfig_InitPythonConfig'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_HasAttrString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyByteArray_Size'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_Clear'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_Xor'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_Long'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyFloat_FromDouble'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PySet_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_Restore'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThread_tss_alloc'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_AsEncodedString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_Occurred'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_FromFormat'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_OverflowError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCMethod_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyException_SetContext'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_SetString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyEval_AcquireThread'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyList_Append'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyType_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThreadState_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_NormalizeException'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_DecodeLatin1'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_IndexError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyFrame_GetBack'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyEval_SaveThread'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_GC_UnTrack'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PySequence_Check'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyException_SetCause'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyModule_GetName'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyInstanceMethod_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_SetAttrString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_Fetch'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyEval_RestoreThread'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_Copy'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_Size'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_MemoryError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_Check'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyModule_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_PyType_Lookup'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCallable_Check'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyStatus_IsError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyMem_Calloc'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PySequence_Size'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyTuple_GetItem'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_Malloc'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyConfig_SetBytesArgv'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyLong_FromSize_t'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyBytes_AsStringAndSize'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyTuple_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PySequence_Tuple'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyWeakref_NewRef'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_AsUTF8String'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_And'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThread_tss_set'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyList_GetItem'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_GenericSetDict'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyMem_Free'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyProperty_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_ClearWeakRefs'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_Repr'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_GetPointer'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyInstanceMethod_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyConfig_Clear'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_RichCompareBool'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_Py_NotImplementedStruct'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_GetItem'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_SystemError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_SetItem'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyFloat_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyFrame_GetCode'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyList_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_SetAttr'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyStatus_Exception'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyLong_FromSsize_t'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyException_SetTraceback'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_PyThreadState_UncheckedGet'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyStaticMethod_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_FromString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyBaseObject_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThreadState_Clear'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyBuffer_Release'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_Or'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyTuple_SetItem'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyMethod_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyImport_AddModule'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_CallFunctionObjArgs'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyEval_GetBuiltins'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_BufferError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyGILState_Ensure'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_Invert'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThreadState_Get'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyFrame_GetLineNumber'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_Py_NoneStruct'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_SetPointer'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyModule_AddObject'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `Py_Finalize'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PySet_Add'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_Contains'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyLong_AsLong'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_Py_TrueStruct'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyFloat_AsDouble'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_SetContext'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `Py_IsInitialized'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_GetItemWithError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_Format'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_Str'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyStaticMethod_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyByteArray_AsString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyIndex_Check'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_DelItemString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyLong_FromLong'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_DecodeUTF8'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyErr_WriteUnraisable'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThread_tss_create'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyBytes_AsString'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_GetContext'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyBytes_Size'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyLong_AsUnsignedLong'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyRun_SimpleStringFlags'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_TypeError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyType_Ready'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThread_tss_get'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyGILState_GetThisThreadState'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_GetAttr'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyList_Size'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCFunction_Type'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyThreadState_DeleteCurrent'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyExc_ValueError'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyImport_ImportModule'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyCapsule_GetName'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `_Py_FalseStruct'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `Py_InitializeFromConfig'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_CallObject'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_IsInstance'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_Next'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyDict_New'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyGILState_Release'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PySequence_GetItem'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyNumber_Float'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyUnicode_AsUTF8AndSize'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyObject_GenericGetDict'
/usr/bin/ld: ../../../libcinnapi.so: undefined reference to `PyTuple_Size'
collect2: error: ld returned 1 exit status

libcinnapi.so 加载python动态库失败

临时解决方案
修改cmake/cinn.cmake
target_link_libraries(cinnapi op_dialect pir phi ${PYTHON_LIBRARIES})

@yanjianglu
Copy link
Author

通过临时方案修改,能够顺利的编译完成。
请给位大佬看看,这些问题该如何修改?或者是我自身环境导致的

@yongqiangma
Copy link
Contributor

CINN的优化技术可以支持所有类CUDA平台的优化,但是我们暂时还未进行DCU上的相关测试和使能工作,后续我们会进行相关feature的支持。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heco Hardware Ecosystem status/new-issue 新建 type/bug-report 报bug
Projects
None yet
Development

No branches or pull requests

4 participants