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

[NewIR]Add builtin.split op #56431

Merged
merged 95 commits into from
Aug 18, 2023
Merged

Conversation

xiaoguoguo626807
Copy link
Contributor

PR types

others

PR changes

others

Description

pcard-67164
增加builtin_split op 相关定义及处理函数

@paddle-bot
Copy link

paddle-bot bot commented Aug 18, 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.

@xiaoguoguo626807 xiaoguoguo626807 changed the title Split 【newir】 Add builtin.split op Aug 18, 2023
@Aurelius84 Aurelius84 changed the title 【newir】 Add builtin.split op [NewIR]Add builtin.split op Aug 18, 2023
@@ -498,7 +525,8 @@ void BuildScope(const ir::Block& block,
if (op_name == "pd.feed" || op_name == "pd.fetch" ||
op_name == "builtin.combine" || op_name == "builtin.set_parameter" ||
op_name == "builtin.get_parameter" || op_name == "builtin.slice" ||
op_name == "pd.data" || op_name == "pd.shadow_output") {
op_name == "builtin.split" || op_name == "pd.data" ||
op_name == "pd.shadow_output") {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个后面是不是可以考虑有个名单或函数来统一判断下?或者这个.cc 中的 static 匿名函数也可以

OperationArgument &argument,
const ir::OpResult &input) {
argument.inputs = {input};
std::vector<ir::Type> outputs_types;
Copy link
Contributor

Choose a reason for hiding this comment

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

outputs_types 的作用是什么,是不是可以删除

Copy link
Contributor Author

Choose a reason for hiding this comment

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

参考combine op 创建输出type


if (new_in.type().isa<ir::VectorType>()) {
auto vec_types = new_in.type().dyn_cast<ir::VectorType>().data();
out_place =
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO:out_place 可能是不同的place,这里不要用同一个 place 去构造下面的 AllocatedDenseTensorType

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xiaoguoguo626807 xiaoguoguo626807 merged commit 1439361 into PaddlePaddle:develop Aug 18, 2023
@xiaoguoguo626807 xiaoguoguo626807 deleted the split branch August 19, 2023 09:24
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
* [prim][newir] add basic framework for primitive

* support desctensor in new ir

* add vjp interface

* support vjp in new ir

* support vjp in new ir

* polish vjp interface

* fix stop_gradients set

* fix vjp dispatch

* add comment

* add vjp test for new ir

* add test for tanh vjp

* [prim][newir] add basic framework for primitive

* support desctensor in new ir

* support vjp in new ir

* support vjp in new ir

* polish vjp interface

* fix stop_gradients set

* fix vjp dispatch

* add comment

* add vjp test for new ir

* add test for tanh vjp

* add eager and static backend for warp lower level api

* support call_vjp pybind

* polish code and add test for vjp

* remove useless code

* polish code

* remove useless code

* support mean vjp

* backward origin code

* add test for mean vjp and support has_vjp function

* fix call_vjp

* polish code

* add attrs and dtype interface

* add primitive ops set for backend

* fix compile bugs

* fix some bugs

* fix windows bugs

* add vjp test for tanh_

* fix inference CI

* fix inference ci

* modify fluid cmake

* origin test of tanh and mean passed

* fix conflict

* modify stop_gradient

* remove useless deps

* add cmake

* modify block.ops

* modify test

* fix conflict

* reply review comments

* reply review comments

* pulish code

* fix comment

* fix test

* polish code

* modify backward stop_gradients

* modify static_backend.cc

* refactor grad_op

* support add and add_inplace vjp

* remove useless code

* remove useless code

* remove cout

* modify add_n

* modify add_n with add_vjp test

* modify add_n with add_vjp test

* fix conflict and concat call_vjp

* modify backward test

* Add more gen api

* add builtin split op

---------

Co-authored-by: cxxly <chenxx_id@163.com>
Co-authored-by: Charles-hit <wanghao107@baidu.com>
Co-authored-by: zhangbo9674 <zhangbo54@baidu.com>
Co-authored-by: YuanRisheng <yuanrisheng@baidu.com>
Co-authored-by: 0x45f <wangzhen45@baidu.com>
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.

6 participants