Pytorch RNN CPU Issue

最近工作上在做搭建机器学习平台的相关工作,使用的是MLflow;但是线上的Data Scientist在使用Pytorch的时候遇到了问题,下面做个记录…

现象

MLflow在部署使用Pytorch RNN训练的模型的时候,无法正常启动,内部的gunicorn的work无限重启,同时dump thread stack和heap到core文件,一度造成线上GFS run out of space…

由于我们的service是跑在k8s的Pod内的,最神奇的是一部分pod可以启动无问题,一部分不行…

解决问题

既然手里有core dump文件,那就分析,使用的是gdb,打开core文件后见到如下错误:

[New LWP 470]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/opt/conda/bin/python /opt/conda/bin/gunicorn --timeout 60 -b 0.0.0.0:5000 -w 4'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00007fc6db828ffa in Xbyak::Operand::Operand(int, Xbyak::Operand::Kind, int, bool) () from /opt/conda/lib/python3.6/site-packages/torch/lib/libcaffe2.so
(gdb) where
#0  0x00007fc6db828ffa in Xbyak::Operand::Operand(int, Xbyak::Operand::Kind, int, bool) () from /opt/conda/lib/python3.6/site-packages/torch/lib/libcaffe2.so
#1  0x00007fc6d9bb0877 in _GLOBAL__sub_I_verbose.cpp () from /opt/conda/lib/python3.6/site-packages/torch/lib/libcaffe2.so
#2  0x00007fc71d91879a in call_init (l=<optimized out>, argc=argc@entry=9, argv=argv@entry=0x7ffc9bc85ad8, env=env@entry=0x55bfa73c4d20) at dl-init.c:72

能看出来是Python和Pytorch的问题,google搜了下,很多人遇到过这个问题

which is caused by the CPU architecture

cat /proc/cpuinfo | grep flag

compared and reference from same-issue-from-github, comfired that, that model works well on CPU AVX2

解决办法

upgrade pytorch to 1.2.0 to fix the issue

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值