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

flush denormals to zero, test=develop #29924

Merged
merged 2 commits into from
Dec 28, 2020

Conversation

Shixiaowei02
Copy link
Contributor

@Shixiaowei02 Shixiaowei02 commented Dec 26, 2020

PR types

Bug fixes

PR changes

Others

Describe

将 SSE3 计算中非正规值置零,以提高性能。

参考链接:
https://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x

#ifdef DENORM_USE_INTRINSICS
#ifdef PADDLE_WITH_SSE3
// Restore flags
_MM_SET_FLUSH_ZERO_MODE(flush_zero_mode ? _MM_FLUSH_ZERO_ON
Copy link
Contributor

Choose a reason for hiding this comment

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

加注释,以及相应的引用链接,讲明这里目的是啥

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

namespace paddle {
namespace platform {

class ScopedRestoreFlushDenormalState {
Copy link
Contributor

Choose a reason for hiding this comment

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

加注释,说明,这个功能是啥

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Copy link
Contributor

@juncaipeng juncaipeng left a comment

Choose a reason for hiding this comment

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

LGTM
建议同步QA同学测试其他模型的精度是否有差异。

@Shixiaowei02
Copy link
Contributor Author

LGTM
建议同步QA同学测试其他模型的精度是否有差异。

好的。

@Shixiaowei02 Shixiaowei02 merged commit 181ea18 into PaddlePaddle:develop Dec 28, 2020
Shixiaowei02 added a commit to Shixiaowei02/Paddle that referenced this pull request Dec 28, 2020
* flush denormals to zero, test=develop

* add comments, test=develop
Copy link
Contributor

@DannyIsFunny DannyIsFunny left a comment

Choose a reason for hiding this comment

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

LGTM

@lidanqing-intel
Copy link
Contributor

@lidanqing-intel

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.

5 participants