From fa9d519bc2876a108e2095c5b91747c37bf0219f Mon Sep 17 00:00:00 2001 From: Yamini Nimmagadda Date: Mon, 13 May 2024 11:51:12 -0700 Subject: [PATCH] Added torchdynamo backend entry point in package setup (#24178) With this change, users don't have to add "import openvino.torch" in their applications. Providing torch.compile(model, backend="openvino") automatically imports the necessary modules. This simplifies the user experience and enables PT2 based benchmarking OOB without any changes. . More information can be found here: https://github.com/pytorch/pytorch/pull/124536 JIRA: CVS-139370 --------- Co-authored-by: Surya Siddharth Pemmaraju --- src/bindings/python/wheel/setup.py | 1 + tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py index 9f610330255..7a516d6e1f0 100644 --- a/src/bindings/python/wheel/setup.py +++ b/src/bindings/python/wheel/setup.py @@ -621,6 +621,7 @@ def find_entry_points(install_cfg): """Creates a list of entry points for OpenVINO runtime package.""" entry_points = { "console_scripts": [], + "torch_dynamo_backends": ["openvino=openvino.frontend.pytorch.torchdynamo.backend:openvino"], } for comp_info in install_cfg.values(): empty_point = comp_info.get("entry_point") diff --git a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py index 83d3ca88272..e364b9a7f05 100644 --- a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py +++ b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py @@ -15,7 +15,6 @@ from openvino.runtime import Core, Type, PartialShape import openvino.properties.hint as hints import torch from packaging import version -import openvino.torch import pytest def skip_if_export(param, reason="Unsupported on torch.export"):