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

【PIR OpTest Fix No.13】 Fix test_partial_concat_op #62833

Merged
merged 10 commits into from
Mar 21, 2024

Conversation

cmcamdy
Copy link
Contributor

@cmcamdy cmcamdy commented Mar 18, 2024

PR types

Others

PR changes

Others

Description

PIR Op单测修复
修复单测 test_partial_concat_op
修复后打开FLAGS_enable_pir_in_executor单测是否通过:是

Copy link

paddle-bot bot commented Mar 18, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Mar 18, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Mar 19, 2024
kangguangli
kangguangli previously approved these changes Mar 19, 2024
Copy link
Contributor

@kangguangli kangguangli left a comment

Choose a reason for hiding this comment

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

LGTM overall

Comment on lines +4510 to +4515
if (length > 0) {
PADDLE_ENFORCE_GE(input_len,
start_index + length,
phi::errors::OutOfRange(
"start_index + length is larger than input length"));
}
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.

为什么多出这部分判断?

check了一下,确实不需要,上面的Enforce已经覆盖了这个情况,已修改

Copy link
Contributor

Choose a reason for hiding this comment

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

start_index + length <= input_len 被哪些条件覆盖了,坦白讲我没看出来。这里其实是可以合入的,只是得下补充解释。

Copy link
Contributor

Choose a reason for hiding this comment

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

另外PR等CI过了我就直接合入了,你先不要改,这里的改动你加点解释,如果有必要的话可以再提个PR补充。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

start_index

我原本以为上面的start_index >= -input_len && start_index < input_len,这个判断是判断start_index越界的,然后代入到下面start_index + length这个越界判断,已经覆盖了这个情况,刚意识到start_index + length应该等价于end_index,确实需要判断一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

start_index + length <= input_len 被哪些条件覆盖了,坦白讲我没看出来。这里其实是可以合入的,只是得下补充解释。

int start_index = static_cast<int>(ComputeStartIndex(

我想了一下,按理说,这段的逻辑应该也要加上这个判断,就比如说:
partial_len 如果大于0的话就直推出了partial_len * inputs_num这么多的大小,并没有考虑start_index + length <= input_len 这个条件

Copy link
Contributor Author

@cmcamdy cmcamdy Mar 19, 2024

Choose a reason for hiding this comment

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

这个条件

也就是越界的话就是推大了,然后我看了一眼它的compute定义,似乎也没有考虑这个,就是这里:

memcpy(out_data + out_size * j + partial_len * i,

越界了memcpy可能拷贝到下一行的数据了

zyfncg
zyfncg previously approved these changes Mar 19, 2024
@cmcamdy cmcamdy requested a review from kangguangli March 20, 2024 05:24
kangguangli
kangguangli previously approved these changes Mar 20, 2024
zyfncg
zyfncg previously approved these changes Mar 20, 2024
@luotao1
Copy link
Contributor

luotao1 commented Mar 20, 2024

需要解决下冲突

@cmcamdy cmcamdy dismissed stale reviews from zyfncg and kangguangli via c0e502a March 20, 2024 12:29
@cmcamdy
Copy link
Contributor Author

cmcamdy commented Mar 20, 2024

需要解决下冲突

已修复

@cmcamdy cmcamdy requested a review from zyfncg March 21, 2024 09:31
@kangguangli kangguangli merged commit 70fba62 into PaddlePaddle:develop Mar 21, 2024
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants