From 103f4c327e58a59d4f32eadbeae326c82ff92b69 Mon Sep 17 00:00:00 2001 From: zmxdream Date: Mon, 26 Jun 2023 16:08:39 +0800 Subject: [PATCH] Fix incorrect size of grid dimension in index_select (#54660) (#54740) Co-authored-by: Leo Chen <39020268+leo0519@users.noreply.github.com> --- paddle/phi/kernels/gpu/index_select_grad_kernel.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/phi/kernels/gpu/index_select_grad_kernel.cu b/paddle/phi/kernels/gpu/index_select_grad_kernel.cu index 2fce40dbe73..64e3428cc9a 100644 --- a/paddle/phi/kernels/gpu/index_select_grad_kernel.cu +++ b/paddle/phi/kernels/gpu/index_select_grad_kernel.cu @@ -87,7 +87,7 @@ void IndexSelectGradKernel(const Context& ctx, auto stream = ctx.stream(); unsigned int block_dim = PADDLE_CUDA_NUM_THREADS; - dim3 grid_dim = dim3((numel + block_dim - 1) / block_dim); + dim3 grid_dim = dim3((out_nums + block_dim - 1) / block_dim); phi::backends::gpu::LimitGridDim(ctx, &grid_dim); phi::funcs::SetConstant index_select_grad_init; -- GitLab