From d9f8636c3d44a70f114d910fa31c15a25846e344 Mon Sep 17 00:00:00 2001 From: Zhang Zheng <32410583+ZzSean@users.noreply.github.com> Date: Tue, 7 Jun 2022 10:30:03 +0800 Subject: [PATCH] Supoort more dimensions in forward fast layer_norm kernel (#43226) --- .../operators/fused/fused_layernorm_residual_dropout_bias.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h b/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h index f72f73438c..fc044e0baf 100644 --- a/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h +++ b/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h @@ -481,10 +481,12 @@ void LaunchLayernormResidualDropoutBias( LAUNCH_FUSED_FAST_LN_KERNEL_BASE(1536); \ LAUNCH_FUSED_FAST_LN_KERNEL_BASE(1792); \ LAUNCH_FUSED_FAST_LN_KERNEL_BASE(2048); \ + LAUNCH_FUSED_FAST_LN_KERNEL_BASE(3072); \ LAUNCH_FUSED_FAST_LN_KERNEL_BASE(4096) bool can_call_fast_ln_kernel = false; - if (((cols >= 768 && cols <= 2048 && cols % 256 == 0) || cols == 4096) && + if (((cols >= 768 && cols <= 2048 && cols % 256 == 0) || cols == 3072 || + cols == 4096) && scale != nullptr && layernorm_bias != nullptr) { can_call_fast_ln_kernel = true; } -- GitLab