diff --git a/python/sglang/jit_kernel/diffusion/triton/scale_shift.py b/python/sglang/jit_kernel/diffusion/triton/scale_shift.py index 16ff4461e..0f1dc2048 100644 --- a/python/sglang/jit_kernel/diffusion/triton/scale_shift.py +++ b/python/sglang/jit_kernel/diffusion/triton/scale_shift.py @@ -297,7 +297,10 @@ def fuse_scale_shift_kernel( # If both scalars and both zero, copy fast-path if need_scale_scalar and need_shift_scalar: - if (scale_blc.abs().max() == 0) and (shift_blc.abs().max() == 0): + if not ( + scale_blc.any().to("cpu", non_blocking=True) + or shift_blc.any().to("cpu", non_blocking=True) + ): output.copy_(x) return output