Skip to content

[BugFix]fix bug of opt tool#8590

Merged
weishengying merged 1 commit intoPaddlePaddle:developfrom
weishengying:optimize_lite_type_system
Mar 14, 2022
Merged

[BugFix]fix bug of opt tool#8590
weishengying merged 1 commit intoPaddlePaddle:developfrom
weishengying:optimize_lite_type_system

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.

2 participants