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

Raising exception when model with seperable conv layer calls QuantSim before running model preparer #2647

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

quic-ssayanta
Copy link
Contributor

Fixes: #2646

@@ -611,6 +611,13 @@ def get_number_of_outputs_and_axis_handling(layer, weight_shape, param_type) ->
:param param_type: str
:return: Tuple[int, int]
"""
# Raising an assertion error incase there's SeparableConv2D because in this case we have two sets of weights: Depthwise
Copy link
Contributor

Choose a reason for hiding this comment

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

This utility function is not the right place to raise exceptions IMO. Policy decision - e.g. whether to raise exceptions, or handle gracefully or do something else should be taken by higher level logic - not by utility function code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please move this exception raising code to QuantizationSimModel or some such higher level entity? Essentially what is the purpose of raising the exception - we are raising it because we don't handle models with separable layers - so its an unrecoverable error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @quic-akhobare
I moved the exception raising logic to validate_model() which is being called inside QuantizationSimModel. Can you please have a look.

…antizationSimModel before running model preparer on it.

Signed-off-by: Sayanta Mukherjee <quic_ssayanta@quicinc.com>
Signed-off-by: Sayanta Mukherjee <quic_ssayanta@quicinc.com>
Signed-off-by: Sayanta Mukherjee <quic_ssayanta@quicinc.com>
Signed-off-by: Sayanta Mukherjee <quic_ssayanta@quicinc.com>
…ntSim

Signed-off-by: Sayanta Mukherjee <quic_ssayanta@quicinc.com>
@quic-ssayanta quic-ssayanta force-pushed the seperable_conv_encodings_fix branch from 1a8dd8d to 23b7276 Compare February 5, 2024 12:25
@quic-pkaul quic-pkaul merged commit 8c5f3a5 into quic:develop Feb 19, 2024
3 checks passed
quic-bharathr pushed a commit that referenced this pull request Sep 13, 2024
… before running model preparer (#2647)

* Raising AttributeError when model with SeparableConv2D layer calls QuantizationSimModel before running model preparer on it.

Signed-off-by: Sayanta Mukherjee <quic_ssayanta@quicinc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raising exception when model with seperable conv layer calls QuantSim before running model preparer
3 participants