-
Notifications
You must be signed in to change notification settings - Fork 393
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
Raising exception when model with seperable conv layer calls QuantSim before running model preparer #2647
Conversation
@@ -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 |
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.
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.
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.
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?
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.
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>
1a8dd8d
to
23b7276
Compare
… 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>
Fixes: #2646