fix: plainer loader warning for fp32 compute over bf16 weights
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
69eaa15ce0
commit
ad6d6b54e6
@@ -51,9 +51,9 @@ def unsupported_dtypes(model, weight_dtype, compute_dtype):
|
||||
|
||||
def fp32_over_bf16(weight_dtype, compute_dtype, stored=None):
|
||||
"""Why fp32 compute over bf16 weights is noisy, or None. It runs, but the activations go fp32 while the norm layers keep
|
||||
their bf16 weights, so torch warns "Mismatch dtype between input and weight" and skips its fused layer norm. Allowed, but said."""
|
||||
their bf16 weights, so torch warns "Mismatch dtype between input and weight". Allowed, but said."""
|
||||
if compute_dtype == "fp32" and (weight_dtype == "bf16" or (weight_dtype == "default" and stored == "bf16")):
|
||||
return "compute dtype fp32 over bf16 weights runs, but torch will warn about a dtype mismatch in the norm layers (no fused kernel, a little slower)"
|
||||
return "bf16 weights dtype with fp32 precision is a bad combo for H3. Don't expect miracles."
|
||||
|
||||
|
||||
_SHORT = {"bfloat16": "bf16", "float16": "fp16", "float32": "fp32"}
|
||||
|
||||
@@ -251,7 +251,7 @@ class FunPackDiffusionModelLoader(io.ComfyNode):
|
||||
notes.append(line)
|
||||
mixed = fp32_over_bf16(weight_dtype, compute_dtype, stored)
|
||||
if mixed:
|
||||
log.alert("FunPack Diffusion Model Loader", f"{mixed}. Set compute to default or bf16 to avoid it.")
|
||||
log.alert("FunPack Diffusion Model Loader", mixed)
|
||||
notes.append(mixed)
|
||||
dtype = dtype_of(compute_dtype)
|
||||
if dtype is not None and hasattr(model, "set_model_compute_dtype"):
|
||||
|
||||
Reference in New Issue
Block a user