Move BlockSparseWeightConfig to prototype and deprecate torchao.sparsity imports (#4230)#4232
Open
jerryzh168 wants to merge 5 commits intogh/jerryzh168/78/basefrom
Open
Move BlockSparseWeightConfig to prototype and deprecate torchao.sparsity imports (#4230)#4232jerryzh168 wants to merge 5 commits intogh/jerryzh168/78/basefrom
jerryzh168 wants to merge 5 commits intogh/jerryzh168/78/basefrom
Conversation
BlockSparseWeightConfig is deprecated and will be removed in a future release. A warning is now emitted on instantiation pointing users to the tracking issue for more details. Deprecation Note: # 0.17: BlockSparseWeightConfig(blocksize) # 0.18 (deprecated): BlockSparseWeightConfig(blocksize) # 0.19 (removed): See #4230 for more details. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4232
Note: Links to docs will display an error until the docs builds have been completed. ❌ 6 New Failures, 2 Unrelated FailuresAs of commit 3a29570 with merge base a302c10 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
jerryzh168
added a commit
that referenced
this pull request
Apr 3, 2026
BlockSparseWeightConfig is deprecated and will be removed in a future release. A warning is now emitted on instantiation pointing users to the tracking issue for more details. Deprecation Note: # 0.17: BlockSparseWeightConfig(blocksize) # 0.18 (deprecated): BlockSparseWeightConfig(blocksize) # 0.19 (removed): See #4230 for more details. ghstack-source-id: 165273f Pull Request resolved: #4232
BlockSparseWeightConfig is deprecated and will be removed in a future release. A warning is now emitted on instantiation pointing users to the tracking issue for more details. Deprecation Note: ``` # 0.17: BlockSparseWeightConfig(blocksize) # 0.18 (deprecated): BlockSparseWeightConfig(blocksize) # 0.19 (removed): See #4230 for more details. ``` [ghstack-poisoned]
jerryzh168
added a commit
that referenced
this pull request
Apr 17, 2026
…ity imports (#4230) BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor The old import paths will be removed in a future release. See #4230 for more details. ghstack-source-id: 6bc1af1 Pull Request resolved: #4232
…rchao.sparsity imports (#4230)" BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor The old import paths will be removed in a future release. See #4230 for more details. [ghstack-poisoned]
jerryzh168
added a commit
that referenced
this pull request
Apr 17, 2026
…ity imports (#4230) BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor The old import paths will be removed in a future release. See #4230 for more details. ghstack-source-id: 6bc1af1 Pull Request resolved: #4232
…rchao.sparsity imports (#4230)" BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: ``` Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor ``` The old import paths will be removed in a future release. See #4230 for more details. [ghstack-poisoned]
jerryzh168
added a commit
that referenced
this pull request
Apr 17, 2026
…ity imports (#4230) BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor The old import paths will be removed in a future release. See #4230 for more details. ghstack-source-id: e3cc825 Pull Request resolved: #4232
…rchao.sparsity imports (#4230)" BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: ``` Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor ``` The old import paths will be removed in a future release. See #4230 for more details. [ghstack-poisoned]
jerryzh168
added a commit
that referenced
this pull request
Apr 17, 2026
…ity imports (#4230) BlockSparseWeightConfig, BlockSparseTensor, and related code have been moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports remain in the old location and emit DeprecationWarnings to guide users to the new paths. The block sparse test has also been moved to test/prototype/test_blocksparse.py. Deprecation Note: Importing BlockSparseWeightConfig (or its alias block_sparse_weight) from torchao.sparsity is deprecated. Please update your imports: # Before (deprecated): from torchao.sparsity import block_sparse_weight from torchao.sparsity import BlockSparseWeightConfig from torchao.sparsity.blocksparse import BlockSparseTensor # After: from torchao.prototype.sparsity import block_sparse_weight from torchao.prototype.sparsity import BlockSparseWeightConfig from torchao.prototype.sparsity.blocksparse import BlockSparseTensor The old import paths will be removed in a future release. See #4230 for more details. ghstack-source-id: 017f502 Pull Request resolved: #4232
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
BlockSparseWeightConfig, BlockSparseTensor, and related code have been
moved from torchao.sparsity to torchao.prototype.sparsity. Stub imports
remain in the old location and emit DeprecationWarnings to guide users
to the new paths. The block sparse test has also been moved to
test/prototype/test_blocksparse.py.
Deprecation Note:
The old import paths will be removed in a future release.
See #4230 for more details.