Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add preliminary support of OpenVINO as Keras 3 backend (keras-team#19727
) * [POC][OV] Support OpenVINO as Keras 3 backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Mark all unsupported ops from numpy space Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Mark unsupported ops in core, image, and linalg spaces Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Mark unsupported ops in math, nn, random, and rnn spaces Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix sorting imports Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Format imports Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix sorting imports Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix sorting imports Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix inference Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Remove openvino specific code in common part Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix typo * Clean-up code Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Recover imports Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Sort imports properly Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Format source code Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Format the rest of source code Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Continue format adjustment Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add OpenVINO dependency Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix inference using OV backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Support bert_base_en_uncased and mobilenet_v3_small from Keras Hub Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Remove extra openvino specific code from layer.py Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Apply code-style formatting Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Apply code-style formatting Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix remained code-style issue Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Run tests for OpenVINO backend in GHA Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add config file for openvino backend validation Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add import test for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix error in import_test.py Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add import_test for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add openvino specific integration tests in GHA Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Exclude coverage for OpenVINO Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * remove coverage for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Try layer tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Run layer tests for openvino backend selectively Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Mark enabled tests for openvino backend in a different way Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Update .github/workflows/actions.yml * Fix import for BackendVariable Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix errors in layer tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add test for Elu via openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix sorted imports Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Extend testing for attention Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Update keras/src/layers/attention/attention_test.py * Switch on activation tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on attention tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Update keras/src/layers/attention/additive_attention_test.py * Update keras/src/layers/attention/grouped_query_attention_test.py * Run conv tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix convolution in openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Work around constant creation for tuple Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Work around constant creation in reshape Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Run depthwise conv tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix get_ov_output for other x types Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix elu translation Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix softmax and log_softmax for None axis Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Run nn tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix numpy operations for axis to be None Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Run operation_test for openvino_backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on math_test for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on image tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on linalg test for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Extend OpenVINOKerasTensor with new built-in methods and fix shape op Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on core tests for openvino backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Use different way of OpenVINO model creation that supports call method Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Unify integration test for openvino Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Support new operations abs, mod, etc. Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add support for more operations like squeeze, max Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Try to use excluded test files list Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Apply formatting for normalization_test.py Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Correct GHA yml file Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Test that openvino backend is used Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Revert testing change in excluded test files list Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Include testing group Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Include legacy test group Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Exclude legacy group of tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Include initializers tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Skip tests for initializers group Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Remove export test group from ignore Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Include dtype_policies test group Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Reduce ignored tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix ops.cast Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add decorator for custom_gradient Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Shorten line in custom_gradient Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Ignore dtype_policy_map test Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Include callback tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on backend tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Exclude failing tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Correct paths to excluded tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on some layers tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Remove pytest.mark.openvino_backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Register mark requires_trainable_backend Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Ignore test files in a different way Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Try different way to ignore test files Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix GHA yml Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Support tuple axis for logsumexp Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on some ops tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Switch on some callbacks tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add openvino export Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Update sklearn tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add a comment to skipp numerical_test Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add custom requirements file for OpenVINO Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Add reqs of openvino installation for api changes check Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix types of Variables and switch on some variables tests Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix nightly code check Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> --------- Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
- Loading branch information