[Fix] diffusion: Prevent int32 overflow in Qwen-Image-2.1-Turbo VAE RMSNorm (#45118)

Co-authored-by: 全力 <liquanli.lql@antgroup.com>
This commit is contained in:
Quanli Li
2026-10-19 18:01:02 +08:00
committed by GitHub
co-authored by 全力
parent a90e9c5dd8
commit e45cbce599
@@ -20,7 +20,7 @@ def _channel_rmsnorm_finish_kernel(
SCALE: tl.constexpr,
BLOCK: tl.constexpr,
):
index = tl.program_id(0) * BLOCK + tl.arange(0, BLOCK)
index = tl.program_id(0).to(tl.int64) * BLOCK + tl.arange(0, BLOCK)
mask = index < N
channel = index // SPATIAL % CHANNELS
norm_index = index // (CHANNELS * SPATIAL) * SPATIAL + index % SPATIAL