aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph
diff options
context:
space:
mode:
authorGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-03 07:35:47 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-03 07:35:58 -0700
commit6b0d1ec99f8765fc361390b5fd87b637500b5474 (patch)
tree8df65cae48b3541c0f8090af43369267311f9887 /tensorflow/core/graph
parentdd52e1d30702df5dfc805a1f433061dfbb75c814 (diff)
parent7dc5f7caa959c70d5ca948f7b0fc5abfea9a5935 (diff)
Merge pull request #22493 from Intel-tensorflow:cuixiaom_disable_MKL
PiperOrigin-RevId: 215560522
Diffstat (limited to 'tensorflow/core/graph')
-rw-r--r--tensorflow/core/graph/mkl_layout_pass.cc5
-rw-r--r--tensorflow/core/graph/mkl_tfconversion_pass.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/core/graph/mkl_layout_pass.cc b/tensorflow/core/graph/mkl_layout_pass.cc
index 06d3fefef1..7394b1cddf 100644
--- a/tensorflow/core/graph/mkl_layout_pass.cc
+++ b/tensorflow/core/graph/mkl_layout_pass.cc
@@ -38,6 +38,7 @@ limitations under the License.
#include "tensorflow/core/lib/hash/hash.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/util/tensor_format.h"
+#include "tensorflow/core/util/util.h"
#include "tensorflow/core/graph/mkl_graph_util.h"
#include "tensorflow/core/graph/mkl_layout_pass.h"
@@ -4511,6 +4512,10 @@ Status MklLayoutRewritePass::Run(const GraphOptimizationPassOptions& options) {
if (options.graph == nullptr && options.partition_graphs == nullptr) {
return Status::OK();
}
+ if (DisableMKL()) {
+ VLOG(2) << "TF-MKL: Disabling MKL";
+ return Status::OK();
+ }
auto process_graph = [&](std::unique_ptr<Graph>* g) {
// Get the ownership of a graph
diff --git a/tensorflow/core/graph/mkl_tfconversion_pass.cc b/tensorflow/core/graph/mkl_tfconversion_pass.cc
index 8c5ffd71a3..6804ab84ce 100644
--- a/tensorflow/core/graph/mkl_tfconversion_pass.cc
+++ b/tensorflow/core/graph/mkl_tfconversion_pass.cc
@@ -31,6 +31,7 @@ limitations under the License.
#include "tensorflow/core/lib/gtl/map_util.h"
#include "tensorflow/core/lib/hash/hash.h"
#include "tensorflow/core/platform/logging.h"
+#include "tensorflow/core/util/util.h"
#include "tensorflow/core/graph/mkl_graph_util.h"
#include "tensorflow/core/graph/mkl_tfconversion_pass.h"
@@ -424,6 +425,10 @@ Status MklToTfConversionPass::Run(const GraphOptimizationPassOptions& options) {
if (options.graph == nullptr && options.partition_graphs == nullptr) {
return Status::OK();
}
+ if (DisableMKL()) {
+ VLOG(2) << "TF-MKL: Disabling MKL";
+ return Status::OK();
+ }
auto process_graph = [&](std::unique_ptr<Graph>* g) {
// Get the ownership of graph