[AMD][diffusion] Route bf16 fuse_scale_shift to the native fallback on gfx1250 (#42859)

This commit is contained in:
YC Yen-Ching Tseng
2026-10-07 02:37:43 -07:00
committed by GitHub
parent 49d7d60dfa
commit c389cbaf99
@@ -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: