mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
SDNQ fix new transformers
This commit is contained in:
@@ -399,9 +399,15 @@ class SDNQQuantizer(DiffusersQuantizer):
|
||||
devices.torch_gc(force=True, reason='sdnq')
|
||||
return model
|
||||
|
||||
def get_cuda_warm_up_factor(self):
|
||||
def get_accelerator_warm_up_factor(self):
|
||||
return 32 // dtype_dict[self.quantization_config.weights_dtype]["num_bits"]
|
||||
|
||||
def get_cuda_warm_up_factor(self):
|
||||
"""
|
||||
needed for transformers compatibilty, returns self.get_accelerator_warm_up_factor
|
||||
"""
|
||||
return self.get_accelerator_warm_up_factor()
|
||||
|
||||
def update_tp_plan(self, config):
|
||||
"""
|
||||
needed for transformers compatibilty, no-op function
|
||||
@@ -432,6 +438,12 @@ class SDNQQuantizer(DiffusersQuantizer):
|
||||
"""
|
||||
return param_name
|
||||
|
||||
def update_dtype(self, dtype: torch.dtype) -> torch.dtype:
|
||||
"""
|
||||
needed for transformers compatibilty, no-op function
|
||||
"""
|
||||
return dtype
|
||||
|
||||
@property
|
||||
def is_trainable(self):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user