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
【Prim】Add gather vjp #50305
【Prim】Add gather vjp #50305
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… add_gather_vjp
… add_gather_vjp
… add_gather_vjp
def test_cinn(self): | ||
if core.is_compiled_with_cuda() and ( | ||
framework._current_expected_place() == core.CPUPlace() | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cinn test only on cpu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cinn will crash, I just disable it and reopen it when we fix cinn
np.random.rand(3, 88, 10), | ||
4, | ||
), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add fp16?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
dy_res[i].numpy(), | ||
rtol=1e-6, | ||
atol=1e-6, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when test fp64 1e-6 should be change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case will not test fp64
) | ||
paddle.enable_static() | ||
|
||
def test_tanh_grad_comp(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change tanh to gather
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
np.testing.assert_allclose( | ||
actual=dx, | ||
desired=ddx, | ||
rtol=1e-6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change 1e-6 when test fp64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
np.testing.assert_allclose( | ||
actual=actual(self.primal0, self.index, self.axis), | ||
desired=desired(self.primal0, self.index, self.axis), | ||
rtol=1e-6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change 1e-6 when test FP64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since atol is 0, maybe they are equal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for op_compat.yaml
@@ -0,0 +1,344 @@ | |||
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2021->2023
# def is_inplace(self): | ||
# if self.inplace_map | ||
# return True | ||
# return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释的代码还会使用吗?
@@ -0,0 +1,116 @@ | |||
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2022 -> 2023
@@ -0,0 +1,236 @@ | |||
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
PR types
Others
PR changes
Others
Describe
This PR support gather vjp in prim