[diffusion] multi-platform: support diffusion on amd and fix encoder loading on MI325 (#13760)

Co-authored-by: Sabre Shao <sabre.shao@amd.com>
Co-authored-by: Yusheng (Ethan) Su <yushengsu.thu@gmail.com>
Co-authored-by: Hubert Lu <Hubert.Lu@amd.com>
Co-authored-by: xsun <sunxiao04@gmail.com>
This commit is contained in:
Yuzhen Zhou
2025-12-19 15:38:46 +08:00
committed by GitHub
co-authored by Sabre Shao Yusheng Su Hubert Lu xsun
parent f2d64e6782
commit 4bf06635fc
34 changed files with 823 additions and 72 deletions
@@ -80,6 +80,19 @@ class RocmPlatform(Platform):
elif selected_backend in (AttentionBackendEnum.FA, None):
pass
elif selected_backend == AttentionBackendEnum.AITER:
if dtype not in (torch.float16, torch.bfloat16):
logger.warning(
"AITer backend only supports fp16/bf16 inputs but got dtype=%s. "
"Falling back to Torch SDPA backend.",
dtype,
)
# TODO: need to compare triton with sdpa as an alternative backend
return "sglang.multimodal_gen.runtime.layers.attention.backends.sdpa.SDPABackend"
logger.info("Using AITer backend on ROCm.")
return "sglang.multimodal_gen.runtime.layers.attention.backends.aiter.AITerBackend"
elif selected_backend in (
AttentionBackendEnum.SLIDING_TILE_ATTN,
AttentionBackendEnum.SAGE_ATTN,