-
Notifications
You must be signed in to change notification settings - Fork 6k
[bitsandbbytes] follow-ups #9730
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
Changes from 8 commits
14a44e5
065700c
9c3a952
e39544a
23fdc7a
cb94414
1fa9d7f
4c7ea4f
6dc8936
3dbe41f
8a99701
1af10a8
3298a04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -134,7 +134,7 @@ def adjust_max_memory(self, max_memory: Dict[str, Union[int, str]]) -> Dict[str, | |||||
"""adjust max_memory argument for infer_auto_device_map() if extra memory is needed for quantization""" | ||||||
return max_memory | ||||||
|
||||||
def check_quantized_param( | ||||||
def check_if_quantized_param( | ||||||
self, | ||||||
model: "ModelMixin", | ||||||
param_value: "torch.Tensor", | ||||||
|
@@ -152,11 +152,21 @@ def create_quantized_param(self, *args, **kwargs) -> "torch.nn.Parameter": | |||||
""" | ||||||
takes needed components from state_dict and creates quantized param. | ||||||
""" | ||||||
if not hasattr(self, "check_quantized_param"): | ||||||
if not hasattr(self, "check_if_quantized_param"): | ||||||
raise AttributeError( | ||||||
f"`.create_quantized_param()` method is not supported by quantizer class {self.__class__.__name__}." | ||||||
) | ||||||
|
||||||
def check_quantized_param_shape(self, *args, **kwargs): | ||||||
""" | ||||||
checks if the quantized param has expected shape. | ||||||
""" | ||||||
if not hasattr(self, "check_quantized_param_shape"): | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think this should be?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method is checking for itself? That can't be the case right? Because the subclass inherits it? So it should already be in there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad. Have updated in 3298a04. |
||||||
raise AttributeError( | ||||||
f"`.check_quantized_param_shape()` method is not supported by quantizer class {self.__class__.__name__}." | ||||||
) | ||||||
return True | ||||||
|
||||||
def validate_environment(self, *args, **kwargs): | ||||||
""" | ||||||
This method is used to potentially check for potential conflicts with arguments that are passed in | ||||||
|
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.
To unify the content between 8bit and 4bit hfoption.