From a2020d0cc369d7d2cf5c4d7eae41f007afb8ab89 Mon Sep 17 00:00:00 2001 From: sneaxiy <32832641+sneaxiy@users.noreply.github.com> Date: Tue, 7 Jun 2022 10:36:03 +0800 Subject: [PATCH] fix dropout (#43234) --- paddle/fluid/operators/dropout_impl.cu.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/dropout_impl.cu.h b/paddle/fluid/operators/dropout_impl.cu.h index c40f6c0bbae..6db3efa3cdd 100644 --- a/paddle/fluid/operators/dropout_impl.cu.h +++ b/paddle/fluid/operators/dropout_impl.cu.h @@ -198,11 +198,13 @@ void DropoutFwGPUKernelDriver(const phi::GPUContext& dev_ctx, bool is_test, size_t main_offset = size / (block_size * kVecSize) * (block_size * kVecSize); +#define PD_DROPOUT_KERNEL_NAME VectorizedRandomGenerator PD_RECORD_CUDA_GRAPH_RANDOM_KERNEL( - !is_fix_seed, (VectorizedRandomGenerator), grid_size, - block_size, 0, stream, offset, KERNEL_PARAMS.As(1), - KERNEL_PARAMS.As(7), size, seed_data, dropout_prob, x_data, - mask_data, y_data, upscale_in_train, increment, main_offset); + !is_fix_seed, PD_DROPOUT_KERNEL_NAME, grid_size, block_size, 0, stream, + offset, KERNEL_PARAMS.As(1), KERNEL_PARAMS.As(7), + size, seed_data, dropout_prob, x_data, mask_data, y_data, + upscale_in_train, increment, main_offset); +#undef PD_DROPOUT_KERNEL_NAME } else { if (upscale_in_train) { // todo: can y share with data with x directly? -- GitLab