harvardnlp / genbmm

CUDA kernels for generalized matrix-multiplication in PyTorch
79 stars 13 forks source link

Run into errors when building wheel for genbmm #11

Closed haozheji closed 3 years ago

haozheji commented 3 years ago

Hi! I am wondering what is the right way to build from source? Simply pip install . throws too many errors during compilation. I have installed the dependencies following the setup.sh.

srush commented 3 years ago

Can you paste the errors you are getting?

haozheji commented 3 years ago

I only paste part of the errors. Do you have any idea?

     /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::tuple&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pybind11.h:1812:39:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2108:44: error: no matching function for call to ‘collect_arguments(pybind11::tuple&)’
         return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                                ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pybind11.h:1830:11:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2108:44: error: no matching function for call to ‘collect_arguments(pybind11::object&)’
         return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                                ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pybind11.h:1831:64:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2108:44: error: no matching function for call to ‘collect_arguments(pybind11::object)’
         return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                                ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {const char* const&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pytypes.h:1375:35:   required from ‘bool pybind11::detail::object_api<Derived>::contains(T&&) const [with T = const char* const&; Derived = pybind11::handle]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/detail/internals.h:176:25:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2108:44: error: no matching function for call to ‘collect_arguments(const char* const&)’
         return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                                ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘int pybind11::cast(pybind11::object&&) [with T = std::basic_string<char>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:1717:68:   required from ‘T pybind11::object::cast() && [with T = std::basic_string<char>]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/detail/class.h:537:138:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:1713:24: error: cannot convert ‘std::basic_string<char>’ to ‘int’ in return
         return cast<T>(object);
                            ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::handle&, pybind11::handle&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pytypes.h:923:28:   required from ‘pybind11::str pybind11::str::format(Args&& ...) const [with Args = {pybind11::handle&, pybind11::handle&}]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pybind11.h:755:72:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2108:44: error: no matching function for call to ‘collect_arguments(pybind11::handle&, pybind11::handle&)’
         return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                                ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h: In instantiation of ‘pybind11::object pybind11::detail::object_api<Derived>::operator()(Args&& ...) const [with pybind11::return_value_policy policy = (pybind11::return_value_policy)1u; Args = {pybind11::object&, const pybind11::handle&}; Derived = pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pytypes.h:923:28:   required from ‘pybind11::str pybind11::str::format(Args&& ...) const [with Args = {pybind11::object&, const pybind11::handle&}]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/pybind11.h:1401:51:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2108:44: error: no matching function for call to ‘collect_arguments(pybind11::object&, const pybind11::handle&)’
         return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
                                                ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::simple_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     simple_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2087:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note: candidate: template<pybind11::return_value_policy policy, class ... Args, class> pybind11::detail::unpacking_collector<policy> pybind11::detail::collect_arguments(Args&& ...)
     unpacking_collector<policy> collect_arguments(Args &&...args) {
     ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/pybind11/cast.h:2094:1: note:   template argument deduction/substitution failed:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 3ul; Derived = torch::nn::ConvTranspose3dImpl]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:62:17:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 3ul; Derived = torch::nn::ConvTranspose3dImpl]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:48:48:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kFanIn’ from ‘const torch::enumtype::kFanIn’ to ‘torch::nn::init::FanModeType {aka c10::variant<torch::enumtype::kFanIn, torch::enumtype::kFanOut>}’
         init::kaiming_uniform_(weight, /*a=*/std::sqrt(5));  // NOLINT(cppcoreguidelines-avoid-magic-numbers)
                           ^
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 2ul; Derived = torch::nn::ConvTranspose2dImpl]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:62:17:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 2ul; Derived = torch::nn::ConvTranspose2dImpl]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:48:48:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kFanIn’ from ‘const torch::enumtype::kFanIn’ to ‘torch::nn::init::FanModeType {aka c10::variant<torch::enumtype::kFanIn, torch::enumtype::kFanOut>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 1ul; Derived = torch::nn::ConvTranspose1dImpl]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:62:17:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 1ul; Derived = torch::nn::ConvTranspose1dImpl]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:48:48:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kFanIn’ from ‘const torch::enumtype::kFanIn’ to ‘torch::nn::init::FanModeType {aka c10::variant<torch::enumtype::kFanIn, torch::enumtype::kFanOut>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 3ul; Derived = torch::nn::Conv3dImpl]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:62:17:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 3ul; Derived = torch::nn::Conv3dImpl]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:48:48:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kFanIn’ from ‘const torch::enumtype::kFanIn’ to ‘torch::nn::init::FanModeType {aka c10::variant<torch::enumtype::kFanIn, torch::enumtype::kFanOut>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 2ul; Derived = torch::nn::Conv2dImpl]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:62:17:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 2ul; Derived = torch::nn::Conv2dImpl]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:48:48:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kFanIn’ from ‘const torch::enumtype::kFanIn’ to ‘torch::nn::init::FanModeType {aka c10::variant<torch::enumtype::kFanIn, torch::enumtype::kFanOut>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 1ul; Derived = torch::nn::Conv1dImpl]’:
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:62:17:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 1ul; Derived = torch::nn::Conv1dImpl]’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:48:48:   required from here
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kFanIn’ from ‘const torch::enumtype::kFanIn’ to ‘torch::nn::init::FanModeType {aka c10::variant<torch::enumtype::kFanIn, torch::enumtype::kFanOut>}’
    /home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:66:23: error: could not convert ‘torch::kLeakyReLU’ from ‘const torch::enumtype::kLeakyReLU’ to ‘torch::nn::init::NonlinearityType {aka c10::variant<torch::enumtype::kLinear, torch::enumtype::kConv1D, torch::enumtype::kConv2D, torch::enumtype::kConv3D, torch::enumtype::kConvTranspose1D, torch::enumtype::kConvTranspose2D, torch::enumtype::kConvTranspose3D, torch::enumtype::kSigmoid, torch::enumtype::kTanh, torch::enumtype::kReLU, torch::enumtype::kLeakyReLU>}’
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1515, in _run_ninja_build
        env=env)
      File "/home/jihaozhe/anaconda3/lib/python3.7/subprocess.py", line 487, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-oqm5nnvv/setup.py", line 26, in <module>
        'build_ext': BuildExtension
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
        _build_ext.build_ext.run(self)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 649, in build_extensions
        build_ext.build_extensions(self)
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
        self.build_extension(ext)
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 199, in build_extension
        _build_ext.build_extension(self, ext)
      File "/home/jihaozhe/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 478, in unix_wrap_ninja_compile
        with_cuda=with_cuda)
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1233, in _write_ninja_file_and_compile_objects
        error_prefix='Error compiling objects for extension')
      File "/home/jihaozhe/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1529, in _run_ninja_build
        raise RuntimeError(message)
    RuntimeError: Error compiling objects for extension
    ----------------------------------------
ERROR: Command "/home/jihaozhe/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-oqm5nnvv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1d0dnjhl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-oqm5nnvv/
haozheji commented 3 years ago

I follow this tutorial https://pytorch.org/tutorials/advanced/cpp_extension.html and use python setup.py install to build _genbmm. I got a new error: RuntimeError: Error compiling objects for extension.

My gcc version is 5.4.0, pytorch version 1.6.0, CUDA version 10.1

haozheji commented 3 years ago

I relink the CUDA_HOME variable to the correct version of the cuda toolkit /usr/local/cuda-xx and the problem is resolved