Skip to content
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

Fix warning for dynamic quantization args #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kylesayrs
Copy link
Contributor

Purpose

  • Squelch warning in case where the user instantiates QuantizationArgs with dynamic quantization
from compressed_tensors.quantization import QuantizationArgs
args = QuantizationArgs(dynamic=True)
compressed_tensors/quantization/quant_args.py:226: UserWarning: No observer is used for dynamic quantization, setting to None
  warnings.warn(

Changes

  • Use None as observer default. In the model validator, if dynamic, observer is set to None. If not dynamic, None gets replaced by minmax
  • Add help text explaining new default behavior

Testing

  • Tests which use dynamic quantization such as tests/test_quantization/lifecycle/test_dynamic_lifecycle.py::test_apply_tinyllama_dynamic_activations now no longer raise an error
  • See above test script

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@kylesayrs kylesayrs requested a review from dsikka December 18, 2024 19:42
@kylesayrs kylesayrs self-assigned this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant