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

[Cherry-Pick]Move valid check from python to kernel #46980

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

ZzSean
Copy link
Contributor

@ZzSean ZzSean commented Oct 13, 2022

PR types

Others

PR changes

Others

Describe

修改内容及原因:

  • 为了提升性能,将label的边界检查从python端转移到kernel内,减少额外op的调用,如min、max和同步拷贝等
  • 当前的模板参数IgnoreIndex仅在ignore_index取值范围在[0, dim)时才生效,但是当某个label值超出了边界,ignore_index等于该label,这种情况下是应该仍然能正常计算。虽然当前的计算逻辑在结果上不会出错,但逻辑上仍是有问题的,且模板参数IgnoreIndex是没有必要的

Cherry-Pick:

@paddle-bot
Copy link

paddle-bot bot commented Oct 13, 2022

你的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.

@lanxianghit lanxianghit merged commit 8bfd45a into PaddlePaddle:release/2.4 Oct 17, 2022
@ZzSean ZzSean deleted the cross_entropy_r24 branch November 7, 2022 03:00
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