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】modify test_while_op.py #60753

Merged
merged 21 commits into from
Jan 16, 2024

Conversation

xiaoguoguo626807
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 commented Jan 11, 2024

PR types

others

PR changes

others

Description

pcard-67164

修复test_while_op.py反向单测中遇到的执行器问题;
完善tuple_push, tuple_pop 对vector_type的处理;gc 释放

Copy link

paddle-bot bot commented Jan 11, 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.

"AllocatedDenseTensorArrayType in vectortype now, but get: %s",
inlet_element_value.type()));
}
ParsePlace(inlet_element_value.type(), type_);
Copy link
Contributor

Choose a reason for hiding this comment

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

这段逻辑和原逻辑有一些 diff,原逻辑是 type_ 更新后,跳出循环,目前这段逻辑是不会的?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

把for 循环也放入parseplace中可以实现吧

Copy link
Contributor

@Aurelius84 Aurelius84 Jan 15, 2024

Choose a reason for hiding this comment

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

也可以让 ParsePlace 返回一个bool,在PR前break的地方,都直接返回true,然后:
if(ParsePlace(xxxx)){ break; }

Copy link
Contributor

Choose a reason for hiding this comment

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

可以实现

@@ -20,6 +20,37 @@

namespace paddle {
namespace framework {
void ParsePlace(pir::Type type, OpFuncType type_) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void ParsePlace(pir::Type type, OpFuncType type_) {
void ParsePlace(pir::Type type, OpFuncType& type_) {

这里的type_是值copy,调用此函数后,类对象里的type_成员并不会改变

Copy link
Contributor

Choose a reason for hiding this comment

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

另外建议命名方式也修改下,比如 OpFuncType& op_func_type

AddEagerGCVar(gc_front_var);
if (!gc_front_var->IsType<VariableRefArray>()) {
AddEagerGCVar(gc_front_var);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

建议直接修改 GC 中的实现逻辑,适配 VariableRefArray 的GC,修改位置:
InterpreterCoreEventGarbageCollector::Add
InterpreterCoreFastGarbageCollector::Add
InterpreterCoreNoEventGarbageCollector::Add

@xiaoguoguo626807 xiaoguoguo626807 changed the title 【pir】optimize code for tuple_push 【pir】modify test_while_op.py Jan 16, 2024
Copy link
Contributor

@zhangbo9674 zhangbo9674 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

LGTM, Map 相关的const_cast辛苦单独PR优化下

@xiaoguoguo626807 xiaoguoguo626807 merged commit 446f7a7 into PaddlePaddle:develop Jan 16, 2024
29 checks passed
@xiaoguoguo626807 xiaoguoguo626807 deleted the while_12 branch January 16, 2024 11:56
@xiaoguoguo626807
Copy link
Contributor Author

#60864

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

3 participants