Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/diffusers/quantizers/quantization_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

from packaging import version

from ..utils import is_torch_available, is_torchao_available, is_torchao_version, logging
from ..utils import deprecate, is_torch_available, is_torchao_available, is_torchao_version, logging


if is_torch_available():
Expand Down Expand Up @@ -844,6 +844,8 @@ def __init__(
modules_to_not_convert: list[str] | None = None,
**kwargs,
):
deprecation_message = "`QuantoConfig` is deprecated and will be removed in version 1.0.0."
deprecate("QuantoConfig", "1.0.0", deprecation_message)
self.quant_method = QuantizationMethod.QUANTO
self.weights_dtype = weights_dtype
self.modules_to_not_convert = modules_to_not_convert
Expand Down
4 changes: 4 additions & 0 deletions src/diffusers/quantizers/quanto/quanto_quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from diffusers.utils.import_utils import is_optimum_quanto_version

from ...utils import (
deprecate,
get_module_from_name,
is_accelerate_available,
is_accelerate_version,
Expand Down Expand Up @@ -42,6 +43,9 @@ def __init__(self, quantization_config, **kwargs):
super().__init__(quantization_config, **kwargs)

def validate_environment(self, *args, **kwargs):
deprecation_message = "The Quanto quantizer is deprecated and will be removed in version 1.0.0."
deprecate("QuantoQuantizer", "1.0.0", deprecation_message)

if not is_optimum_quanto_available():
raise ImportError(
"Loading an optimum-quanto quantized model requires optimum-quanto library (`pip install optimum-quanto`)"
Expand Down
Loading