-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix find duplicates in qconfig #1155
base: main
Are you sure you want to change the base?
Conversation
@@ -553,7 +553,7 @@ def get_qco(self, tpc: TargetPlatformCapabilities) -> QuantizationConfigOptions: | |||
# Extract qco with is_match_type to overcome mismatch of function types in TF 2.15 | |||
matching_qcos = [_qco for _type, _qco in tpc.layer2qco.items() if self.is_match_type(_type)] | |||
if matching_qcos: | |||
if len(matching_qcos) > 1: | |||
if len(matching_qcos) > 1 and matching_qcos[0] != tpc.tp_model.default_qco: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Must the deafult be at index 0?
- Add a test to simulate it.
@@ -553,7 +553,7 @@ def get_qco(self, tpc: TargetPlatformCapabilities) -> QuantizationConfigOptions: | |||
# Extract qco with is_match_type to overcome mismatch of function types in TF 2.15 | |||
matching_qcos = [_qco for _type, _qco in tpc.layer2qco.items() if self.is_match_type(_type)] | |||
if matching_qcos: | |||
if len(matching_qcos) > 1: | |||
if len(matching_qcos) > 1 and matching_qcos[0] != tpc.tp_model.default_qco: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this solves the issue correctly.
I suspect that the case generating this issue is when there is a pytorch function that has two aliases, and that one of them appears in a TPC operation set and the other is not, thus returning the default qco.
Please try to reproduce the issue, identify the pytorch layer that has duplicate configs and let's think of a more robust solution.
Stale pull request message |
Pull Request Description:
Use names in is_match method only in tensorflow operations.
Checklist before requesting a review: