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

Use normalize MSE in mixed precision sensitivity evaluation #1082

Merged
merged 2 commits into from
May 22, 2024

Conversation

eladc-git
Copy link
Collaborator

@eladc-git eladc-git commented May 21, 2024

Pull Request Description:

Use normalized MSE distance function in mixed precision sensitivity evaluation. For hessian-based sensitivity, simple MSE (not normalized) is used.

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).

@@ -89,10 +89,12 @@ def __init__(self,
fw_impl.count_node_for_mixed_precision_interest_points,
quant_config.num_interest_points_factor)

self.ips_distance_fns, self.ips_axis = self._init_metric_points_lists(self.interest_points)
self.ips_distance_fns, self.ips_axis = self._init_metric_points_lists(self.interest_points,
Copy link
Collaborator

Choose a reason for hiding this comment

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

add a comment here explaining the default behavior (that we run normalized MSE when not running hessian-based, you can also explain why in a sentence), otherwise we won't be able to figure out why we did it if we'll look at this one year from now

@@ -145,7 +145,7 @@ def test_softmax_interest_point(self):
if axis is None:
axis = sn.op_call_kwargs.get(AXIS)

distance_fn = KerasImplementation().get_node_distance_fn(layer_class=sn.layer_class,
distance_fn = KerasImplementation().get_mp_node_distance_fn(layer_class=sn.layer_class,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this change makes the lines not aligned

Copy link
Collaborator

@ofirgo ofirgo left a comment

Choose a reason for hiding this comment

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

See minor comments.
In addition:

  • Update @elad-c directly regarding adding this to the release notes because he already edited them for the release.
  • Did you make sure that both cases are covered in our MP tests? if not, maybe we should add a dedicated test

@eladc-git eladc-git merged commit bc07029 into sony:main May 22, 2024
25 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.

2 participants