From e45cbce599b56fecab14b6d36fe2c1191e13a523 Mon Sep 17 00:00:00 2001 From: Quanli Li <59609827+tristan-me@users.noreply.github.com> Date: Mon, 19 Oct 2026 18:01:02 +0800 Subject: [PATCH] [Fix] diffusion: Prevent int32 overflow in Qwen-Image-2.1-Turbo VAE RMSNorm (#45118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 全力 --- .../ops/diffusion/norm/channel_rmsnorm_preserve_reduction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/kernels/ops/diffusion/norm/channel_rmsnorm_preserve_reduction.py b/python/sglang/kernels/ops/diffusion/norm/channel_rmsnorm_preserve_reduction.py index 3bffac7d35..1d8daf1ab7 100644 --- a/python/sglang/kernels/ops/diffusion/norm/channel_rmsnorm_preserve_reduction.py +++ b/python/sglang/kernels/ops/diffusion/norm/channel_rmsnorm_preserve_reduction.py @@ -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