-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support more dim for mul op npu #34546
support more dim for mul op npu #34546
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请补充单测通过的截图、并使用GLOG_vmodule=operator=4 ctest -R test_mul_op_npu -VV
给出NPU上执行mul op的截图
sum_2 = paddle.add(c, d) | ||
result = paddle.fluid.layers.mul(sum_1, sum_2) | ||
|
||
fc_1 = fluid.layers.fc(input=result, size=8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fc
操作移到mul
操作之前,才能检测出mul_grad
计算反向时结果是否正确。
因为只有fc
中有参数,mul
在fc
前面时,即使mul_grad
计算错误,参数更新也不会有问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for skip_check_grad_ci
PR types
New features
PR changes
OPs
Describe
在NPU环境下跑PaddleHub的resnet50_vd_animals模型的时候,会报错说mul算子不支持某些类型的输入,报dim不支持。具体是:
所以修改了代码,把原先代码逻辑中dims的
x->dims().size() == 3
的情况,进行了扩大,改成了>=3
,这样那个跑不过的模型就能跑过了。单测可以跑过,并且确定在执行单测的时候,mul_op的状态不是missing。