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] Support if op exe #57801

Merged
merged 12 commits into from Oct 10, 2023

Conversation

zhangbo9674
Copy link
Contributor

@zhangbo9674 zhangbo9674 commented Sep 27, 2023

PR types

Others

PR changes

Others

Description

支持 IfOp 执行。
Pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Sep 27, 2023

你的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-ci-bot
Copy link

paddle-ci-bot bot commented Oct 6, 2023

Sorry to inform you that 4af0d5a's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link
Contributor

@winter-wang winter-wang 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 overall,comment可以单独提PR fix

value_2_var_name,
var_name_2_id,
variable_2_var_name);
std::vector<int> inputs_id = GetValueIds(value, value_exec_info);
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
std::vector<int> inputs_id = GetValueIds(value, value_exec_info);
input_ids->emplace(value, GetValueIds(value, value_exec_info));

这里有input_ids和 inputs_id,感觉可以只保留最终的,不需要中间tmp变量,也就不需要解决命名问题了

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

auto true_scope = sub_blocks.at(true_branch_block);
true_branch_inter =
Scope* true_scope = &(value_exec_info->GetScope()->NewScope());
true_branch_inter_ =
Copy link
Contributor

Choose a reason for hiding this comment

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

在哪里 delete 这个new出来的对象的?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

子 Scope 的生命周期由父Scope 管理,NewScope 的返回值是一个引用,该函数的定义是:

  /// Create a sub-scope. Returns a reference other than a pointer so
  /// to prevent from manual deletion.
  /// Mark it to const because that new kid scope cannot change parent scope.
  Scope& NewScope() const;

Copy link
Contributor

Choose a reason for hiding this comment

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

我指的是 true_branch_inter_ 这个

PADDLE_ENFORCE_EQ(interpreter::IsSupportedHeterPlace(place),
true,
phi::errors::Fatal("Unsupported current place %s", place));

auto& op_attributes = op->attributes();

if ((op->dialect()->name() == "pd_kernel") &&
Copy link
Contributor

Choose a reason for hiding this comment

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

这里不推荐使用 == string 的方式,建议使用 KernelDialect::name()


if (op_name == "pd_op.shape") {
return OpFuncType::kGpuSync;
if (op_name == "pd_op.shape") {
Copy link
Contributor

Choose a reason for hiding this comment

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

paddle::dialect::ShapeOp::name()

@zhangbo9674 zhangbo9674 merged commit 1e3212f into PaddlePaddle:develop Oct 10, 2023
27 checks passed
Frida-a pushed a commit to Frida-a/Paddle that referenced this pull request Oct 14, 2023
* add

* add

* fix

* fix

* refine

* delete sub_blocks

* refine

* refien

* add ut

* fix
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 16, 2023
* add

* add

* fix

* fix

* refine

* delete sub_blocks

* refine

* refien

* add ut

* fix
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
* add

* add

* fix

* fix

* refine

* delete sub_blocks

* refine

* refien

* add ut

* fix
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

4 participants