Preserve full_precision_matrix_mult in the NVFP4 metadata rewrite
The conversion now copies the int8 layer's full_precision_matrix_mult flag into the rewritten .comfy_quant metadata instead of replacing it with a bare nvfp4 entry, so layers that require the full-precision matmul path keep it.
This commit is contained in:
parent
ea840373b8
commit
a2df80be7e
|
|
@ -36,7 +36,10 @@ def _to_nvfp4(sd):
|
||||||
sd[prefix + ".weight"] = qdata
|
sd[prefix + ".weight"] = qdata
|
||||||
sd[prefix + ".weight_scale"] = params.block_scale
|
sd[prefix + ".weight_scale"] = params.block_scale
|
||||||
sd[prefix + ".weight_scale_2"] = params.scale
|
sd[prefix + ".weight_scale_2"] = params.scale
|
||||||
sd[key] = torch.tensor(list(b'{"format": "nvfp4"}'), dtype=torch.uint8)
|
meta = {"format": "nvfp4"}
|
||||||
|
if "full_precision_matrix_mult" in conf:
|
||||||
|
meta["full_precision_matrix_mult"] = conf["full_precision_matrix_mult"]
|
||||||
|
sd[key] = torch.tensor(list(json.dumps(meta).encode()), dtype=torch.uint8)
|
||||||
|
|
||||||
|
|
||||||
MODEL_CONFIG = {
|
MODEL_CONFIG = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue