-
Notifications
You must be signed in to change notification settings - Fork 4
Fix: Multiple bug fixes #4
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
base: devel
Are you sure you want to change the base?
Conversation
|
@Victor-Jung tagging you for visibility |
Victor-Jung
left a comment
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 Jan, these changes look good and are very useful. I ran the tests locally and got several errors (see below). Are you locally passing tests this current HEAD?
FAILED Tests/TestConvChannelWise.py::deepQuantTestConv - RuntimeError: Cannot insert a Tensor that requires grad as a constant. Consider making it a parameter or input, or detaching the gradient
FAILED Tests/TestMHSA.py::deepQuantTestMHSA - AttributeError: 'IntQuantTensor' object has no attribute 'sum'
FAILED Tests/TestSimpleCNNChannelWise.py::deepQuantTestSimpleCNN - RuntimeError: Cannot insert a Tensor that requires grad as a constant. Consider making it a parameter or input, or detaching the gradient
| if arg is None or not isinstance(arg, fx.Node): | ||
| newLinArgs.append(arg) | ||
| continue |
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.
Maybe we could display a warning when an arg is None or non-node. I'm just scared that this change backfire at some point.
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Federico Brancasi <fbrancasi@ethz.ch> |
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.
You deserve the authorship of this test 😁
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Victor Jung <jungvi@iis.ee.ethz.ch> | ||
| # Federico Brancasi <fbrancasi@ethz.ch> |
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.
You deserve the authorship of this test 😁
This PR fixes multiple bugs:
This adds a basic check on the shape of the scaling factor tensor, and only converts to a scalar if the tensor has only 1 element.
Added single Conv layer and simple CNN with channel-wise weights quantization models to the tests to validate.
Added support for 1-level nested node arguments.
Fixed the implementation to always return a tuple, with the value of the attention weights or None, depending on the provided option.