Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[perf] Auto causal <> sparse #18

Open
blefaudeux opened this issue Oct 21, 2021 · 0 comments
Open

[perf] Auto causal <> sparse #18

blefaudeux opened this issue Oct 21, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@blefaudeux
Copy link
Contributor

🚀 Feature

When applicable, automatically use sparse or blocksparse for causal attention. Right now this requires that people use them explicitly, even if the causal flag is passed, which means that a lot of people could miss the possible optimization.

Motivation

Free perf on the table, can be a little complex to handle all cases, but would make sense to do it directly in xFormers.

Pitch

Sort out the applicable cases first, and in that case defer to the sparse or blocksparse when ScaledDotProduct is used with the causal flag

Alternatives

Warn users of this possible optim

Additional context

@blefaudeux blefaudeux self-assigned this Oct 21, 2021
@blefaudeux blefaudeux added the enhancement New feature or request label Oct 21, 2021
xwhan pushed a commit to xwhan/xformers that referenced this issue Feb 8, 2022
…configs

[refactor] AttrDict removal, dataclasses all the way + handle patchy defaults
tenpercent pushed a commit to tenpercent/xformers that referenced this issue Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants