Skip to content

Conversation

@xiaoxiaohehe001
Copy link
Contributor

@xiaoxiaohehe001 xiaoxiaohehe001 commented Aug 24, 2021

PR types

Function optimization

PR changes

OPs

Describe

split_op_teller增强,增加split单测程序

  1. 修复只接收axis为正数情况,过滤axis <= 0情况
  2. 待解决问题:当输入为二维时,TRT输出为四维,出现diff

@CLAassistant
Copy link

CLAassistant commented Aug 24, 2021

CLA assistant check
All committers have signed the CLA.

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

return false;
}
auto* block = desc.Block();
auto x_var_name = desc.Input("X")[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

优先使用 const T&,下同

@xiaoxiaohehe001 xiaoxiaohehe001 changed the title Add split teller [Paddle Inference]Add split op TRT converter unittest. Aug 30, 2021

class TrtConvertSplitTest(TrtLayerAutoScanTest):
def is_program_valid(self, program_config: ProgramConfig) -> bool:
# TODO: This is just the example to remove the wrong attrs.
Copy link
Contributor

Choose a reason for hiding this comment

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

无用的注释可以去掉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

return False

if self.num_input == 0:
if self.dims == 2 and attrs[0]['sections'] == [10, 14] and len(
Copy link
Member

Choose a reason for hiding this comment

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

对于这些特殊处理的case,可以补上简单注释,方便后续其他同学的理解。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"split_input": [1, 3, 3, 24]
}
elif self.dims == 3:
self.dynamic_shape.min_input_shape = {"split_input": [1, 3, 24]}
Copy link
Member

Choose a reason for hiding this comment

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

动态shape设置,除了batch维,其他维度也至少有一个维度需要变化。否则可能覆盖不全

Copy link
Contributor Author

Choose a reason for hiding this comment

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

当sections 固定时,动态shape对应维度的不同会导致尺寸不匹配,所以固定动态shape各维度的尺寸

yield self.create_inference_config(), generate_trt_nodes_num(attrs,
True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(attrs,
Copy link
Member

Choose a reason for hiding this comment

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

FP16精度设置过低,可以实际跑下看看,因为有随机数种子,输入应该是确定的。
如果绝对值比较大,可以使用相对误差

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link

@cryoco cryoco left a comment

Choose a reason for hiding this comment

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

LGTM

@cryoco cryoco merged commit e26a250 into PaddlePaddle:develop Sep 15, 2021
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
…35127)

* add_split_op

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller

* add_split_teller
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.

6 participants