首页 Paddle框架 帖子详情
test_layers fails on LayerNorm
收藏
快速回复
Paddle框架 问答深度学习 738 2
test_layers fails on LayerNorm
收藏
快速回复
Paddle框架 问答深度学习 738 2

Error

625:       strings: "  File \"/opt/python/cp27-cp27mu/lib/python2.7/unittest/suite.py\", line 108, in run\n    test(result)\n"
625:       strings: "  File \"/opt/python/cp27-cp27mu/lib/pythWARNING:root:param_attr are only avaliable with scale is True
625: WARNING:root:bias_attr are only avaliable with shift is True
625: W1106 08:31:12.824010  8561 init.cc:205] *** Aborted at 1573029072 (unix time) try "date -d @1573029072" if you are using GNU date ***
625: W1106 08:31:12.825037  8561 init.cc:205] PC: @                0x0 (unknown)
625: W1106 08:31:12.825136  8561 init.cc:205] *** SIGSEGV (@0x68) received by PID 8561 (TID 0x7f360eb44700) from PID 104; stack trace: ***
625: W1106 08:31:12.825951  8561 init.cc:205]     @     0x7f360e3167e0 (unknown)
625: W1106 08:31:12.826431  8561 init.cc:205]     @     0x7f35bffd1344 paddle::framework::product()
625: W1106 08:31:12.827142  8561 init.cc:205]     @     0x7f35bec53a0a paddle::operators::LayerNormKernel<>::Compute()
625: W1106 08:31:12.828384  8561 init.cc:205]     @     0x7f35bec54573 _ZNSt17_Function_handlerIFvRKN6paddle9framework16ExecutionContextEEZNKS1_24OpKernelRegistrarFunctorINS0_8platform8CPUPlaceELb0ELm0EINS0_9operators15LayerNormKernelINS7_16CPUDeviceContextEfEENSA_ISB_dEEEEclEPKcSG_iEUlS4_E_E9_M_invokeERKSt9_Any_dataS4_
625: W1106 08:31:12.829479  8561 init.cc:205]     @     0x7f35bff6db99 paddle::imperative::PreparedOp::Run()
625: W1106 08:31:12.830082  8561 init.cc:205]     @     0x7f35beb59a17 paddle::imperative::OpBase::Run()
625: W1106 08:31:12.830565  8561 init.cc:205]     @     0x7f35beb611a3 paddle::imperative::Tracer::TraceOp()
625: W1106 08:31:12.830658  8561 init.cc:205]     @     0x7f35bea4b08d _ZZN8pybind1112cpp_function10initializeIZN6paddle6pybind14BindImperativeEPNS_6moduleEEUlRNS2_10imperative6TracerERKSsRKSt13unordered_mapISsNS_6handleESt4hashISsESt8equal_toISsESaISt4pairIS9_SC_EEESM_SB_ISsN5boost7variantINSN_5blankEifSsSt6vectorIiSaIiEESQ_IfSaIfEESQ_ISsSaISsEEbSQ_IbSaIbEEPNS2_9framework9BlockDescElSQ_IS11_SaIS11_EESQ_IlSaIlEENSN_6detail7variant5void_ES18_S18_S18_S18_S18_S18_EESE_SG_SaISH_IS9_S19_EEERKNS2_8platform8CPUPlaceEbE19_vIS8_SA_SM_SM_S1C_S1G_bEINS_4nameENS_9is_methodENS_7siblingEEEEvOT_PFT0_DpT1_EDpRKT2_ENUlRNS_6detail13function_callEE1_4_FUNES1Y_
625: W1106 08:31:12.830986  8561 init.cc:205]     @     0x7f35be97e501 pybind11::cpp_function::dispatcher()

How to reproduce

  • Machine: Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz or Intel(R) Xeon(R) CPU E5-2620 v3
    • I test it on CI machine and . It works well.
  • CMake: cmake .. -DWITH_GPU=OFF -DWITH_MKLDNN=ON -DCMAKE_BUILD_TYPE=Release -DWITH_TESTING=ON
  • command: ctest -R test_layers -V
  • Develop branch, commitid: a710ccc
0
收藏
回复
全部评论(2)
时间顺序
AIStudio785465
#2 回复于2019-11
@bingyanghuang @yihuaxu

能不能帮忙看下?是否和LayerNorm的优化有关系

0
回复
AIStudio791177
#3 回复于2019-11
@bingyanghuang @yihuaxu

能不能帮忙看下?是否和LayerNorm的优化有关系

从log上来看,可能是由于LayerNormKernel::Compute()会调用Tensor::numel()函数出的错。

625: W1106 08:31:12.826431  8561 init.cc:205]     @     0x7f35bffd1344 paddle::framework::product()
625: W1106 08:31:12.827142  8561 init.cc:205]     @     0x7f35bec53a0a paddle::operators::LayerNormKernel<>::Compute() 

int64_t Tensor::numel() const { return product(dims_); }

PADDLE_ENFORCE_EQ(mean->numel(), left);
PADDLE_ENFORCE_EQ(var->numel(), left);
PADDLE_ENFORCE_EQ(scale->numel(), right);
PADDLE_ENFORCE_EQ(bias->numel(), right);

Debug后发现当scale或是bias为空时会出现问题

(gdb) p scale
$1 = (const paddle::framework::Tensor *) 0x0
(gdb) p var
$2 = (paddle::framework::Tensor *) 0x268a9b8
(gdb) p bias
$3 = (const paddle::framework::Tensor *) 0x0
(gdb) p mean
$4 = (paddle::framework::Tensor *) 0x25e3bd8
0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户