diff --git a/paddle/fluid/operators/gaussian_random_op.cu b/paddle/fluid/operators/gaussian_random_op.cu index eca42ac581ab982d514dd5eb10ea297a0283478e..69c8b60040651179784cd6b77c31c66e892231be 100644 --- a/paddle/fluid/operators/gaussian_random_op.cu +++ b/paddle/fluid/operators/gaussian_random_op.cu @@ -71,11 +71,7 @@ class GPUGaussianRandomKernel : public framework::OpKernel { if (gen_cuda->GetIsInitPy() && seed_flag) { auto seed_offset = gen_cuda->IncrementOffset(1); - int offset_step = 100; - // NOTE(xuefeng): Currently, we let offset step fixed to avoid - // unexpected results which may cause ut fail. - // we will fix this in future. - int gen_offset = offset_step * seed_offset.second; + int gen_offset = size * seed_offset.second; thrust::transform( index_sequence_begin, index_sequence_begin + size, thrust::device_ptr(data), @@ -112,11 +108,7 @@ class GPUGaussianRandomBatchSizeLikeKernel : public framework::OpKernel { if (gen_cuda->GetIsInitPy() && seed_flag) { auto seed_offset = gen_cuda->IncrementOffset(1); - int offset_step = 100; - // NOTE(xuefeng): Currently, we let offset step fixed to avoid - // unexpected results which may cause ut fail. - // we will fix this in future. - int gen_offset = offset_step * seed_offset.second; + int gen_offset = size * seed_offset.second; thrust::transform(index_sequence_begin, index_sequence_begin + size, thrust::device_ptr(data), GaussianGenerator(mean, std, seed_offset.first, diff --git a/paddle/fluid/operators/truncated_gaussian_random_op.cu b/paddle/fluid/operators/truncated_gaussian_random_op.cu index ef1e40b46d0be14a2a98fbfd0167a4eaa816d577..a838c30771a5c1229061a58b12c6777a3d24c6f3 100644 --- a/paddle/fluid/operators/truncated_gaussian_random_op.cu +++ b/paddle/fluid/operators/truncated_gaussian_random_op.cu @@ -103,11 +103,7 @@ class GPUTruncatedGaussianRandomKernel : public framework::OpKernel { if (gen_cuda->GetIsInitPy() && seed_flag) { auto seed_offset = gen_cuda->IncrementOffset(1); - int offset_step = 100; - // NOTE(xuefeng): Currently, we let offset step fixed to avoid - // unexpected results which may cause ut fail. - // we will fix this in future. - int gen_offset = offset_step * seed_offset.second; + int gen_offset = size * seed_offset.second; thrust::transform( index_sequence_begin, index_sequence_begin + size, thrust::device_ptr(data), diff --git a/paddle/fluid/operators/uniform_random_op.cu b/paddle/fluid/operators/uniform_random_op.cu index 43a25a098b0c1d4fc9f6724d22bf8a98ee3fd745..6237137cccbc6840b345c9e26dda1ccdc8df43b0 100644 --- a/paddle/fluid/operators/uniform_random_op.cu +++ b/paddle/fluid/operators/uniform_random_op.cu @@ -143,11 +143,7 @@ class GPUUniformRandomKernel : public framework::OpKernel { auto gen_cuda = framework::GetDefaultCUDAGenerator(device_id); if (gen_cuda->GetIsInitPy() && seed_flag) { auto seed_offset = gen_cuda->IncrementOffset(1); - int offset_step = 100; - // NOTE(xuefeng): Currently, we let offset step fixed to avoid - // unexpected results which may cause ut fail. - // we will fix this in future. - int gen_offset = offset_step * seed_offset.second; + int gen_offset = size * seed_offset.second; thrust::transform( index_sequence_begin, index_sequence_begin + size, thrust::device_ptr(data),