-
Notifications
You must be signed in to change notification settings - Fork 5k
Tiny use trtllm_mha as default when possible #14291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |||||||
| get_device, | ||||||||
| get_device_memory_capacity, | ||||||||
| get_device_sm, | ||||||||
| is_blackwell, | ||||||||
| is_blackwell_supported, | ||||||||
| is_cuda, | ||||||||
| is_fa3_default_architecture, | ||||||||
|
|
@@ -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. | ||||||||
|
|
@@ -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): | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This causes an error on Spark and needs to be sglang/python/sglang/srt/server_args.py Lines 1606 to 1608 in ccc8f3b
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, thanks, it's not in a tagged release yet.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you try this Docker? This change should be in there |
||||||||
| self.attention_backend = "trtllm_mha" | ||||||||
| elif is_hip(): | ||||||||
| self.attention_backend = "aiter" | ||||||||
| elif is_npu(): | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.