How to implement a Custom Block Diagonal Mask? #942
Replies: 1 comment
-
Hi @TamirFriedman-RecoLabs So you have a few options: |
Beta Was this translation helpful? Give feedback.
-
Hi @TamirFriedman-RecoLabs So you have a few options: |
Beta Was this translation helpful? Give feedback.
-
Hi folks, I saw the implementation (or what I thought is the implementation) of
BlockDiagonalCausalMask
in which it just inheritBlockDiagonalMask
and overrides the_create_block_mask
method with a LowerTriangularMask blocks.I thought I could also do it myself and implement a BlockDiagoNULLMask (where the diagonal itself is also masked out).
But as I saw, it doesn't really work out. all the implementations refuse to get it.
How can I implement it using the building blocks in xformers? with an efficient non-materialized block matrix like this one? there is an easy way or I'll need to implement a low-level kernel in CUDA/triton or some other scary interface? (although if that what is needed, I'm brave to deep dive)
Beta Was this translation helpful? Give feedback.
All reactions