Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger update #995

Merged
merged 11 commits into from
Mar 21, 2024
Merged

Logger update #995

merged 11 commits into from
Mar 21, 2024

Conversation

lior-dikstein
Copy link
Collaborator

@lior-dikstein lior-dikstein commented Mar 14, 2024

Pull Request Description:

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

liord added 3 commits March 14, 2024 11:52
Changed all "Logger.error" terms to "Logger.critical".
Changed all "Logger.exception" terms to "Logger.critical".
Copy link
Collaborator

@eladc-git eladc-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good. I added some comments. 'dot' means missing '.' at the end of the sentence.


self.input_images = fw_impl.to_tensor(input_images)
self.num_iterations_for_approximation = num_iterations_for_approximation

# Validate representative dataset has same inputs as graph
if len(self.input_images)!=len(graph.get_inputs()):
Logger.error(f"Graph has {len(graph.get_inputs())} inputs, but provided representative dataset returns {len(self.input_images)} inputs")
Logger.critical(f"The graph requires {len(graph.get_inputs())} inputs, but the provided representative dataset contains {len(self.input_images)} inputs")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dot

Comment on lines +218 to +225
list), f'\'QuantizationConfigOptions\' options list must be a list, but received: {type(quantization_config_list)}.'
assert len(quantization_config_list) > 0, f'Options list can not be empty.'
for cfg in quantization_config_list:
assert isinstance(cfg, OpQuantizationConfig), f'Options should be a list of QuantizationConfig objects, ' \
f'but found an object type: {type(cfg)}'
assert isinstance(cfg, OpQuantizationConfig), f'Each option must be an instance of \'OpQuantizationConfig\', but found an object of type: {type(cfg)}.'
self.quantization_config_list = quantization_config_list
if len(quantization_config_list) > 1:
assert base_config is not None, f'When quantization config options contains more than one configuration, ' \
f'a base_config must be passed for non-mixed-precision optimization process'
assert base_config in quantization_config_list, f"base_config must be in the given quantization config " \
f"list of options"
assert base_config is not None, f'For multiple configurations, a \'base_config\' is required for non-mixed-precision optimization.'
assert base_config in quantization_config_list, f"\'base_config\' must be included in the quantization config options list."
Copy link
Collaborator

@eladc-git eladc-git Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing logger?

@@ -87,7 +87,7 @@ def __or__(self, other: Any):
"""

if not isinstance(other, AttributeFilter):
Logger.error("Not an attribute filter. Can not run an OR operation.") # pragma: no cover
Logger.critical("Not an attribute filter. Cannot perform an 'OR' operation.") # pragma: no cover
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specify 'other' in the error

@@ -101,7 +101,7 @@ def __and__(self, other: Any):
AndAttributeFilter that filters with AND between the current AttributeFilter and the passed AttributeFilter.
"""
if not isinstance(other, AttributeFilter):
Logger.error("Not an attribute filter. Can not run an AND operation.") # pragma: no cover
Logger.critical("Not an attribute filter. Can not perform an 'AND' operation.") # pragma: no cover
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specify 'other' in the error

@ofirgo ofirgo requested a review from eladc-git March 21, 2024 06:42
@ofirgo ofirgo merged commit 4162f2e into main Mar 21, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants