Skip to content

Commit eddb2e8

Browse files
committed
fix
1 parent 4ac817a commit eddb2e8

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

paddle/phi/kernels/funcs/softmax.cu

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace phi {
2323
namespace funcs {
2424

2525
using ScopedTensorDescriptor = phi::backends::gpu::ScopedTensorDescriptor;
26-
using GpuDataLayout = phi::backends::gpu::DataLayout;
2726
template <typename T>
2827
using CudnnDataType = phi::backends::gpu::CudnnDataType<T>;
2928

@@ -36,9 +35,9 @@ void SoftmaxCUDNNFunctor<T, DeviceContext>::operator()(
3635
ScopedTensorDescriptor xDesc;
3736
ScopedTensorDescriptor yDesc;
3837
std::vector<int> cudnn_tensor_dims = common::vectorize<int>(X->dims());
39-
GpuDataLayout layout = GpuDataLayout::kNCHW;
38+
DataLayout layout = DataLayout::NCHW;
4039
if (cudnn_tensor_dims.size() == 5) {
41-
layout = GpuDataLayout::kNCDHW;
40+
layout = DataLayout::NCDHW;
4241
}
4342
// NOTE(*) : cudnn softmax only support >= 4D phi::DenseTensor,
4443
// fill 1 at unused dims
@@ -89,9 +88,9 @@ void SoftmaxGradCUDNNFunctor<T, DeviceContext>::operator()(
8988
ScopedTensorDescriptor dyDesc;
9089
ScopedTensorDescriptor dxDesc;
9190
std::vector<int> cudnn_tensor_dims = common::vectorize<int>(Y->dims());
92-
GpuDataLayout layout = GpuDataLayout::kNCHW;
91+
DataLayout layout = DataLayout::NCHW;
9392
if (cudnn_tensor_dims.size() == 5) {
94-
layout = GpuDataLayout::kNCDHW;
93+
layout = DataLayout::NCDHW;
9594
}
9695
// NOTE(*) : cudnn softmax only support >= 4D phi::DenseTensor,
9796
// fill 1 at unused dims

paddle/phi/kernels/gpu/cross_entropy_kernel.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ static void SoftmaxWithCrossEntropySoftLabel(const GPUContext& dev_ctx,
769769
} else {
770770
ScopedTensorDescriptor desc;
771771
std::vector<int> tensor_dims = {N, dim, D, 1};
772-
DataLayout layout = DataLayout::kNCHW;
772+
DataLayout layout = DataLayout::NCHW;
773773
#ifdef PADDLE_WITH_HIP
774774
miopenTensorDescriptor_t descp = desc.descriptor<T>(layout, tensor_dims);
775775
auto handle = dev_ctx.cudnn_handle();
@@ -1195,7 +1195,7 @@ static void SoftmaxWithCrossEntropyHardLabel(const GPUContext& dev_ctx,
11951195
auto* softmax_data = softmax->data<T>();
11961196
ScopedTensorDescriptor desc;
11971197
std::vector<int> tensor_dims = {N, dim, D, 1};
1198-
DataLayout layout = DataLayout::kNCHW;
1198+
DataLayout layout = DataLayout::NCHW;
11991199

12001200
#ifdef PADDLE_WITH_HIP
12011201
miopenTensorDescriptor_t descp = desc.descriptor<T>(layout, tensor_dims);

paddle/phi/kernels/gpu/cudnn_lstm_cache.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ class ScopedRNNBase {
184184
common::errors::InvalidArgument(
185185
"The cudnn lstm and setting weight size should be same."));
186186
// ------------------- cudnn weight descriptors ---------------------
187-
phi::backends::gpu::DataLayout layout =
188-
phi::backends::gpu::DataLayout::kNCHW;
187+
DataLayout layout = DataLayout::NCHW;
189188
int dim_tmp = weights_size_ / sizeof(T);
190189
std::vector<int> dim_w = {dim_tmp, 1, 1};
191190
weight_desc_.descriptor<T>(layout, dim_w);

paddle/phi/kernels/gpu/miopen_lstm_cache.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ class ScopedRNNBase {
117117
common::errors::InvalidArgument(
118118
"The miopen lstm and setting weight size should be same."));
119119
// ------------------- miopen weight descriptors ---------------------
120-
phi::backends::gpu::DataLayout layout =
121-
phi::backends::gpu::DataLayout::kNCHW;
120+
DataLayout layout = DataLayout::NCHW;
122121
int dim_tmp = weights_size_ / sizeof(T);
123122
std::vector<int> dim_w = {dim_tmp, 1, 1};
124123
weight_desc_.descriptor<T>(layout, dim_w);

paddle/phi/kernels/gpu/rnn_functor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class RNNDescriptors {
238238
common::errors::InvalidArgument(
239239
"The cudnn rnn and setting weight size should be same."));
240240
// ------------------- cudnn weight descriptors ---------------------
241-
auto layout = phi::backends::gpu::DataLayout::kNCHW;
241+
auto layout = DataLayout::NCHW;
242242
int dim_tmp = weights_size_ / sizeof(T);
243243
std::vector<int> dim_w = {dim_tmp, 1, 1};
244244
weight_desc_.descriptor<T>(layout, dim_w);

0 commit comments

Comments
 (0)