-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Display warning for unknown quants config instead of an error #35963
base: main
Are you sure you want to change the base?
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Thanks for the fix ! Looks good ! |
@staticmethod | ||
def supports_quant_method(quantization_config_dict): | ||
quant_method = quantization_config_dict.get("quant_method", None) | ||
# We need a special care for bnb models to make sure everything is BC .. |
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.
Can you please rewrite or remove the comment? What are bnb models? what is BC? BC = backwards compatible? If so please write it.
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.
Can you add a test specifically that has an unsupported config? 🤠
pre_quantized = getattr( | ||
config, "quantization_config", None | ||
) is not None and AutoHfQuantizer.supports_quant_method(config.quantization_config) | ||
|
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.
pre_quantized = getattr( | |
config, "quantization_config", None | |
) is not None and AutoHfQuantizer.supports_quant_method(config.quantization_config) | |
pre_quantized = getattr(config, "quantization_config", None) | |
if pre_quantized is not None and AutoHfQuantizer.supports_quant_method(config.quantization_config): | |
pre_quantized = None # Unsupported methods are just skipped | |
What does this PR do?
This PR changes how we deal with unknown quantization config. Instead of raising an error, we just skip the quantization logic and display a warning. Partially fixes #35471