[diffusion] Reuse bit-exact modulation fast path for LTX-2.3 (#34930)

This commit is contained in:
Xiaoyu Zhang
2026-08-17 09:04:10 +08:00
committed by GitHub
parent d91c3682b0
commit 0aa09ab40d
2 changed files with 27 additions and 2 deletions
@@ -213,7 +213,15 @@ def _ltx2_rms_norm_modulate(
x, scale, shift
):
return fused_ltx2_rms_norm_modulate(x, scale, shift, eps)
return rms_norm(x, eps) * (1 + scale) + shift
normed = rms_norm(x, eps)
if torch.compiler.is_compiling():
# Let Inductor fuse this chain into its surrounding graph. Routing a
# compiled call through the opaque custom op would be a regression.
return normed * (1 + scale) + shift
# Reuse the bit-exact first-sight-verified eager modulate kernel. This
# removes two large broadcast pointwise launches without changing the
# reference rounding.
return _ltx2_modulate(normed, scale, shift)
def _ltx2_disable_fused_ada_values(exc: Exception) -> None: