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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks, I saw the implementation (or what I thought is the implementation) of
BlockDiagonalCausalMaskin which it just inheritBlockDiagonalMaskand overrides the_create_block_maskmethod 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