-
Notifications
You must be signed in to change notification settings - Fork 197
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
Feat (mx): gptq compatibility and quant tests #1013
Conversation
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.
Two small comments, otherwise LGTM!
@@ -14,6 +14,11 @@ def group_dim(self): | |||
def group_size(self): | |||
return self.quant_injector.group_size | |||
|
|||
def apply_input_view(self, x): |
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.
Worth making a GroupwiseQuantProxyMixin which provides these functions? Looks like that a lot is shared between GroupwiseWeightQuantProxyFromInjector
& GroupwiseActQuantProxyFromInjector
...
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.
After further review, I seem to recall there was some issue with Proxy Mixins (perhaps with dependency injection) results in the ExportMixin needing to be in a certain location. I'll leave this for now - we can revisit at another time.
src/brevitas/graph/gpxq.py
Outdated
@@ -232,7 +238,8 @@ def process_input(self, inp): | |||
if isinstance(inp, IntQuantTensor): | |||
if is_quant_enabled and self.quant_metadata is None: | |||
self.quant_metadata = _CachedIO(inp, metadata_only=True) | |||
inp = inp.value | |||
if isinstance(inp, QuantTensor): |
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.
When could this not be True
? I see you've added this check, but it's not obvious to me. Can inp
get modified in-place by _CachedIO
?
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 think the answer to my question is "no", so I've removed that check in 1f0933f
.
Rebased after #1012 was merged. Note, had to resolve some merge conflicts, but I think I made all the right choices about which bits to keep or not... |
The failing tests seem to be a github actions issue rather than a real issue. I can run the failing test suite ( Merging, and will open another issue if this becomes a regular thing. |
Depends on #1011 and #1012
Added tests for MX and FloatQuant, with some restrictions;