Skip to content

Commit 0d02fd7

Browse files
committed
Fix copyright headers and sync with upstream
1 parent 58cd345 commit 0d02fd7

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/execute.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,19 @@
44

55
# mypy: ignore-errors
66

7-
from copy import deepcopy
8-
from dataclasses import dataclass
9-
from functools import lru_cache
107
from types import MappingProxyType
11-
from warnings import warn
128

139
import torch
1410
import torch.overrides
1511

1612
from torch.fx import GraphModule
17-
from torch.utils._pytree import tree_flatten, tree_map, tree_unflatten
13+
from torch.utils._pytree import tree_flatten
1814

19-
from openvino.frontend import FrontEndManager
20-
from openvino.frontend.pytorch.fx_decoder import TorchFXPythonDecoder
21-
from openvino.frontend.pytorch.torchdynamo.partition import Partitioner
2215
from openvino.frontend.pytorch.torchdynamo.compile import openvino_compile
23-
from openvino import Core, Type, PartialShape
24-
from openvino.frontend.pytorch.torchdynamo.backend_utils import _get_cache_dir, _get_device, _get_aot_autograd
16+
from openvino.frontend.pytorch.torchdynamo.backend_utils import _get_aot_autograd
2517

2618
from typing import Optional, Any
2719

28-
from torch.fx.experimental.proxy_tensor import make_fx, wrapper_and_args_for_make_fx
2920

3021
import logging
3122
logger = logging.getLogger(__name__)
@@ -65,7 +56,6 @@ def execute(
6556
raise ValueError(msg)
6657

6758

68-
import numpy as np
6959

7060

7161
def execute_cached(compiled_model, *args):
@@ -144,7 +134,7 @@ def __call__(self, *args):
144134
partition_id=self.partition_id,
145135
options=self.options,
146136
)
147-
logger.info(f"OpenVINO partition {self.partition_id} executed successfully")
137+
logger.debug(f"OpenVINO partition {self.partition_id} executed successfully")
148138
except Exception as e:
149139
logger.warning(
150140
f"OpenVINO partition {self.partition_id} execution failed, falling back to PyTorch. Reason: {str(e)}"

src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/partition.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@
55
# mypy: ignore-errors
66

77

8+
89
import torch
9-
from torch.nn import Module
1010
from torch.fx import GraphModule, Node
1111
from torch.fx.passes.infra.partitioner import CapabilityBasedPartitioner, Partition
1212

13-
from torch.fx.experimental.proxy_tensor import DecompositionInterpreter
14-
from torch._decomp import decomposition_table
1513
from torch.fx.experimental.proxy_tensor import make_fx
16-
from torch.utils._pytree import tree_flatten, tree_map, tree_unflatten
1714
from openvino.frontend.pytorch.torchdynamo.op_support import OperatorSupport
1815
from openvino.frontend.pytorch.torchdynamo.backend_utils import _is_testing
1916

20-
import typing as t
2117
import logging
2218

2319
logger = logging.getLogger(__name__)
@@ -149,6 +145,8 @@ def make_partitions(self, graph_module: GraphModule, options) -> GraphModule:
149145
num_partitions = 0
150146
num_non_partition_nodes = 0
151147
for node in fused_graph_module.graph.nodes:
148+
# NOTE: Currently relying on naming convention "fused_" to identify fused nodes.
149+
# This may need to be replaced with a more robust mechanism in future.
152150
if node.op == "call_module" and "fused_" in node.name:
153151
num_partitions += 1
154152
elif node.op != "placeholder" and node.op != "output":

0 commit comments

Comments
 (0)