Parallel.Do does not support sparse gradients
Created by: reyoung
Sample code is here, setting the with_parallel_do=True
and sparse_update=True
can reproduce this problem.
Error stacks are:
Traceback (most recent call last):
File "/Volumes/unamed/.proj/ChineseWordVectors/cbow_fluid.py", line 83, in <module>
main(window_size=5, batch_size=2048, with_parallel_do=True, sparse_update=True)
File "/Volumes/unamed/.proj/ChineseWordVectors/cbow_fluid.py", line 76, in main
avg_loss_np = exe.run(feed=feeder.feed(data), fetch_list=[avg_loss])
File "/usr/local/lib/python2.7/site-packages/paddle/v2/fluid/executor.py", line 178, in run
self.executor.run(program.desc, scope, 0, True, True)
paddle.v2.fluid.core.EnforceNotMet: Variable must be type N6paddle9framework9LoDTensorE, the holding type is N6paddle9framework12SelectedRowsE at [/Users/baidu/Downloads/.proj/Paddle/paddle/framework/variable.h:32]
PaddlePaddle Call Stacks:
0 0x119d19c18p paddle::platform::EnforceNotMet::EnforceNotMet(std::exception_ptr, char const*, int) + 1976
1 0x119d0ae43p paddle::platform::EnforceNotMet::EnforceNotMet(std::exception_ptr, char const*, int) + 35
2 0x11a949d4bp paddle::framework::LoDTensor const& paddle::framework::Variable::Get<paddle::framework::LoDTensor>() const + 635
3 0x11a8d6566p paddle::operators::ParallelDoGradOp::Run(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace> const&) const + 4278
4 0x119f15c78p paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) + 5880
5 0x119df05e2p pybind11::cpp_function::cpp_function<void, paddle::framework::Executor, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, pybind11::name, pybind11::is_method, pybind11::sibling>(void (paddle::framework::Executor::*)(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::'lambda'(paddle::framework::Executor*, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool)::operator()(paddle::framework::Executor*, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) const + 194
6 0x119df0508p pybind11::detail::argument_loader<paddle::framework::Executor*, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool>::call_impl<void, pybind11::cpp_function::cpp_function<void, paddle::framework::Executor, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, pybind11::name, pybind11::is_method, pybind11::sibling>(void (paddle::framework::Executor::*)(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::'lambda'(paddle::framework::Executor*, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool)&, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul>(void, paddle::framework::Executor&&, pybind11::detail::index_sequence<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>) + 376
7 0x119def785p pybind11::detail::argument_loader<paddle::framework::Executor*, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool>::call<void, pybind11::cpp_function::cpp_function<void, paddle::framework::Executor, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, pybind11::name, pybind11::is_method, pybind11::sibling>(void (paddle::framework::Executor::*)(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::'lambda'(paddle::framework::Executor*, paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool)&>(std::__1::enable_if<std::is_void<void>::value, pybind11::detail::void_type>::type, paddle::framework::Executor&&) + 37
8 0x119def67bp _ZZN8pybind1112cpp_function10initializeIZNS0_C1IvN6paddle9framework8ExecutorEJRKNS4_11ProgramDescEPNS4_5ScopeEibbEJNS_4nameENS_9is_methodENS_7siblingEEEEMT0_FT_DpT1_EDpRKT2_EUlPS5_S8_SA_ibbE_vJSO_S8_SA_ibbEJSB_SC_SD_EEEvOSF_PFSE_SH_ESN_ENKUlRNS_6detail13function_callEE_clESV_ + 235
9 0x119def578p _ZZN8pybind1112cpp_function10initializeIZNS0_C1IvN6paddle9framework8ExecutorEJRKNS4_11ProgramDescEPNS4_5ScopeEibbEJNS_4nameENS_9is_methodENS_7siblingEEEEMT0_FT_DpT1_EDpRKT2_EUlPS5_S8_SA_ibbE_vJSO_S8_SA_ibbEJSB_SC_SD_EEEvOSF_PFSE_SH_ESN_ENUlRNS_6detail13function_callEE_8__invokeESV_ + 24
10 0x119d60d6ep pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 5838
11 0x10d1f29a3p PyEval_EvalFrameEx + 27247
12 0x10d1ebd3ep PyEval_EvalCodeEx + 1617
13 0x10d1f645ep fast_function + 117
14 0x10d1f278fp PyEval_EvalFrameEx + 26715
15 0x10d1ebd3ep PyEval_EvalCodeEx + 1617
16 0x10d1f645ep fast_function + 117
17 0x10d1f278fp PyEval_EvalFrameEx + 26715
18 0x10d1ebd3ep PyEval_EvalCodeEx + 1617
19 0x10d1eb6e7p PyEval_EvalCode + 48
20 0x10d20f068p run_mod + 53
21 0x10d20f10bp PyRun_FileExFlags + 133
22 0x10d20ec5cp PyRun_SimpleFileExFlags + 702
23 0x10d220442p Py_Main + 3094
24 0x7fff72d32115p start + 1