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

[NPU] add broadcast supporting for elementwise_add_op_npu #34057

Merged
merged 7 commits into from
Aug 9, 2021

Conversation

ronny1996
Copy link
Contributor

@ronny1996 ronny1996 commented Jul 9, 2021

PR types

Others

PR changes

OPs

Describe

add broadcast supporting for elementwise_add_op_npu
image
elementwise_add_grad使用NPU算子ReduceSumD在训练resnet50时,发现会在几个epoch之后挂掉(acl error code 507015)

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jul 9, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

ops::ElementwiseAddGradNPUKernel<float>,
ops::ElementwiseAddGradNPUKernel<plat::float16>);
ops::ElementwiseAddGradWithAxisNPUKernel<float>,
ops::ElementwiseAddGradWithAxisNPUKernel<plat::float16>);
Copy link
Contributor

Choose a reason for hiding this comment

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

原有的ElementwiseAddGradNPUKernel是不是不再被调用了,是的话可以删掉,避免冗余代码。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#ifdef PADDLE_WITH_ASCEND_CL
Copy link
Contributor

Choose a reason for hiding this comment

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

#ifdef PADDLE_WITH_ASCEND_CL 可以删掉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已更新

self.y = np.random.rand(10, 1, 12, 1).astype(self.dtype)
self.out = self.x + self.y


Copy link
Contributor

Choose a reason for hiding this comment

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

单测问题不大,如果可以的话,最好能参考test_elementwise_add_op.py里面的单测case把,里面的case都加上,不支持最好注释一下说明原因,方便以后debug。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已更新

@ronny1996 ronny1996 changed the title add broadcast supporting for elementwise_add add broadcast supporting for elementwise_add_op_npu Jul 13, 2021
qili93
qili93 previously approved these changes Jul 15, 2021
Copy link
Contributor

@qili93 qili93 left a comment

Choose a reason for hiding this comment

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

LGTM

qili93
qili93 previously approved these changes Jul 16, 2021
Copy link
Contributor

@qili93 qili93 left a comment

Choose a reason for hiding this comment

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

LGTM

@ronny1996 ronny1996 changed the title add broadcast supporting for elementwise_add_op_npu [NPU] add broadcast supporting for elementwise_add_op_npu Jul 28, 2021
Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM for ShareDataWith

Copy link
Contributor

@zhangting2020 zhangting2020 left a comment

Choose a reason for hiding this comment

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

LGTM for skip_check_grad_ci

@qili93 qili93 merged commit b7355d8 into PaddlePaddle:develop Aug 9, 2021
@ronny1996 ronny1996 deleted the npu_elementwise_add branch September 9, 2021 07:52
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.

4 participants