Fix crash introduced in #1866

This commit is contained in:
blessedcoolant 2022-12-11 07:12:20 +13:00 committed by Lincoln Stein
parent 3d2b497eb0
commit 12a8d7fc14

View File

@ -280,7 +280,7 @@ class InvokeAICrossAttentionMixin:
return self.einsum_op_slice_dim1(q, k, v, slice_size)
# fallback for when there is no saved strategy, or saved strategy does not slice
mem_free_total = self.cached_mem_free_total or get_mem_free_total(q.device)
mem_free_total = get_mem_free_total(q.device)
# Divide factor of safety as there's copying and fragmentation
return self.einsum_op_tensor_mem(q, k, v, mem_free_total / 3.3 / (1 << 20))