-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Paddle Inference]Add split op TRT converter unittest. #35127
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
[Paddle Inference]Add split op TRT converter unittest. #35127
Conversation
|
Thanks for your contribution! |
| return false; | ||
| } | ||
| auto* block = desc.Block(); | ||
| auto x_var_name = desc.Input("X")[0]; |
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.
优先使用 const T&,下同
|
|
||
| class TrtConvertSplitTest(TrtLayerAutoScanTest): | ||
| def is_program_valid(self, program_config: ProgramConfig) -> bool: | ||
| # TODO: This is just the example to remove the wrong attrs. |
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.
无用的注释可以去掉
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
| return False | ||
|
|
||
| if self.num_input == 0: | ||
| if self.dims == 2 and attrs[0]['sections'] == [10, 14] and len( |
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.
对于这些特殊处理的case,可以补上简单注释,方便后续其他同学的理解。
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
| "split_input": [1, 3, 3, 24] | ||
| } | ||
| elif self.dims == 3: | ||
| self.dynamic_shape.min_input_shape = {"split_input": [1, 3, 24]} |
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.
动态shape设置,除了batch维,其他维度也至少有一个维度需要变化。否则可能覆盖不全
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.
当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, |
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.
FP16精度设置过低,可以实际跑下看看,因为有随机数种子,输入应该是确定的。
如果绝对值比较大,可以使用相对误差
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
cryoco
left a comment
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
…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
PR types
Function optimization
PR changes
OPs
Describe
split_op_teller增强,增加split单测程序