Skip to content

Add selective weight loading decode kernel for activation sparsity #2213

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

jcaip
Copy link
Contributor

@jcaip jcaip commented May 15, 2025

Summary:

This PR adds in a kernel to accelerate $$xW^T$$ when x is sparse and we are memory bound.

The idea here is that we can avoid loading the columns of $W$ that correspond to the zero elements of $x$.

This lets us accelerate activation sparsity for bs=1 decode use cases. The kernel is an adapted version of https://github.com/FasterDecoding/TEAL

Test Plan:
pytest test/sparsity/test_activation24.py

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:

This PR adds in a kernel to accelerate $$xW^T$$ when x is sparse and we
are memory bound.

The idea here is that we can avoid loading the columns of $W$ that
correspond to the zero elements of $x$.

This lets us accelerate activation sparsity for bs=1 decode use cases.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented May 15, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2213

Note: Links to docs will display an error until the docs builds have been completed.

❌ 9 New Failures

As of commit 9e33323 with merge base 4c6188f (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 15, 2025
@jcaip jcaip added the topic: new feature Use this tag if this PR adds a new feature label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: new feature Use this tag if this PR adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants