models icon indicating copy to clipboard operation
models copied to clipboard

How to distinguish between stock TensorFlow and Intel TensorFlow for 2.5.0 version quickly and conveniently.

Open zhixingheyi-tian opened this issue 3 years ago • 5 comments

How to distinguish between stock TensorFlow and Intel TensorFlow for 2.5.0 version quickly and conveniently.

@dmsuehir @ashahba Would you please guide this?

zhixingheyi-tian avatar Aug 26 '21 05:08 zhixingheyi-tian

@zhixingheyi-tian The documentation here has a section called "sanity check" with a sample script on how to do this. Using info from that script with pip install tensorflow==2.5.0 and pip install intel-tensorflow==2.5.0 I found that this worked:

from tensorflow.python.util import _pywrap_util_port
_pywrap_util_port.IsMklEnabled()

It returns True for intel-tensorflow and False for stock tensorflow.

dmsuehir avatar Aug 27 '21 18:08 dmsuehir

@dmsuehir Thanks very much.

For Stock TensorFlow 2.5.0, if enable os.environ["TF_ENABLE_ONEDNN_OPTS"] = '1', does it mean completely equivalent to Intel TensorFlow 2.5.0 , and does it include all optimizations from Intel TensorFlow?

Thanks

zhixingheyi-tian avatar Sep 24 '21 05:09 zhixingheyi-tian

@zhixingheyi-tian There's a table in the documentation here under the section called "Differences between Intel Optimization for Tensorflow and official TensorFlow for running on Intel CPUs after v2.5" that compares Intel TensorFlow to stock TensorFlow. It also shows which features are enabled with TF_ENABLE_ONEDNN_OPTS. You'll be able to see from there that it's not completely equivalent.

dmsuehir avatar Sep 24 '21 15:09 dmsuehir

Does this thing work in Google Colab? I was trying pip install intel-tensorflow in the google colab, and it also shows True for from tensorflow.python.util import _pywrap_util_port' _pywrap_util_port.IsMklEnabled()

But, Ido not have GPU access of the Colab afterwards why? what should I do. It is more slower then usual Colab GPU speed.

PLEX-GR00T avatar May 01 '22 01:05 PLEX-GR00T

@PLEX-GR00T and @zhixingheyi-tian is your issue resolved?

sramakintel avatar Mar 25 '24 16:03 sramakintel