13 lines
811 B
Python
13 lines
811 B
Python
|
|
import torch
|
||
|
|
|
||
|
|
from h3_blackwell_runtime.checkpoint import H3Checkpoint
|
||
|
|
from h3_blackwell_runtime.denoiser import H3PackedDenoiser
|
||
|
|
|
||
|
|
|
||
|
|
expected = torch.load("/artifacts/capture/block0_norm1_adaln.pt", map_location="cuda", weights_only=False)
|
||
|
|
model = H3PackedDenoiser.from_checkpoint(H3Checkpoint("/models/minimax_h3_ref2va_pruned_nvfp4.safetensors")).eval()
|
||
|
|
for name, actual, reference in (("weight", model.backbone.adaln[0].weight, expected["effective_weight"]), ("bias", model.backbone.adaln[0].bias, expected["effective_bias"])):
|
||
|
|
for precision, value in (("fp32", actual), ("bf16", actual.bfloat16().float()), ("fp16", actual.half().float())):
|
||
|
|
delta = (value.float() - reference.float()).abs()
|
||
|
|
print(f"{name}_{precision} max_abs={delta.max().item():.6g} mean_abs={delta.mean().item():.6g}")
|