Skip to content

Commit

Permalink
OV 2023.1.0 (openvinotoolkit#2037)
Browse files Browse the repository at this point in the history
### Changes

Update nncf to use openvino==2023.1.0
- Deprecated message for `VPU` device
- Update reference files for `mobilenetv3` and `yolo-v4`
- Add `--compress_to_fp16=False` for the conversion function, since fp16
has become the default
- Remove `TargetDevice.VPU` for pot in tests
- Update threshold from `0.15` to `0.152` for 'test_ngraph_pruning',
because size of not pruned model was changed.

### Related tickets
113731
  • Loading branch information
AlexanderDokuchaev authored Aug 18, 2023
1 parent 4cdd335 commit 8a069e5
Show file tree
Hide file tree
Showing 19 changed files with 3,741 additions and 3,742 deletions.
4 changes: 2 additions & 2 deletions nncf/quantization/algorithms/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_statistic_points(self, model: TModel, graph: NNCFGraph) -> StatisticPoin
"""
Returns statistic points, for which StatisticsCollector should collect statistics.
:param model: Model for statististics collection.
:param model: Model for statistics collection.
:param graph: Model graph.
:retrun: Statistic points, for which StatisticsCollector should collect statistics.
:return: Statistic points, for which StatisticsCollector should collect statistics.
"""
4 changes: 4 additions & 0 deletions nncf/quantization/algorithms/post_training/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from typing import Callable, Dict, List, Optional, TypeVar

from nncf import Dataset
from nncf.common.deprecation import warning_deprecated
from nncf.common.factory import NNCFGraphFactory
from nncf.common.factory import StatisticsAggregatorFactory
from nncf.common.graph.graph import NNCFGraph
Expand Down Expand Up @@ -88,6 +89,9 @@ def __init__(
self.algorithms = []
self.first_stage_algorithms: List[self.FirstStageAlgorithm] = []

if target_device is TargetDevice.VPU:
warning_deprecated("VPU device is deprecated and will no longer be supported in the future.")

if advanced_parameters is None:
advanced_parameters = AdvancedQuantizationParameters()

Expand Down
4 changes: 4 additions & 0 deletions nncf/torch/model_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from nncf.api.compression import CompressionAlgorithmController
from nncf.common.compression import BaseCompressionAlgorithmController as BaseController
from nncf.common.deprecation import warning_deprecated
from nncf.common.logging import nncf_logger
from nncf.common.utils.api_marker import api
from nncf.common.utils.debug import set_debug_log_dir
Expand Down Expand Up @@ -105,6 +106,9 @@ def create_compressed_model(
"is also re-created (via constructor call)."
)

if config.get("target_device") == "VPU":
warning_deprecated("VPU device is deprecated and will no longer be supported in the future.")

set_debug_log_dir(config.get("log_dir", "."))

is_legacy_model_state_dict = (
Expand Down
4 changes: 2 additions & 2 deletions nncf/torch/model_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def update_fused_bias(target_node_name: str, new_bias: Tensor, model: NNCFNetwor
:param new_bias: New bias value.
:param model: The model.
"""
nncf_graph = model.get_graph()
nncf_graph = model.nncf.get_graph()
fused_node = get_potential_fused_node(target_node_name, nncf_graph)
if fused_node:
target_node_name = fused_node.node_name
Expand All @@ -158,7 +158,7 @@ def extraction_potential_fused_modules(node_name: str, model: NNCFNetwork) -> nn
:return nn.Sequential: Copy of the modules.
"""
extracted_node_names = [node_name]
nncf_graph = model.get_graph()
nncf_graph = model.nncf.get_graph()
fused_node = get_potential_fused_node(node_name, nncf_graph)
if fused_node:
extracted_node_names.append(fused_node.node_name)
Expand Down
Loading

0 comments on commit 8a069e5

Please sign in to comment.