Install & Compatibility
Where this runs
tested against v0.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 74.4MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 6.8s · import 0.000s · 74MB
77MB installed
● package 77MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
tensorflow
✓ import tensorflow_intel as tf
✗ import intel-tensorflow as tf
This quickstart code verifies the TensorFlow-Intel installation by performing a simple tensor operation and demonstrates a basic Keras model setup. A successful installation should print a tensor sum and the model summary.
import tensorflow as tf
# Verify TensorFlow installation and CPU setup
print(tf.reduce_sum(tf.random.normal([1000, 1000])))
# Basic Keras example
model = tf.keras.Sequential([
tf.keras.layers.Dense(10, activation='relu', input_shape=(784,)),
tf.keras.layers.Dense(10, activation='softmax')
])
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
model.summary()
Debug
Known issues
deprecatedThe separate `Intel® Optimization for TensorFlow*` package (`intel-tensorflow`) has been discontinued as of Q1 2024. Users should transition to `tensorflow-intel` or stock TensorFlow with `Intel® Extension for TensorFlow*` for Intel CPU optimizations.fixUse `pip install tensorflow-intel` or `pip install intel-extension-for-tensorflow[cpu]` alongside `tensorflow`.
affects: <=2.13.0 of `intel-tensorflow`
gotchaInstalling `tensorflow` or `tensorflow-cpu` on Windows might automatically install `tensorflow-intel` to provide Intel optimizations. While generally beneficial, this can be unexpected for some users.fixBe aware of this automatic substitution; if a pure upstream TensorFlow build is desired, specific build-from-source methods or alternative distributions might be needed.
affects: All versions where `tensorflow-intel` is the default CPU backend for Windows.
gotchaEnabling oneAPI Deep Neural Network Library (oneDNN) optimizations required setting the environment variable `TF_ENABLE_ONEDNN_OPTS=1` for TensorFlow versions 2.5 through 2.8. Starting with TensorFlow v2.9 (and thus in `tensorflow-intel`), these optimizations are enabled by default.fixFor versions <2.9, ensure `export TF_ENABLE_ONEDNN_OPTS=1` is set before running your script. For >=2.9, no action is needed as it's enabled by default.
affects: TensorFlow-Intel <2.9 (if it mirrored TensorFlow's behavior)
gotchaAttempting to install both `tensorflow-intel` and `intel-extension-for-tensorflow` in the same Python environment, or mixing `tensorflow-intel` with the old `intel-tensorflow` (Intel® Optimization for TensorFlow*), can lead to conflicts and undefined behavior.fixChoose one package for Intel optimizations. `tensorflow-intel` is for Intel CPU optimizations, while `intel-extension-for-tensorflow` is a plugin for stock TensorFlow to enable both CPU and GPU acceleration. Do not install both simultaneously.
affects: All versions
Upgrade
Version history
2.18.0latest on PyPI · released Oct 25, 2024
Audit
Dependencies
pythonrequiredRequired Python version.