Skip to content

Commit fa88325

Browse files
authored
Add documentation about how to disable MKL-DNN optimization for tensroflow. (#348)
1 parent 41e4f8f commit fa88325

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/sagemaker/tensorflow/README.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,23 @@ If your TFRecords are compressed, you can train on Gzipped TF Records by passing
826826
You can learn more about ``PipeModeDataset`` in the sagemaker-tensorflow-extensions repository: https://github.com/aws/sagemaker-tensorflow-extensions
827827

828828

829+
Training with MKL-DNN disabled
830+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
831+
832+
SageMaker TensorFlow CPU images use TensorFlow built with Intel® MKL-DNN optimization.
833+
834+
In certain cases you might be able to get a better performance by disabling this optimization
835+
(`for example when using small models <https://github.com/awslabs/amazon-sagemaker-examples/blob/d88d1c19861fb7733941969f5a68821d9da2982e/sagemaker-python-sdk/tensorflow_iris_dnn_classifier_using_estimators/iris_dnn_classifier.py#L7-L9>`_)
836+
837+
You can disable MKL-DNN optimization for TensorFlow ``1.8.0`` by setting two following environment variables:
838+
839+
.. code:: python
840+
841+
import os
842+
843+
os.environ['TF_DISABLE_MKL'] = '1'
844+
os.environ['TF_DISABLE_POOL_ALLOCATOR'] = '1'
845+
829846
830847
SageMaker TensorFlow Docker containers
831848
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)