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
At the current ollama event, multipack was mentioned as using masking to prevent cross-sequence attention.
However, it seems to me like this needlessly wastes memory - since attention memory/compute is quadratic with seq len, it should be more efficient to run N attentions batched in parallel.
It seems that flash-attn already supports variable-length batching, and its varlen functions are even used in the patch scripts.
Is there a reason to prefer masking that I'm missing?
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
-
At the current ollama event, multipack was mentioned as using masking to prevent cross-sequence attention.
However, it seems to me like this needlessly wastes memory - since attention memory/compute is quadratic with seq len, it should be more efficient to run N attentions batched in parallel.
It seems that flash-attn already supports variable-length batching, and its varlen functions are even used in the patch scripts.
Is there a reason to prefer masking that I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions