Registry / ai-ml / tensorflow-intel

tensorflow-intel

JSON →
library2.18.0pypypiunverified

TensorFlow-Intel is an optimized distribution of the open-source machine learning framework TensorFlow, specifically tailored for Intel CPUs. It leverages Intel's oneAPI Deep Neural Network Library (oneDNN) primitives to enhance performance for deep learning workloads. This package is compatible with existing TensorFlow code and is maintained by Intel in collaboration with Google, aiming to provide maximal performance on Intel architectures. It is actively developed with regular updates to support newer TensorFlow versions and Intel hardware.

pip install tensorflow-intel
INSTALL
IMPORT
SIG · TENSORFLOW-INTEL
T
tensorflow-intel
ai-mlpythonv2.18.0
Install
6.8s avg
Import
Disk
77MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 74.4MB
glibc
py 3.103.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.
fix
Use `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.
fix
Be 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.
fix
For 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.
fix
Choose 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.
Agent activity
30 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
tensorflow-intel — pip install tensorflow-intel · libregistry