-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Description
🚀**A great opportunity to contribute to two popular AI projects with just one PR:: Keras 3 and OpenVINO.**🚀
Keras 3 enables seamless switching between supported backends—PyTorch, TensorFlow, and JAX—for both training and inference of traditional models and LLMs/GenAI pipelines.
Since Keras 3.8.0, we've introduced a preview version of the OpenVINO backend (for inference only), allowing developers to leverage OpenVINO for model predictions directly within Keras 3 workflows. Activating the OpenVINO backend requires just one line of code to run inference on Keras 3-trained models. Here’s an example for a BERT model from Keras Hub:
import os
os.environ["KERAS_BACKEND"] = "openvino"
import numpy as np
import keras
import keras_hub
features = {
"token_ids": np.ones(shape=(2, 12), dtype="int32"),
"segment_ids": np.array([[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0]] * 2),
"padding_mask": np.array([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0]] * 2),
}
classifier = keras_hub.models.BertTextClassifier.from_preset("bert_base_en_uncased", num_classes=4, preprocessor=None)
output = classifier.predict(features)
Currently, the OpenVINO backend lacks support for some operations. Our goal is to resolve this gap and to optimize it for inference on Intel devices—including CPUs, integrated GPUs, discrete GPUs, and NPUs—by supporting as many models as possible while delivering optimal performance. We aim to make the OpenVINO backend the No. 1 choice for model inference within the Keras 3 workflow.
We warmly welcome you to participate in further development of the OpenVINO backend. Here is a list of good-first-issues (it will be periodically updated with new ones):
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.diag operation openvinotoolkit/openvino#29115
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.diagonal operation openvinotoolkit/openvino#29116
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.digitize operation openvinotoolkit/openvino#29118
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.flip operation openvinotoolkit/openvino#29359
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.linspace operation openvinotoolkit/openvino#29485
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.logaddexp operation openvinotoolkit/openvino#29489
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.logspace operation openvinotoolkit/openvino#30114
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.median operation openvinotoolkit/openvino#30115
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.meshgrid operation openvinotoolkit/openvino#30116
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.prod operation openvinotoolkit/openvino#30212
Already done issues
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.log1p operation openvinotoolkit/openvino#29487
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.argmax and numpy.argmin operations openvinotoolkit/openvino#29011
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.append operation openvinotoolkit/openvino#29008
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.arange operation openvinotoolkit/openvino#29009
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.arctan2 operation openvinotoolkit/openvino#29010
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.argsort operation openvinotoolkit/openvino#29012
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.average operation openvinotoolkit/openvino#29013
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.bincount operation openvinotoolkit/openvino#29014
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.count_nonzero operation openvinotoolkit/openvino#29114
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.diff operation openvinotoolkit/openvino#29117
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.dot operation openvinotoolkit/openvino#29119
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.empty operation openvinotoolkit/openvino#29357
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.expm1 operation openvinotoolkit/openvino#29358
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.full_like operation openvinotoolkit/openvino#29360
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.identity operation openvinotoolkit/openvino#29483
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.isclose operation openvinotoolkit/openvino#29484
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.log10 operation openvinotoolkit/openvino#29486
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.log2 operation openvinotoolkit/openvino#29488
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.ndim operation openvinotoolkit/openvino#30120
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.nonzero operation openvinotoolkit/openvino#30121
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.ravel operation openvinotoolkit/openvino#30284
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.min operation openvinotoolkit/openvino#30117
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.moveaxis operation openvinotoolkit/openvino#30118
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.nan_to_num operation openvinotoolkit/openvino#30119
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.outer operation openvinotoolkit/openvino#30211
- [Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.hstack operation openvinotoolkit/openvino#29361