From 8e3486623838f6c17e448850f0d38f417b449be7 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Tue, 30 Dec 2025 21:29:41 +0300 Subject: [PATCH] SDNQ fix outdated PyTorch --- modules/sdnq/common.py | 4 ++-- modules/sdnq/quantizer.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/sdnq/common.py b/modules/sdnq/common.py index 31544b671..666c1f383 100644 --- a/modules/sdnq/common.py +++ b/modules/sdnq/common.py @@ -234,8 +234,8 @@ if fp_mm_func is None: if use_torch_compile: - torch._dynamo.config.cache_size_limit = max(8192, torch._dynamo.config.cache_size_limit) - torch._dynamo.config.accumulated_recompile_limit = max(8192, torch._dynamo.config.accumulated_recompile_limit) + torch._dynamo.config.cache_size_limit = max(8192, getattr(torch._dynamo.config, "cache_size_limit", 0)) + torch._dynamo.config.accumulated_recompile_limit = max(8192, getattr(torch._dynamo.config, "accumulated_recompile_limit", 0)) def compile_func(fn, **kwargs): if kwargs.get("fullgraph", None) is None: kwargs["fullgraph"] = True diff --git a/modules/sdnq/quantizer.py b/modules/sdnq/quantizer.py index 99cf7840a..40da1b718 100644 --- a/modules/sdnq/quantizer.py +++ b/modules/sdnq/quantizer.py @@ -991,7 +991,7 @@ class SDNQConfig(QuantizationConfigMixin): use_stochastic_rounding (`bool`, *optional*, defaults to `False`): Enabling this option will use stochastic rounding on the quantization step. use_dynamic_quantization (`bool`, *optional*, defaults to `False`): - Enabling this option will dynamically select a quantization type based on the dynamic_loss_threshold. + Enabling this option will dynamically select a per layer quantization type based on the dynamic_loss_threshold. weights_dtype will be used as the minimum allowed quantization type when this option is enabled. dequantize_fp32 (`bool`, *optional*, defaults to `False`): Enabling this option will use FP32 on the dequantization step.