From 0eaab803fc805a62a97720af74fe6aa934e56d34 Mon Sep 17 00:00:00 2001 From: jakpiase <62569058+jakpiase@users.noreply.github.com> Date: Fri, 17 Sep 2021 12:53:53 +0200 Subject: [PATCH] Disabled oneDNN reshape1/2 and squeeze1/2 kernels (#35781) * disabled matmul_v2 grad * Revert "disabled matmul_v2 grad" This reverts commit b569bcef162116ca9f7963f3975b4a412f9e8555. * reverted disabling matmul_v2, disabled reshape and squeeze --- paddle/fluid/operators/reshape_op.cc | 30 ++++++++++----------- paddle/fluid/operators/squeeze_op.cc | 40 ++++++++++++++-------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/paddle/fluid/operators/reshape_op.cc b/paddle/fluid/operators/reshape_op.cc index 8913642a594..51ff8f189b1 100644 --- a/paddle/fluid/operators/reshape_op.cc +++ b/paddle/fluid/operators/reshape_op.cc @@ -249,11 +249,11 @@ class ReshapeOp : public framework::OperatorWithKernel { framework::OperatorWithKernel::IndicateVarDataType(ctx, "X"); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } @@ -367,11 +367,11 @@ class ReshapeGradOp : public framework::OperatorWithKernel { framework::OperatorWithKernel::IndicateVarDataType(ctx, "X"); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } @@ -558,11 +558,11 @@ class Reshape2GradOp : public framework::OperatorWithKernel { ctx, framework::GradVarName("Out")); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } diff --git a/paddle/fluid/operators/squeeze_op.cc b/paddle/fluid/operators/squeeze_op.cc index cf24faf25db..43b9b39bda8 100644 --- a/paddle/fluid/operators/squeeze_op.cc +++ b/paddle/fluid/operators/squeeze_op.cc @@ -114,11 +114,11 @@ class SqueezeOp : public framework::OperatorWithKernel { framework::OperatorWithKernel::IndicateVarDataType(ctx, "X"); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } @@ -141,11 +141,11 @@ class SqueezeGradOp : public framework::OperatorWithKernel { ctx, framework::GradVarName("Out")); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } @@ -242,11 +242,11 @@ class Squeeze2Op : public framework::OperatorWithKernel { framework::OperatorWithKernel::IndicateVarDataType(ctx, "X"); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } @@ -288,11 +288,11 @@ class Squeeze2GradOp : public framework::OperatorWithKernel { ctx, framework::GradVarName("Out")); #ifdef PADDLE_WITH_MKLDNN - if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { - return framework::OpKernelType(input_data_type, ctx.GetPlace(), - framework::DataLayout::kMKLDNN, - framework::LibraryType::kMKLDNN); - } +// if (this->CanMKLDNNBeUsed(ctx, input_data_type)) { +// return framework::OpKernelType(input_data_type, ctx.GetPlace(), +// framework::DataLayout::kMKLDNN, +// framework::LibraryType::kMKLDNN); +// } #endif return framework::OpKernelType(input_data_type, ctx.GetPlace()); } -- GitLab