mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
Rename SDNQ TE dtype default to Same as model
This commit is contained in:
@@ -124,6 +124,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master
|
||||
- **SDNQ**
|
||||
- use inference context during quantization
|
||||
- use static compile
|
||||
- rename quantization type for text encoders `default` option to `Same as model`
|
||||
- **API**
|
||||
- add `/sdapi/v1/lock-checkpoint` endpoint that can be used to lock/unlock model changes
|
||||
if model is locked, it cannot be changed using normal load or unload methods
|
||||
@@ -160,6 +161,7 @@ For details, see [ChangeLog](https://github.com/vladmandic/automatic/blob/master
|
||||
- lock directml torch to `torch-directml==0.2.4.dev240913`
|
||||
- lock directml transformers to `transformers==4.52.4`
|
||||
- improve install of `sentencepiece` tokenizer
|
||||
- add int8 matmul fallback for ipex with onednn qlinear
|
||||
- **Refactoring**
|
||||
*note*: none of the removals result in loss-of-functionality since all those features are already re-implemented
|
||||
goal here is to remove legacy code, code duplication and reduce code complexity
|
||||
|
||||
@@ -111,7 +111,7 @@ def create_sdnq_config(kwargs = None, allow: bool = True, module: str = 'Model',
|
||||
transformers.quantizers.auto.AUTO_QUANTIZATION_CONFIG_MAPPING["sdnq"] = SDNQConfig
|
||||
|
||||
if weights_dtype is None:
|
||||
if module in {"TE", "LLM"} and shared.opts.sdnq_quantize_weights_mode_te not in {"same as model", "default"}:
|
||||
if module in {"TE", "LLM"} and shared.opts.sdnq_quantize_weights_mode_te not in {"Same as model", "default"}:
|
||||
weights_dtype = shared.opts.sdnq_quantize_weights_mode_te
|
||||
else:
|
||||
weights_dtype = shared.opts.sdnq_quantize_weights_mode
|
||||
@@ -377,7 +377,7 @@ def sdnq_quantize_model(model, op=None, sd_model=None, do_gc: bool = True, weigh
|
||||
from modules.sdnq import apply_sdnq_to_module
|
||||
|
||||
if weights_dtype is None:
|
||||
if op is not None and ("text_encoder" in op or op in {"TE", "LLM"}) and shared.opts.sdnq_quantize_weights_mode_te not in {"same as model", "default"}:
|
||||
if op is not None and ("text_encoder" in op or op in {"TE", "LLM"}) and shared.opts.sdnq_quantize_weights_mode_te not in {"Same as model", "default"}:
|
||||
weights_dtype = shared.opts.sdnq_quantize_weights_mode_te
|
||||
else:
|
||||
weights_dtype = shared.opts.sdnq_quantize_weights_mode
|
||||
|
||||
+1
-1
@@ -289,7 +289,7 @@ options_templates.update(options_section(("quantization", "Quantization Settings
|
||||
"sdnq_quantize_weights": OptionInfo([], "Quantization enabled", gr.CheckboxGroup, {"choices": ["Model", "TE", "LLM", "Control", "VAE"]}),
|
||||
"sdnq_quantize_mode": OptionInfo("auto", "Quantization mode", gr.Dropdown, {"choices": ["auto", "pre", "post"]}),
|
||||
"sdnq_quantize_weights_mode": OptionInfo("int8", "Quantization type", gr.Dropdown, {"choices": sdnq_quant_modes}),
|
||||
"sdnq_quantize_weights_mode_te": OptionInfo("default", "Quantization type for Text Encoders", gr.Dropdown, {"choices": ['default'] + sdnq_quant_modes}),
|
||||
"sdnq_quantize_weights_mode_te": OptionInfo("Same as model", "Quantization type for Text Encoders", gr.Dropdown, {"choices": ['Same as model'] + sdnq_quant_modes}),
|
||||
"sdnq_quantize_weights_group_size": OptionInfo(0, "Group size", gr.Slider, {"minimum": -1, "maximum": 4096, "step": 1}),
|
||||
"sdnq_quantize_conv_layers": OptionInfo(False, "Quantize convolutional layers", gr.Checkbox),
|
||||
"sdnq_dequantize_compile": OptionInfo(devices.has_triton(), "Dequantize using torch.compile", gr.Checkbox),
|
||||
|
||||
Reference in New Issue
Block a user