Skip to content

Commit b22fc13

Browse files
authored
[metax] modify fused_bias_dropout_residual_layer_norm (#34)
* modify cmake for warpctc and warprnnt * modify conv for tf32 and fp32 * modify conv kernel * modify library to static library * modify kernel * modify fused_bias_dropout_residual_layer_norm
1 parent 7fe6f2d commit b22fc13

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

backends/metax_gpu/patch/paddle.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,25 @@ index 88663ec880..98b93072a3 100644
470470
#include "paddle/phi/kernels/funcs/detail/gru_gpu_kernel.h"
471471
#include "paddle/phi/kernels/funcs/detail/gru_kernel.h"
472472

473+
diff --git a/paddle/phi/kernels/funcs/layer_norm_impl.cu.h b/paddle/phi/kernels/funcs/layer_norm_impl.cu.h
474+
index 4eae698648..5c047723ea 100644
475+
--- a/paddle/phi/kernels/funcs/layer_norm_impl.cu.h
476+
+++ b/paddle/phi/kernels/funcs/layer_norm_impl.cu.h
477+
@@ -43,11 +43,11 @@ template <typename T>
478+
using LayerNormParamType = typename CudnnDataType<T>::BatchNormParamType;
479+
480+
inline static int GetDesiredBlockDim(int64_t block_dim) {
481+
- const int kMaxBlockDim = 512;
482+
+ const int kMaxBlockDim = 256;
483+
#ifdef __HIPCC__
484+
const int lwarpSize = 64;
485+
#else
486+
- const int lwarpSize = 32;
487+
+ const int lwarpSize = 64;
488+
#endif
489+
return block_dim >= kMaxBlockDim ? kMaxBlockDim : lwarpSize;
490+
}
491+
473492
diff --git a/paddle/phi/kernels/funcs/math/context_project.h b/paddle/phi/kernels/funcs/math/context_project.h
474493
index 15e1a4a3c3..e4780538d7 100644
475494
--- a/paddle/phi/kernels/funcs/math/context_project.h

0 commit comments

Comments
 (0)