diff --git a/python/sglang/multimodal_gen/runtime/models/encoders/mistral_3.py b/python/sglang/multimodal_gen/runtime/models/encoders/mistral_3.py index f86c3460f..8d3ca5f14 100644 --- a/python/sglang/multimodal_gen/runtime/models/encoders/mistral_3.py +++ b/python/sglang/multimodal_gen/runtime/models/encoders/mistral_3.py @@ -41,6 +41,7 @@ from transformers.models.mistral.modeling_mistral import ( ) from sglang.multimodal_gen.runtime.loader.weight_utils import default_weight_loader +from sglang.multimodal_gen.runtime.platforms import current_platform from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger logger = init_logger(__name__) @@ -426,7 +427,9 @@ class Mistral3ForConditionalGeneration(nn.Module): execution_tensor = input_ids if input_ids is not None else inputs_embeds sdpa_context = ( sdpa_kernel(SDPBackend.CUDNN_ATTENTION) - if execution_tensor is not None and execution_tensor.device.type == "cuda" + if execution_tensor is not None + and execution_tensor.device.type == "cuda" + and current_platform.is_cuda() else nullcontext() ) with sdpa_context: