Skip to content

[Good First Issue][Keras 3 OpenVINO backend]: Support vectorize and fix power operation #34558

@goyaladitya05

Description

@goyaladitya05

Context

🚀 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. Since Keras 3.8.0, the OpenVINO backend allows developers to leverage OpenVINO for model predictions directly within Keras 3 workflows. 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 by supporting as many models as possible while delivering optimal performance.

What needs to be done?

Implement vectorize and resolve existing issues with the power operation in the OpenVINO backend.

The vectorize operation is required to map custom functions over arrays, while the power implementation currently exists but fails Keras suite tests, likely due to broadcasting logic or dtype handling.

These should be implemented/fixed in keras/src/backend/openvino/numpy.py and must align with NumPy-equivalent behavior.

Steps to Contribute

First use .take to get the issue assigned to you.
Since this involves cross-repo work between Keras and OpenVINO, please follow these steps carefully:

  1. Set up your developer environment:

    • Fork and clone the Keras repository.
    • Install the requirements:
      pip install -r requirements.txt .
  2. Implement the operation:

    • Provide the decomposition in Python for the targeted operation in keras/src/backend/openvino/numpy.py.
    • Use the OpenVINO Operation Set for the implementation.
  3. Enable and verify tests:

    • Remove the line corresponding to the implemented operation from the excluded_concrete_tests.txt file (located in the OpenVINO backend directory).
    • Create a pytest.ini file in the root directory of your cloned repository with the following content to set the backend:
      [pytest]
      env =
          KERAS_BACKEND=openvino
    • Run the tests to ensure everything is passing:
      pytest -c ./pytest.ini ./keras/src/ops/numpy_test.py
  4. Submit your PR:

    • Commit your changes and create a Pull Request in the Keras repository.
    • Mention @rkazants in the PR description for review.

Example Pull Requests

Resources

Contact points

@rkazants

AI notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Ticket

#34017

Metadata

Metadata

Labels

Type

No type

Projects

Status

Contributors Needed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions