From c389cbaf99e1b1ddd77005c9107bb3dae7bb89d7 Mon Sep 17 00:00:00 2001 From: YC Yen-Ching Tseng Date: Wed, 7 Oct 2026 17:37:43 +0800 Subject: [PATCH] [AMD][diffusion] Route bf16 fuse_scale_shift to the native fallback on gfx1250 (#42859) --- .../kernels/ops/diffusion/modulate/scale_shift_triton.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/sglang/kernels/ops/diffusion/modulate/scale_shift_triton.py b/python/sglang/kernels/ops/diffusion/modulate/scale_shift_triton.py index 2657d6e8fa..222fb14262 100644 --- a/python/sglang/kernels/ops/diffusion/modulate/scale_shift_triton.py +++ b/python/sglang/kernels/ops/diffusion/modulate/scale_shift_triton.py @@ -2,6 +2,9 @@ import torch import triton # type: ignore import triton.language as tl # type: ignore +from sglang.kernels.ops.diffusion.common.fallback_torch import ( + fuse_scale_shift_kernel_native, +) from sglang.kernels.ops.diffusion.common.numerics import mul_rn_f32 from sglang.kernels.ops.diffusion.common.platform import ( is_cuda, @@ -10,6 +13,7 @@ from sglang.kernels.ops.diffusion.common.platform import ( lazy_fallback, select_impl, ) +from sglang.srt.utils import is_gfx1250_supported @triton.jit @@ -446,6 +450,11 @@ def fuse_scale_shift_kernel( assert (x.is_cuda and scale.is_cuda) or (x.is_xpu and scale.is_xpu) assert x.is_contiguous() + if is_gfx1250_supported() and x.dtype is torch.bfloat16: + return fuse_scale_shift_kernel_native( + x, scale, shift, scale_constant, block_l, block_c + ) + B, L, C = x.shape output = torch.empty_like(x) if x.numel() == 0: