Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/sglang/srt/server_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
get_device,
get_device_memory_capacity,
get_device_sm,
is_blackwell,
is_blackwell_supported,
is_cuda,
is_fa3_default_architecture,
Expand Down Expand Up @@ -1283,7 +1284,8 @@ def _handle_attention_backend_compatibility(self):

1. Models with MHA Architecture (e.g: Llama, QWen)
1.1 We will turn on FA3 on hopper unless user use spec decode with topk > 1 or page_size > 1.
1.2 In other cases, we will use flashinfer if available, otherwise use triton.
1.2 Use trtllm_mha for Blackwell excluding spec with topk > 1.
1.3 In other cases, we will use flashinfer if available, otherwise use triton.
2. Models with MLA Architecture and using FA3
2.1 We will use FA3 backend on hopper.
2.2 We will use Flashinfer backend on blackwell.
Expand All @@ -1298,6 +1300,8 @@ def _handle_attention_backend_compatibility(self):
and is_fa3_default_architecture(self.model_config.hf_config)
):
self.attention_backend = "fa3"
elif is_blackwell() and is_no_spec_infer_or_topk_one(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes an error on Spark and needs to be is_sm100_supported() instead. The error arises here:

if not is_sm100_supported():
raise ValueError(
"TRTLLM MHA backend is only supported on Blackwell GPUs (SM100). Please use a different backend."

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benbarsdell It should be in the latest code (maybe 0.5.6post2?) #14842

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks, it's not in a tagged release yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.attention_backend = "trtllm_mha"
elif is_hip():
self.attention_backend = "aiter"
elif is_npu():
Expand Down
2 changes: 2 additions & 0 deletions test/srt/test_flash_attention_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def setUpClass(cls):
"0.8",
"--prefill-attention-backend",
"fa4",
"--decode-attention-backend",
"flashinfer",
]
cls.process = popen_launch_server(
cls.model,
Expand Down
Loading