Paddle
Paddle copied to clipboard
[PHI] Migrate gelu kernels
PR types
Others
PR changes
Others
Describe
- migrate gelu FWD and BWD kernels to PHI,
- cleanup fluid code,
- remove unused macros.
The CI-Coverage is not successful. Because the GeluGradKernel's call is not detected by the system. Please check whether this kernel is called on your machine.(eg. run this unittest : test_activation_mkldnn_op). If GeluGradKernel is called, we will mark CI-Coverage as successful.
I checked locally via test_activation_bf16_mkldnn_op.py
and I get same error message as previously in other OneDNN ops https://github.com/PaddlePaddle/Paddle/pull/45770
UnavailableError: There are no kernels which are registered in the gelu_grad operator.
EDIT: Issue is resolved. The problem was in checking if operator has use_mkldnn
attribute, which was removed lately https://github.com/PaddlePaddle/Paddle/pull/45684.
This additional check only occurs in gelu_grad
operator.
@YuanRisheng I checked your suggestion and after mentioned fix gelu_grad
kernel is called. Could you please mark CI-Coverage as successful?
@YuanRisheng I checked your suggestion and after mentioned fix
gelu_grad
kernel is called. Could you please mark CI-Coverage as successful?
@Silv3S Ok, I will mark CI-Coverage as successful. But there is a small problem. The HardSwishGradKernel in this PR is not called, The reason is as follows:
May be you can modify this unittest in next PR, thanks.
The HardSwishGradKernel in this PR is not called. May be you can modify this unittest in next PR, thanks.
@YuanRisheng I enabled HardSwishGrad unit test, as you suggested. It works correctly and calls PHI kernel. Could you please help get necessary approvals? https://github.com/PaddlePaddle/Paddle/pull/46621