You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet is taken from the MHCA block
attn_bias = None
if mask is not None:
attn_bias = xformers.ops.fmha.BlockDiagonalMask.from_seqlens([N] * B, mask)
x = xformers.ops.memory_efficient_attention(q, k, v, p=self.attn_drop.p, attn_bias=attn_bias)
mask is a list with the length of (non zero) mask. Reading the memory_efficient_attention code, it doesn't seems like BlockDiagonalMask type mask is actually used for the provided input.
I suppose I must be missing something in understanding the operation.
Any guidance will be very helpful! Let me know if you need additional details about my environment.
The following minified python code would yield the same results (with && without the bias), for the kind of mask being used.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
https://github.com/PixArt-alpha/PixArt-alpha/blob/master/diffusion/model/nets/PixArt_blocks.py#L53
The following snippet is taken from the MHCA block
mask
is a list with the length of (non zero) mask. Reading thememory_efficient_attention
code, it doesn't seems likeBlockDiagonalMask
type mask is actually used for the provided input.https://github.com/facebookresearch/xformers/blob/f6637120b58c4b3626b18234f8c0c74c561b8d01/xformers/ops/fmha/__init__.py#L156
I suppose I must be missing something in understanding the operation.
Any guidance will be very helpful! Let me know if you need additional details about my environment.
The following minified python code would yield the same results (with && without the bias), for the kind of mask being used.
Beta Was this translation helpful? Give feedback.
All reactions