Skip to content

Build error with PyTorch 1.6.0 #37

@roastduck

Description

@roastduck

When building with PyTorch 1.6.0, the following error occurs.

In file included from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction_impl.h:2,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction.h:226,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/DispatchTable.h:9,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/OperatorEntry.h:3,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:3,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/method.h:5,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/object.h:5,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/script.h:3,
                 from /home/rd/src/triton/python/src/launch.cc:8:
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h: In instantiation of ‘typename c10::guts::infer_function_traits<Functor>::type::return_type c10::impl::call_functor_with_args_from_stack_(Functor*, c10::Stack*, std::index_sequence<INDEX ...>) [with Functor = c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<long int (*)(at::Tensor&, long int), long int, c10::guts::typelist::typelist<at::Tensor&, long int> >; bool AllowDeprecatedTypes = true; long unsigned int ...ivalue_arg_indices = {0, 1}; typename c10::guts::infer_function_traits<Functor>::type::return_type = long int; c10::Stack = std::vector<c10::IValue>; std::index_sequence<INDEX ...> = std::integer_sequence<long unsigned int, 0, 1>]’:
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:250:77:   required from ‘typename c10::guts::infer_function_traits<Functor>::type::return_type c10::impl::call_functor_with_args_from_stack(Functor*, c10::Stack*) [with Functor = c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<long int (*)(at::Tensor&, long int), long int, c10::guts::typelist::typelist<at::Tensor&, long int> >; bool AllowDeprecatedTypes = true; typename c10::guts::infer_function_traits<Functor>::type::return_type = long int; c10::Stack = std::vector<c10::IValue>]’
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:292:79:   required from ‘static void c10::impl::make_boxed_from_unboxed_functor<KernelFunctor, AllowDeprecatedTypes>::call(c10::OperatorKernel*, const c10::OperatorHandle&, c10::Stack*) [with KernelFunctor = c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<long int (*)(at::Tensor&, long int), long int, c10::guts::typelist::typelist<at::Tensor&, long int> >; bool AllowDeprecatedTypes = true; c10::Stack = std::vector<c10::IValue>]’
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction_impl.h:87:9:   required from ‘static c10::KernelFunction c10::KernelFunction::makeFromUnboxedFunctor(std::unique_ptr<c10::OperatorKernel>) [with bool AllowLegacyTypes = true; KernelFunctor = c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<long int (*)(at::Tensor&, long int), long int, c10::guts::typelist::typelist<at::Tensor&, long int> >]’
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction_impl.h:137:114:   required from ‘static c10::KernelFunction c10::KernelFunction::makeFromUnboxedRuntimeFunction(FuncType*) [with bool AllowLegacyTypes = true; FuncType = long int(at::Tensor&, long int)]’
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/op_registration/op_registration.h:549:72:   required from ‘std::enable_if_t<(c10::guts::is_function_type<T>::value && (! std::is_same<FuncType, void(const c10::OperatorHandle&, std::vector<c10::IValue>*)>::value)), c10::RegisterOperators&&> c10::RegisterOperators::op(const string&, FuncType*, c10::RegisterOperators::Options&&) && [with FuncType = long int(at::Tensor&, long int); std::enable_if_t<(c10::guts::is_function_type<T>::value && (! std::is_same<FuncType, void(const c10::OperatorHandle&, std::vector<c10::IValue>*)>::value)), c10::RegisterOperators&&> = c10::RegisterOperators&&; std::string = std::basic_string<char>]’
/home/rd/src/triton/python/src/launch.cc:50:57:   required from here
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:242:22: error: no match for call to ‘(c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<long int (*)(at::Tensor&, long int), long int, c10::guts::typelist::typelist<at::Tensor&, long int> >) (at::Tensor, long int)’
     return (*functor)(ivalue_to_arg<std::remove_cv_t<std::remove_reference_t<guts::typelist::element_t<ivalue_arg_indices, IValueArgTypes>>>, AllowDeprecatedTypes>::call(
            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       std::move(torch::jit::peek(*stack, ivalue_arg_indices, num_ivalue_args))
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     )...);
     ~~~~~
In file included from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction_impl.h:4,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction.h:226,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/DispatchTable.h:9,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/OperatorEntry.h:3,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:3,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/method.h:5,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/object.h:5,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/script.h:3,
                 from /home/rd/src/triton/python/src/launch.cc:8:
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/WrapFunctionIntoRuntimeFunctor.h:17:22: note: candidate: ‘decltype(auto) c10::impl::detail::WrapFunctionIntoRuntimeFunctor_<FuncType, ReturnType, c10::guts::typelist::typelist<Tail ...> >::operator()(Parameters ...) [with FuncType = long int (*)(at::Tensor&, long int); ReturnType = long int; Parameters = {at::Tensor&, long int}]’ <near match>
       decltype(auto) operator()(Parameters... args) {
                      ^~~~~~~~
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/WrapFunctionIntoRuntimeFunctor.h:17:22: note:   conversion of argument 1 would be ill-formed:
In file included from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction_impl.h:2,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/KernelFunction.h:226,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/DispatchTable.h:9,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/OperatorEntry.h:3,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/dispatch/Dispatcher.h:3,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/method.h:5,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/api/object.h:5,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/rd/.local/lib/python3.7/site-packages/torch/include/torch/script.h:3,
                 from /home/rd/src/triton/python/src/launch.cc:8:
/home/rd/.local/lib/python3.7/site-packages/torch/include/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:242:22: error: cannot bind non-const lvalue reference of type ‘at::Tensor&’ to an rvalue of type ‘at::Tensor’
     return (*functor)(ivalue_to_arg<std::remove_cv_t<std::remove_reference_t<guts::typelist::element_t<ivalue_arg_indices, IValueArgTypes>>>, AllowDeprecatedTypes>::call(
            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       std::move(torch::jit::peek(*stack, ivalue_arg_indices, num_ivalue_args))
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     )...);
     ~~~~~

Upgrading to PyTorch 1.7.0 solves the problem. However, PyTorch 1.7.0 seems not working with torch-blocksparse (#32).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions