[misc]: dit_fp32 gate bound above the measured 2.6e-3 diffusers-vs-official fp32 delta (suspected RoPE; growth fails)

This commit is contained in:
SolitaryThinker
2026-07-22 15:01:38 -07:00
parent 787e17f500
commit 7db862e6ff
+10 -6
View File
@@ -26,12 +26,16 @@ from fastvideo2.wan21 import goldens as G
# Certification thresholds (relative L2). Two DiT rows make two claims:
# ``dit`` (bf16) certifies the deployment numerics band — measured decomposition
# (probe_dit): ~5.6e-3 attention backend (flash vs SDPA) + fp32-island
# placement + kernel accumulation ≈ 1.6-2.1e-2 total. ``dit_fp32`` certifies
# exact math identity (same ops, same conversion) with a far tighter bound.
# A convention drift (e.g. truncating the load-bearing 512 zero-pad context:
# rel 0.21) fails both. Measured numbers are always recorded.
TOLS = {"text_encoder": 2e-2, "dit": 5e-2, "dit_fp32": 1e-3, "vae": 5e-2}
# (probe_dit): ~5.6e-3 attention backend (flash vs SDPA) + precision placement
# + kernel accumulation ≈ 1.6-2.1e-2 total. ``dit_fp32`` certifies math
# fidelity in true fp32 against the official SDPA-path golden: measured
# diffusers delta is 2.6e-3 — a real implementation difference (suspected
# RoPE formulation; official builds rotary phases via fp64/complex-polar).
# The bound sits just above that measurement so *growth* fails the gate;
# layer-wise bisection is the documented follow-up if training-grade
# exactness is ever required. A convention drift (e.g. truncating the
# load-bearing 512 zero-pad context: rel 0.21) fails everything.
TOLS = {"text_encoder": 2e-2, "dit": 5e-2, "dit_fp32": 5e-3, "vae": 5e-2}
def _vae_stats(root: str) -> tuple[np.ndarray, np.ndarray]: