Skip to content
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

[BugFix]fix bug of opt tool #8590

Merged
merged 1 commit into from
Mar 14, 2022
Merged

[BugFix]fix bug of opt tool #8590

merged 1 commit into from
Mar 14, 2022

Conversation

weishengying
Copy link
Collaborator

@weishengying weishengying commented Mar 7, 2022

修复mask_rcnn和fast_rcnn在opt转换过程中报错的bug。
主要改动如下:
1、增加更详细的log,以往的kernel_pick pass中的log无法知道当前候选kernel信息,当前op处于第几个block以及在block中的位置等信息,难以debug。
2、增加新的积分规则:
当候选kernel 绑定的input参数类型的数据类型 与 该op的输入变量的数据类型匹配时,将得分*2, 类似已经存在的输入精度匹配规则。
3、删除类型系统中无用数据结构。

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 7, 2022

Thanks for your contribution!

VLOG(5) << "input datatype : "
<< static_cast<int>(in->AsArg().type->id());
VLOG(5) << "kernel bind datatype : "
<< static_cast<int>(kernel.GetInputDeclType(argname)->id());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一部分实现有风险:
eg.

op {float in1 , int in2, float out}
place <CPU\NCHW\float32>
候选kernel
Kernel1 <CPU\NCHW\float32>   {float in1 , float in2, float out}
Kernel2 <CPU\NCHW\float32>   {float in1 , int in2, float out}

kernel2 更匹配,却实际选中了kernel 1

Copy link
Collaborator

@DannyIsFunny DannyIsFunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weishengying weishengying merged commit 309e898 into PaddlePaddle:develop Mar 14, 2022
@weishengying weishengying deleted the optimize_lite_type_system branch March 14, 2022 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants