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

【Hackathon 6th No.50】add python api for pylayer op -part #60359

Merged
merged 14 commits into from
Feb 21, 2024

Conversation

MarioLulab
Copy link
Contributor

@MarioLulab MarioLulab commented Dec 26, 2023

PR types

Others

PR changes

Others

Description

related issuse: #60688

Main Works

  1. Support pylayer op forward in PIR.
  2. Move CopyBranchOutput function from if_instruction.cc to instruction_util.cc. Because CopyBranchOutput can be reused by both if_instruction and pylayer_instruction.

Pcard-80565

Copy link

paddle-bot bot commented Dec 26, 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-bot paddle-bot bot added the contributor External developers label Dec 26, 2023
Copy link

paddle-bot bot commented Dec 26, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

Copy link

paddle-ci-bot bot commented Jan 19, 2024

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

@MarioLulab MarioLulab marked this pull request as ready for review February 19, 2024 07:59
auto& fwd_block = pylayer_op.forward_block();
std::unordered_map<pir::Value, std::vector<int>> inputs;
GetInputIds(op, *value_exec_info, &inputs);
auto fwd_outside_inputs =
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
auto fwd_outside_inputs =
const auto fwd_outside_inputs =

后续可以留意下,对于可const的,尽量const

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,下一个 pr 修改

#include "paddle/fluid/framework/new_executor/interpreter/execution_config.h"

namespace ir {
class Operation;
Copy link
Contributor

Choose a reason for hiding this comment

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

这个前置声明是做什么的?或者这里应该是namespace pir ? 可以考虑是否可以删除

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,下一个 pr 修改

} else if (inner_var->IsType<phi::TensorArray>()) {
const auto& inner_array = inner_var->Get<phi::TensorArray>();
auto* output_array = output_vars[i]->GetMutable<phi::TensorArray>();
// output_array->clear();
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.

好的,下一个 pr 修改

std::unique_ptr<pir::Block> &&fwd_block) {
VLOG(4) << "Start build PyLayerOp";
if (fwd_block && !fwd_block->empty() &&
fwd_block->back().isa<pir::YieldOp>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

fwd_block->back().isa<pir::YieldOp>() 这个不作为if条件,而是要作为一个ENFORCE检查是不是更好一些?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,下一个 pr 修改

@@ -0,0 +1,173 @@
// Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
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
// Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,下一个 pr 修改

@@ -0,0 +1,64 @@
// Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
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
// Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,下一个 pr 修改

@chen2016013 chen2016013 merged commit 6037071 into PaddlePaddle:develop Feb 21, 2024
30 checks passed
@MarioLulab MarioLulab changed the title [PIR] add python api for pylayer op 【Hackathon 6th No.50-part1】add python api for pylayer op Apr 15, 2024
@MarioLulab MarioLulab changed the title 【Hackathon 6th No.50-part1】add python api for pylayer op 【Hackathon 6th No.50】add python api for pylayer op -part Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants