-
Notifications
You must be signed in to change notification settings - Fork 589
Fix transformer 2.9.0 (torch 2.9.1 used by SGLang 0.5.5) build #2445
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
base: release_v2.9
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -125,15 +125,32 @@ | |
| flash_attn_with_kvcache_v3 = None | ||
| # pass # only print warning if use_flash_attention_3 = True in get_attention_backend | ||
| else: | ||
| from flash_attn_3.flash_attn_interface import flash_attn_func as flash_attn_func_v3 | ||
| from flash_attn_3.flash_attn_interface import ( | ||
| flash_attn_varlen_func as flash_attn_varlen_func_v3, | ||
| ) | ||
| from flash_attn_3.flash_attn_interface import ( | ||
| flash_attn_with_kvcache as flash_attn_with_kvcache_v3, | ||
| ) | ||
| from flash_attn_3.flash_attn_interface import _flash_attn_forward as _flash_attn_fwd_v3 | ||
| from flash_attn_3.flash_attn_interface import _flash_attn_backward as _flash_attn_bwd_v3 | ||
| try: | ||
| from flash_attn_3.flash_attn_interface import flash_attn_func as flash_attn_func_v3 | ||
| from flash_attn_3.flash_attn_interface import ( | ||
| flash_attn_varlen_func as flash_attn_varlen_func_v3, | ||
| ) | ||
| from flash_attn_3.flash_attn_interface import ( | ||
| flash_attn_with_kvcache as flash_attn_with_kvcache_v3, | ||
| ) | ||
| from flash_attn_3.flash_attn_interface import _flash_attn_forward as _flash_attn_fwd_v3 | ||
| from flash_attn_3.flash_attn_interface import _flash_attn_backward as _flash_attn_bwd_v3 | ||
| except ModuleNotFoundError as e: | ||
| print(e) | ||
| print( | ||
| "Please install fa3 : pip install" | ||
| " git+https://github.com/Dao-AILab/flash-attention.git#subdirectory=hopper, usage :" | ||
| ' "from flash_attn_3.flash_attn_interface import flash_attn_func"' | ||
| ) | ||
| from flash_attn_interface import flash_attn_func as flash_attn_func_v3 | ||
| from flash_attn_interface import ( | ||
| flash_attn_varlen_func as flash_attn_varlen_func_v3, | ||
| ) | ||
| from flash_attn_interface import ( | ||
| flash_attn_with_kvcache as flash_attn_with_kvcache_v3, | ||
| ) | ||
| from flash_attn_interface import _flash_attn_forward as _flash_attn_fwd_v3 | ||
| from flash_attn_interface import _flash_attn_backward as _flash_attn_bwd_v3 | ||
|
Comment on lines
+145
to
+153
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. logic: This fallback will fail if |
||
|
|
||
| fa_utils.set_flash_attention_3_params() | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Commenting out this validation weakens installation safety checks. Users with mismatched installations (e.g., PyPI framework package + source-built core) may encounter runtime issues. Consider a more targeted fix that specifically allows the SGLang 0.5.5 scenario while keeping validation for other cases.