Skip to content

migrate sparsify_ to configs #1856

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

Merged
merged 50 commits into from
Mar 12, 2025
Merged

migrate sparsify_ to configs #1856

merged 50 commits into from
Mar 12, 2025

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Mar 7, 2025

Summary:

Before:

sparsify_(model, semi_sparse_weight())
sparsify_(model, block_sparse_weight(64))

After:

# new syntax
sparsify_(model, SemiSparseWeightConfig())
sparsify_(model, BlockSparseWeightConfig(64))

# old syntax still works
sparsify_(model, semi_sparse_weight())
sparsify_(model, block_sparse_weight(64))

Test Plan:

pytest test/sparsity/test_sparse_api.py -s -x

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 7 commits March 7, 2025 06:48
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Copy link

pytorch-bot bot commented Mar 7, 2025

🔗 Helpful Links

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

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

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 Mar 7, 2025
vkuzo added a commit that referenced this pull request Mar 7, 2025
Summary:

Before:

```python
sparsify_(model, semi_sparse_weight())
sparsify_(model, block_sparse_weight(64))
```

After:

```
sparsify_(model, SemiSparseWeightConfig())
sparsify_(model, BlockSparseWeightConfig(64))

sparsify_(model, semi_sparse_weight())
sparsify_(model, block_sparse_weight(64))
```

Test Plan:

```
pytest test/sparsity/test_sparse_api.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: dc9dd9d
ghstack-comment-id: 2706995209
Pull Request resolved: #1856
@vkuzo vkuzo added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Mar 7, 2025
@vkuzo vkuzo mentioned this pull request Mar 7, 2025
vkuzo added 4 commits March 7, 2025 09:51
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 5 commits March 7, 2025 10:42
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 3 commits March 8, 2025 06:15
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/58/head to gh/vkuzo/59/head March 8, 2025 14:15
vkuzo added 14 commits March 8, 2025 12:16
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 2 commits March 10, 2025 15:47
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 3 commits March 12, 2025 10:17
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/59/head to main March 12, 2025 20:56
@vkuzo vkuzo merged commit 83a2e28 into main Mar 12, 2025
11 of 12 checks passed
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: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants