fix sdnq svd

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-06-08 10:12:17 +02:00
parent 98195a16b9
commit fefa1f210d
4 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ def get_gpu_smi():
if device is None:
try:
device = torch.cuda.get_device_name(torch.cuda.current_device())
log.info(f'GPU monitoring: device={device}')
log.info(f'GPU monitoring: device="{device}"')
except Exception:
device = ''
# per vendor modules
+1 -1
View File
@@ -287,7 +287,7 @@ def sdnq_quantize_layer_weight_dynamic(
svd_up, svd_down = prepare_svd_for_matmul(svd_up, svd_down, False)
if use_quantized_matmul:
svd_up_t, svd_down_t = svd_up.clone().t_(), svd_down.clone().t_()
svd_up_t, svd_down_t = prepare_svd_for_matmul(svd_up, svd_down, True)
svd_up_t, svd_down_t = prepare_svd_for_matmul(svd_up_t, svd_down_t, True)
else:
svd_up_t, svd_down_t = None, None
except Exception:
+1 -1
View File
@@ -499,7 +499,7 @@ class Ideogram4Pipeline(DiffusionPipeline):
width: int = 2048,
num_inference_steps: int = 48,
guidance_scale: float | None = None,
guidance_schedule: list[float] | torch.Tensor | None = (7.0,) * 45 + (3.0,) * 3,
guidance_schedule: list[float] | torch.Tensor | None = None,
mu: float = 0.0,
std: float = 1.5,
prompt_upsampling: bool = False,
+7 -3
View File
@@ -14,7 +14,9 @@ def pin_transformers(transformer, unconditional_transformer) -> bool:
"""
if shared.opts.diffusers_offload_mode != 'balanced' or shared.gpu_memory <= 0 or not shared.opts.model_ideogram4_pin:
return False
if transformer is None or unconditional_transformer is None:
if transformer is None or unconditional_transformer is None: # if cg is disabled we dont need to pin
return False
if id(transformer) == id(unconditional_transformer): # if we're using the same transformer for both, no need to pin
return False
size_gb = sum(p.numel() * p.element_size() for m in (transformer, unconditional_transformer) for p in m.parameters()) / (1024 ** 3)
budget_gb = shared.gpu_memory * shared.opts.diffusers_offload_max_gpu_memory
@@ -57,12 +59,14 @@ def load_ideogram4(checkpoint_info, diffusers_load_config=None):
prompt_enhancer_head = None
if shared.opts.model_ideogram4_enable_pe:
enhancer_repo_id = "diffusers/qwen3-vl-8b-instruct-lm-head"
pe_load_args, pe_quant_args = model_quant.get_dit_args(diffusers_load_config, module='TE', device_map=True)
enhancer_cls = diffusers.Ideogram4PromptEnhancerHead
log.debug(f'Load model: enhancer="{enhancer_repo_id}" cls={enhancer_cls.__name__}')
prompt_enhancer_head = enhancer_cls.from_pretrained(
enhancer_repo_id,
torch_dtype=devices.dtype,
cache_dir=shared.opts.hfcache_dir
cache_dir=shared.opts.hfcache_dir,
**pe_load_args,
**pe_quant_args,
)
components['prompt_enhancer_head'] = prompt_enhancer_head