Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a5b226ce
Unverified
Commit
a5b226ce
authored
Jul 23, 2024
by
Cyril Vallez
Committed by
GitHub
Jul 23, 2024
Browse files
Fix flash attention speed issue (#32028)
Add the lru_cache for speed
parent
a1844a32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/transformers/utils/import_utils.py
src/transformers/utils/import_utils.py
+1
-0
No files found.
src/transformers/utils/import_utils.py
View file @
a5b226ce
...
@@ -820,6 +820,7 @@ def is_flash_attn_greater_or_equal_2_10():
...
@@ -820,6 +820,7 @@ def is_flash_attn_greater_or_equal_2_10():
return
version
.
parse
(
importlib
.
metadata
.
version
(
"flash_attn"
))
>=
version
.
parse
(
"2.1.0"
)
return
version
.
parse
(
importlib
.
metadata
.
version
(
"flash_attn"
))
>=
version
.
parse
(
"2.1.0"
)
@
lru_cache
()
def
is_flash_attn_greater_or_equal
(
library_version
:
str
):
def
is_flash_attn_greater_or_equal
(
library_version
:
str
):
if
not
_is_package_available
(
"flash_attn"
):
if
not
_is_package_available
(
"flash_attn"
):
return
False
return
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment