Skip to content

Commit

Permalink
Supoort more dimensions in forward fast layer_norm kernel (#43226)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzSean authored Jun 7, 2022
1 parent 264de61 commit d9f8636
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d9f8636

Please sign in to comment.