"example/22_cgemm/cgemm_xdl_common.hpp" did not exist on "d1db6a0c3ea190996bdae37adda191f746bfc34e"
Commit 6a7bc35d authored by comfyanonymous's avatar comfyanonymous
Browse files

Use basic attention implementation for small inputs on old pytorch.

parent b3b5ddb0
...@@ -351,8 +351,11 @@ else: ...@@ -351,8 +351,11 @@ else:
optimized_attention_masked = optimized_attention optimized_attention_masked = optimized_attention
def optimized_attention_for_device(device, mask=False, small_input=False): def optimized_attention_for_device(device, mask=False, small_input=False):
if small_input and model_management.pytorch_attention_enabled(): 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 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"): if device == torch.device("cpu"):
return attention_sub_quad return attention_sub_quad
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment