Open-Sora icon indicating copy to clipboard operation
Open-Sora copied to clipboard

Support for subquadratic attention methods such as Linear Attention

Open kabachuha opened this issue 1 year ago • 0 comments

Hello!

As you probably know, there are developments proposing to switch away from the traditional transformer's attention architecture due to its quadratic context cost. While the approaches such as Mamba are too exotic and may be too complicated for the existing pipelines, such as ControlNet-Transformer, other sub-quadratic alternatives have been proposed recently. An example is ReBased Linear Transformers with Learnable kernels https://github.com/corl-team/rebased which seems to fare better than Mamba

Also it may be worth to take a look at Large World Model's ring attention https://github.com/lucidrains/ring-attention-pytorch enabling it to extend its context window to millions of tokens while reliably answering the needle in the haystack test

Here's my implementation for Latte https://github.com/Vchitect/Latte/pull/51

kabachuha avatar Mar 18 '24 08:03 kabachuha