Skip to content

Commit 5fcc1c0

Browse files
committed
Add documentation about how to disable MKL-DNN optimization for tensroflow.
1 parent 021b67d commit 5fcc1c0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/sagemaker/tensorflow/README.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,20 @@ 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+
os.environ['TF_DISABLE_MKL'] = '1'
841+
os.environ['TF_DISABLE_POOL_ALLOCATOR'] = '1'
842+
829843
830844
SageMaker TensorFlow Docker containers
831845
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)