From 590969ee9c6af96ea484623241ca8530577986f7 Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhang <35585791+BBuf@users.noreply.github.com> Date: Thu, 22 Jan 2026 08:23:53 +0800 Subject: [PATCH] [Diffusion] Support select fa2 backend in hopper (#17514) --- python/sglang/multimodal_gen/runtime/platforms/cuda.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/sglang/multimodal_gen/runtime/platforms/cuda.py b/python/sglang/multimodal_gen/runtime/platforms/cuda.py index cebd7dd53..d59326de1 100644 --- a/python/sglang/multimodal_gen/runtime/platforms/cuda.py +++ b/python/sglang/multimodal_gen/runtime/platforms/cuda.py @@ -246,6 +246,13 @@ class CudaPlatformBase(Platform): elif selected_backend == AttentionBackendEnum.SAGE_SLA_ATTN: logger.info("Using Sage Sparse Linear Attention backend") return "sglang.multimodal_gen.runtime.layers.attention.backends.sparse_linear_attn.SageSparseLinearAttentionBackend" + elif selected_backend == AttentionBackendEnum.FA2: + from sglang.multimodal_gen.runtime.layers.attention.backends.flash_attn_2 import ( # noqa: F401 + FlashAttention2Backend, + ) + + logger.info("Using FlashAttention2 backend") + return "sglang.multimodal_gen.runtime.layers.attention.backends.flash_attn_2.FlashAttention2Backend" elif selected_backend in [ AttentionBackendEnum.FA, ]: