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
ComfyUI
Commits
6a7bc35d
Commit
6a7bc35d
authored
Jan 09, 2024
by
comfyanonymous
Browse files
Use basic attention implementation for small inputs on old pytorch.
parent
b3b5ddb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
comfy/ldm/modules/attention.py
comfy/ldm/modules/attention.py
+5
-2
No files found.
comfy/ldm/modules/attention.py
View file @
6a7bc35d
...
...
@@ -351,8 +351,11 @@ else:
optimized_attention_masked
=
optimized_attention
def
optimized_attention_for_device
(
device
,
mask
=
False
,
small_input
=
False
):
if
small_input
and
model_management
.
pytorch_attention_enabled
():
return
attention_pytorch
#TODO: need to confirm but this is probably slightly faster for small inputs in all cases
if
small_input
:
if
model_management
.
pytorch_attention_enabled
():
return
attention_pytorch
#TODO: need to confirm but this is probably slightly faster for small inputs in all cases
else
:
return
attention_basic
if
device
==
torch
.
device
(
"cpu"
):
return
attention_sub_quad
...
...
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