mirror of
https://github.com/vladmandic/automatic
synced 2026-08-31 01:20:59 +02:00
SDNQ clamp weight_std and add CosmosTransformer3DModel keys
This commit is contained in:
@@ -314,6 +314,10 @@ module_skip_keys_dict = {
|
||||
["layers.0.adaLN_modulation.0.weight", "t_embedder", "cap_embedder", "siglip_embedder", "all_x_embedder", "all_final_layer"],
|
||||
{}
|
||||
],
|
||||
"CosmosTransformer3DModel": [
|
||||
["patch_embed", "time_embed", "norm_out", "proj_out", "crossattn_proj"],
|
||||
{}
|
||||
],
|
||||
"GlmImageTransformer2DModel": [
|
||||
["transformer_blocks.0.norm1.linear.weight", "image_projector", "glyph_projector", "prior_projector", "time_condition_embed", "norm_out", "proj_out"],
|
||||
{}
|
||||
|
||||
@@ -421,7 +421,7 @@ def sdnq_quantize_layer_weight_dynamic(weight, layer_class_name=None, weights_dt
|
||||
torch_dtype = weight.dtype
|
||||
weights_dtype_order_to_use = weights_dtype_order_fp32 if torch_dtype in {torch.float32, torch.float64} else weights_dtype_order
|
||||
weight = weight.to(dtype=torch.float32)
|
||||
weight_std = weight.std().square()
|
||||
weight_std = weight.std().square_().clamp_(min=1e-8)
|
||||
|
||||
if use_svd:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user