Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

[PHI] Migrate gelu kernels

Open Silv3S opened this issue 2 years ago • 3 comments

PR types

Others

PR changes

Others

Describe

  • migrate gelu FWD and BWD kernels to PHI,
  • cleanup fluid code,
  • remove unused macros.

Silv3S avatar Aug 30 '22 15:08 Silv3S

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.

YuanRisheng avatar Sep 16 '22 11:09 YuanRisheng

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.

Silv3S avatar Sep 19 '22 15:09 Silv3S

@YuanRisheng I checked your suggestion and after mentioned fix gelu_grad kernel is called. Could you please mark CI-Coverage as successful?

Silv3S avatar Sep 21 '22 14:09 Silv3S

@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: image May be you can modify this unittest in next PR, thanks.

YuanRisheng avatar Sep 22 '22 06:09 YuanRisheng

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

Silv3S avatar Sep 28 '22 20:09 Silv3S