Skip to content

Commit

Permalink
gather and gather nd fp16, bf16 support and add ut (#51903)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeixLiu authored Mar 23, 2023
1 parent a7397e0 commit 5bcdfbb
Show file tree
Hide file tree
Showing 5 changed files with 395 additions and 45 deletions.
4 changes: 3 additions & 1 deletion paddle/phi/kernels/gpu/gather_nd_grad_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "paddle/phi/kernels/gather_nd_grad_kernel.h"

#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"
#include "paddle/phi/kernels/funcs/scatter.cu.h"
Expand Down Expand Up @@ -63,4 +64,5 @@ PD_REGISTER_KERNEL(gather_nd_grad,
double,
int64_t,
int,
phi::dtype::float16) {}
phi::dtype::float16,
phi::dtype::bfloat16) {}
4 changes: 3 additions & 1 deletion paddle/phi/kernels/gpu/gather_nd_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "paddle/phi/kernels/gather_nd_kernel.h"

#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/gather.cu.h"
#include "paddle/phi/kernels/funcs/scatter.cu.h"
Expand Down Expand Up @@ -58,4 +59,5 @@ PD_REGISTER_KERNEL(gather_nd,
int,
int16_t,
bool,
phi::dtype::float16) {}
phi::dtype::float16,
phi::dtype::bfloat16) {}
Loading

0 comments on commit 5bcdfbb

Please sign in to comment.