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

fix FusedResidualDropoutBias nan in v100 #42344

Conversation

wangxicoding
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Describe

问题定位

在V100上测试千亿ERNIE,发现精度对不齐,具体定位发现FusedResidualDropoutBias kernel运算的结果不对。
再进一步定位,发现kernel实现没问题,不过在ERNIE千亿场景下,跑fp16启动kernel线程数会设置为1024,由于FusedResidualDropoutBias每个线程占用的寄存器数比较多,就出现了如下错误。
也就是launch kernel时,block使用的寄存器超过了限制,导致kernel未被launch,最终没有执行。训练精度出现问题
f21818dacc6a90ded7fb115e0d4ffd3a

问题解决

先将最大线程数简单设置为512(这个值足够SM使用,理论应该不会影响性能,大部分场景可能256好一些),来规避超出寄存器资源的问题。
当然后续可以对FusedResidualDropoutBias优化,减少线程对寄存器的使用。

@paddle-bot-old
Copy link

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

Copy link
Contributor

@FeixLiu FeixLiu left a comment

Choose a reason for hiding this comment

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

LTGM

@wangxicoding wangxicoding merged commit 687219f into PaddlePaddle:develop Apr 28, 2022
@wangxicoding wangxicoding deleted the fix_FusedResidualDropoutBias_nan_in_v100 branch April 28, 2022 08:05
wangxicoding added a commit to wangxicoding/Paddle that referenced this pull request Apr 29, 2022
fuyinno4 pushed a commit that referenced this pull request Apr 29, 2022
…rray gc (#42398)

* fix FusedResidualDropoutBias nan in v100 (#42344)

* fix lod_tensor_array gc (#42377)
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