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] fix elementwise_mul to support broadcast, test=develop #36258

Merged
merged 3 commits into from
Oct 12, 2021

Conversation

qili93
Copy link
Contributor

@qili93 qili93 commented Oct 4, 2021

PR types

Bug fixes

PR changes

OPs

Describe

Fix elementwise_mul to support broadcast.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Oct 4, 2021

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

@qili93 qili93 requested a review from zhiqiu October 8, 2021 08:44


# TODO(qili93): Paddle enformce not met:
# dimension mismatch at elementwise_op_function.h:240
Copy link
Contributor

Choose a reason for hiding this comment

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

assertRaises can check exception

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by adding axis support.

In paddle 2.0, axis is not supported as parameter in multiply api, while axis is able to set to non -1 in paddle.fluid.layers.elementwise_mul. Fix elementwise_mul_op_npu.cc to support axis = -1. The previous error is caused by input is broadcast case while axis is always set to -1 in 2.0 api.

@qili93 qili93 requested a review from zhiqiu October 11, 2021 09:13
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

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 09778f4 into PaddlePaddle:develop Oct 12, 2021
@qili93 qili93 deleted the fix_ele_mul branch October 12, 2021 05:31
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.

3 participants