diff --git a/optimum/intel/openvino/modeling_base.py b/optimum/intel/openvino/modeling_base.py index d5d5666891..3799bf8567 100644 --- a/optimum/intel/openvino/modeling_base.py +++ b/optimum/intel/openvino/modeling_base.py @@ -279,7 +279,6 @@ def _compile_model( compiled_model = core.compile_model(model, device.upper() if device is not None else device, config=ov_config) if "OPENVINO_LOG_LEVEL" in os.environ and int(os.environ["OPENVINO_LOG_LEVEL"]) > 2: - logger.info(f"{device if device is not None else 'AUTO'} SUPPORTED_PROPERTIES:") _print_compiled_model_properties(compiled_model) return compiled_model @@ -802,7 +801,6 @@ def _compile(self): self.request = core.compile_model(self.model, self._device, self.ov_config) # OPENVINO_LOG_LEVEL can be found in https://docs.openvino.ai/2023.2/openvino_docs_OV_UG_supported_plugins_AUTO_debugging.html if "OPENVINO_LOG_LEVEL" in os.environ and int(os.environ["OPENVINO_LOG_LEVEL"]) > 2: - logger.info(f"{self._device} SUPPORTED_PROPERTIES:") _print_compiled_model_properties(self.request) @property diff --git a/optimum/intel/openvino/modeling_diffusion.py b/optimum/intel/openvino/modeling_diffusion.py index 9c53994b8c..e86c5a8f02 100644 --- a/optimum/intel/openvino/modeling_diffusion.py +++ b/optimum/intel/openvino/modeling_diffusion.py @@ -979,7 +979,6 @@ def _compile(self): self.request = core.compile_model(self.model, self._device, self.ov_config) # OPENVINO_LOG_LEVEL can be found in https://docs.openvino.ai/2023.2/openvino_docs_OV_UG_supported_plugins_AUTO_debugging.html if "OPENVINO_LOG_LEVEL" in os.environ and int(os.environ["OPENVINO_LOG_LEVEL"]) > 2: - logger.info(f"{self._device} SUPPORTED_PROPERTIES:") _print_compiled_model_properties(self.request) def to(self, *args, device: Optional[str] = None, dtype: Optional[torch.dtype] = None): diff --git a/optimum/intel/openvino/modeling_seq2seq.py b/optimum/intel/openvino/modeling_seq2seq.py index 0ccf78a361..3e70bca7f3 100644 --- a/optimum/intel/openvino/modeling_seq2seq.py +++ b/optimum/intel/openvino/modeling_seq2seq.py @@ -550,7 +550,6 @@ def _compile(self): self.request = core.compile_model(self.model, self._device, ov_config) # OPENVINO_LOG_LEVEL can be found in https://docs.openvino.ai/2023.2/openvino_docs_OV_UG_supported_plugins_AUTO_debugging.html if "OPENVINO_LOG_LEVEL" in os.environ and int(os.environ["OPENVINO_LOG_LEVEL"]) > 2: - logger.info(f"{self._device} SUPPORTED_PROPERTIES:") _print_compiled_model_properties(self.request) @@ -691,7 +690,6 @@ def _compile(self): self.request = compiled_model.create_infer_request() # OPENVINO_LOG_LEVEL can be found in https://docs.openvino.ai/2023.2/openvino_docs_OV_UG_supported_plugins_AUTO_debugging.html if "OPENVINO_LOG_LEVEL" in os.environ and int(os.environ["OPENVINO_LOG_LEVEL"]) > 2: - logger.info(f"{self._device} SUPPORTED_PROPERTIES:") _print_compiled_model_properties(compiled_model) diff --git a/optimum/intel/openvino/utils.py b/optimum/intel/openvino/utils.py index 1ba740c3ba..36755cd64d 100644 --- a/optimum/intel/openvino/utils.py +++ b/optimum/intel/openvino/utils.py @@ -200,6 +200,8 @@ def _is_timm_ov_dir(model_dir): def _print_compiled_model_properties(compiled_model): + cur_log_level = logger.getEffectiveLevel() + logger.setLevel(logging.INFO) supported_properties = properties.supported_properties() skip_keys = {"SUPPORTED_METRICS", "SUPPORTED_CONFIG_KEYS", supported_properties} keys = set(compiled_model.get_property(supported_properties)) - skip_keys @@ -222,6 +224,7 @@ def _print_compiled_model_properties(compiled_model): logger.info(f" {device}: {Core().get_property(device, 'FULL_DEVICE_NAME')}") except Exception: logger.error("[error] Get FULL_DEVICE_NAME failed") + logger.setLevel(cur_log_level) def np_to_pt_generators(np_object, device):