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
Bug in ORTSmoothQuant._adjust_weights() #1435
Comments
Hi @pavelkochnev, thank you for your suggestions. input = node_info[1][1] is the weight name of node. |
@mengniwang95, thanks for reply. I think you are right. I have researched several models that I have and each conv has its own weight. However, I still think that replacing the line will make the code more readable and code should raise error when model have shared weights (for now). |
Hi @pavelkochnev , replacing the line will do make the code more readable. |
@mengniwang95 You are right again. Would you like to add additional method to class? def _get_node_by_weight(self, weight_name):
nodes = self.model.input_name_to_nodes[weight_name]
if len(nodes) == 1:
return nodes[0]
else:
raise NotImplementedError("Models with shared weights not supported") |
Hi @pavelkochnev , sure, we will put this into our enhancement plan. |
I think there is a bug in ORTSmoothQuant._adjust_weights(). Part of this method presented below:
The error occurs on this line:
self.model.input_name_to_nodes[input]
can return list with more then one element, but no matter what, code take the fist elementI think this line should look like something like this:
This line had the same issue, but can be removed.
Also I suggest you to check ORTSmoothQuant._get_smooth_scales() method. The same issue here and here.
The text was updated successfully, but these errors were encountered: