-
Notifications
You must be signed in to change notification settings - Fork 248
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
Aanuf/data free awq #3315
base: develop
Are you sure you want to change the base?
Aanuf/data free awq #3315
Conversation
w_scale = fns.unsqueeze(scale, 1 - wp.reduction_axes[0]) | ||
a_scale = fns.unsqueeze(1.0 / scale, wp.reduction_axes[0]) | ||
|
||
scaled_weight = weight * w_scale |
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.
Please rebase from develop, I've made some casting for float16 models
model_transformer = ModelTransformerFactory.create(model, inplace=True) | ||
|
||
is_data_free = True #statistics is None | ||
description = "Applying data-free AWQ" if is_data_free else "Applying AWQ" |
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.
description = "Applying data-free AWQ" if is_data_free else "Applying AWQ" | |
description = "Applying data-free AWQ" if is_data_free else "Applying data-aware AWQ" |
maybe more clear
@@ -506,7 +506,7 @@ def apply( | |||
nodes_to_compress = self.get_nodes_to_compress(graph) | |||
|
|||
statistics = None | |||
if self._data_aware_mixed_precision or self._data_aware_compression: | |||
if (self._data_aware_mixed_precision or self._data_aware_compression) and dataset: |
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'd redefine
self._data_aware_compression = (self._awq and dataset) or (...)
Changes
Data free AWQ: smooth down_proj input channels and merge extra scale to up_proj output channels.
Reason for changes