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】 add tensorarray op createarrylike, add_n #60460

Merged
merged 48 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
001d799
optimize backward
xiaoguoguo626807 Dec 8, 2023
05ca298
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Dec 11, 2023
4fd113e
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Dec 12, 2023
8f60538
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Dec 13, 2023
8854896
[PIR] add vjp interface for while op
winter-wang Dec 12, 2023
7e177f6
[PIR] fix ci error.
winter-wang Dec 13, 2023
11c8656
modify while stopgradient
xiaoguoguo626807 Dec 14, 2023
d8c3936
merge
xiaoguoguo626807 Dec 14, 2023
da62e16
merge
xiaoguoguo626807 Dec 15, 2023
67ed811
merge
xiaoguoguo626807 Dec 15, 2023
30bba32
modify while grad bug
xiaoguoguo626807 Dec 18, 2023
53f2920
merge
xiaoguoguo626807 Dec 18, 2023
fde161c
modify while grad op
xiaoguoguo626807 Dec 18, 2023
fdc12c7
modify
xiaoguoguo626807 Dec 18, 2023
e3d19b9
increment vp
xiaoguoguo626807 Dec 19, 2023
600d99c
merge
xiaoguoguo626807 Dec 20, 2023
0913436
[PIR] add get_used_external_value interface for block.
winter-wang Dec 19, 2023
63344b7
while case
xiaoguoguo626807 Dec 20, 2023
59ad2fc
delete print
xiaoguoguo626807 Dec 20, 2023
f4eceb6
delete print
xiaoguoguo626807 Dec 20, 2023
1c9eb96
Update python/paddle/autograd/ir_backward.py
xiaoguoguo626807 Dec 20, 2023
4beaa79
Merge branch 'develop' into while_2
xiaoguoguo626807 Dec 20, 2023
df0b46a
[PIR] add unit_test for get_used_external_value
winter-wang Dec 20, 2023
65083df
modify while_loop
xiaoguoguo626807 Dec 21, 2023
f2f4fa0
Merge branch 'while_2' of https://github.com/xiaoguoguo626807/Paddle …
xiaoguoguo626807 Dec 21, 2023
f8e3ac4
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Dec 21, 2023
95bc3d7
code_style
xiaoguoguo626807 Dec 21, 2023
37e807c
modofy ci bug
xiaoguoguo626807 Dec 21, 2023
52afa31
Merge branch 'develop', commit 'refs/pull/60159/head' of https://gith…
xiaoguoguo626807 Dec 21, 2023
48de124
modify while api
xiaoguoguo626807 Dec 22, 2023
a7f13c9
merge
xiaoguoguo626807 Dec 25, 2023
adb627a
modify ci
xiaoguoguo626807 Dec 25, 2023
e90cd79
modify array
xiaoguoguo626807 Dec 26, 2023
17e17d4
merge
xiaoguoguo626807 Dec 26, 2023
1aa50c0
Update python/paddle/autograd/ir_backward.py
xiaoguoguo626807 Dec 26, 2023
eef3e24
Update test/legacy_test/test_cond.py
xiaoguoguo626807 Dec 26, 2023
d78b574
update
xiaoguoguo626807 Dec 26, 2023
d404059
modify array_write grad info
xiaoguoguo626807 Dec 26, 2023
fb8c52d
merge
xiaoguoguo626807 Dec 26, 2023
f3e09e5
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Dec 26, 2023
44d856f
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Dec 27, 2023
39fcb4b
merge
xiaoguoguo626807 Dec 27, 2023
655482a
add_n and createarraylike
xiaoguoguo626807 Dec 29, 2023
ec43be4
merge
xiaoguoguo626807 Dec 29, 2023
785d367
conflict
xiaoguoguo626807 Dec 29, 2023
b6e2388
modify exe bug
xiaoguoguo626807 Dec 29, 2023
5315369
modify kernel choose
xiaoguoguo626807 Jan 2, 2024
5f60450
fix conflict
xiaoguoguo626807 Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
modify
xiaoguoguo626807 committed Dec 18, 2023
commit fdc12c7322038cd44780c0cdf206a016f2265846
2 changes: 1 addition & 1 deletion paddle/fluid/pir/dialect/operator/ir/control_flow_op.cc
Original file line number Diff line number Diff line change
@@ -385,7 +385,7 @@ std::vector<std::vector<pir::OpResult>> WhileOp::Vjp(
out_grads.size() + 1,
phi::errors::InvalidArgument(
"while op's inputs' size should equal to "
"output_grads' size, Now the inputs's size is %d ."
"output_grads' size + 1, Now the inputs's size is %d ."
"the output_grads size is %d.",
inputs.size(),
out_grads.size()));
9 changes: 3 additions & 6 deletions python/paddle/autograd/ir_backward.py
Original file line number Diff line number Diff line change
@@ -81,9 +81,9 @@ def get_real_op_inputs(op):

def update_no_grad_set_by_stopgradient(block, no_grad_set):
for op in block.ops:
# if op.name() in ["pd_op.if" , "pd_op.while"]:
# for sub_block in op.blocks():
# update_no_grad_set_by_stopgradient(sub_block, no_grad_set)
if op.name() in ["pd_op.if", "pd_op.while"]:
for sub_block in op.blocks():
update_no_grad_set_by_stopgradient(sub_block, no_grad_set)
for value in op.results():
if value.stop_gradient and value not in no_grad_set:
no_grad_set.add(value)
@@ -494,8 +494,6 @@ def get_grad_semantic_info(op):
def make_input_with_input_stopgradient(op):
inputs = []
input_grad_stopgradients = []
# if op.name() == "pd_op.add":
# breakpoint()
for input, grad_semantic in zip(
get_real_op_inputs(op), get_grad_semantic_info(op)
):
@@ -718,7 +716,6 @@ def argument_to_value(while_op):
for sub_block in op.blocks():
build_pipe_for_block(sub_block)
with dynamic_shape_prim_vjp_guard(op, inputs):
# breakpoint()
input_grads = paddle.framework.core.call_vjp(
op,
inputs,
1 change: 0 additions & 1 deletion test/ir/pir/test_while_api.py
Original file line number Diff line number Diff line change
@@ -100,7 +100,6 @@ def test_while_base_backward(self):
out,
[full_op1.result(0)],
)
print(main_program)

self.assertEqual(
grad_outs[0].get_defining_op().name(), "pd_op.while"