Skip to content

Conversation

@jainapurva
Copy link
Contributor

@jainapurva jainapurva commented Nov 3, 2025

This pull request moves CutlassInt4PackedLayout and its implementation from torchao/dtypes/uintx/cutlass_int4_packed_layout.py to torchao/prototype/dtypes/uintx/cutlass_int4_packed_layout.py, and exposed it via torchao.prototype.dtypes while maintaining BC at torchao.prototype.dtypes.uintx with a deprecation warning for torchao v0.16.0.
Updates API documentation to reflect the changes

Reference Issue: #2752

Removed unused exports from block_sparse_layout.py
…orts

- Move torchao/prototype/sparsity/block_sparse_layout.py to torchao/prototype/dtypes/uintx/block_sparse_layout.py
- Update all imports to use 'from torchao.prototype.dtypes import BlockSparseLayout'
- Update deprecation warning message
- Create torchao/prototype/dtypes/__init__.py and torchao/prototype/dtypes/uintx/__init__.py
- Remove BlockSparseLayout from torchao/prototype/sparsity/__init__.py
- Update documentation
- Moved cutlass_int4_packed_layout.py from torchao/dtypes/uintx/ to torchao/prototype/dtypes/uintx/
- Created torchao/prototype/dtypes/__init__.py and uintx/__init__.py to export CutlassInt4PackedLayout
- Replaced old file with backward compatibility stub that imports from new location
- Added deprecation warning for old import path (to be removed in v0.16.0)
- Updated torchao/dtypes/__init__.py to re-export from prototype for backward compatibility
- Updated internal imports in affine_quantized_tensor_ops.py to use new prototype location
- Removed CutlassInt4PackedLayout from torchao/dtypes/uintx/__init__.py to avoid circular imports
- Updated documentation to move CutlassInt4PackedLayout to Prototype section

All import paths work:
  - New: from torchao.prototype.dtypes import CutlassInt4PackedLayout
  - Backward compat: from torchao.dtypes import CutlassInt4PackedLayout
  - Deprecated: from torchao.dtypes.uintx.cutlass_int4_packed_layout import CutlassInt4PackedLayout
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 3, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 5 Pending

As of commit 531b07b with merge base 42f28f7 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla meta-cla 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 Nov 3, 2025
@jainapurva jainapurva changed the base branch from main to move_block_sparsity November 3, 2025 06:04
Removed unused import for CutlassInt4PackedLayout.
Removed __all__ exports from cutlass_int4_packed_layout.py
@jainapurva jainapurva force-pushed the move_cutlass_int4_packed_layout branch from 6c03ed4 to 8c18d4d Compare November 3, 2025 22:29
@jainapurva jainapurva requested a review from jerryzh168 November 3, 2025 22:34
@jainapurva jainapurva added the topic: bc-breaking Use this tag if this PR breaks backward compatibility label Nov 3, 2025
@jainapurva jainapurva marked this pull request as ready for review November 3, 2025 22:38
@jainapurva jainapurva changed the base branch from move_block_sparsity to main November 3, 2025 22:40
FloatxTensor
FloatxTensorCoreLayout
MarlinSparseLayout
BlockSparseLayout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's both? maybe try to split would be better, or update the summary to say it's two things

Copy link
Contributor Author

@jainapurva jainapurva Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in two separate PRs:
Pr for BlockSparseLayout: #3276

This one is for CutlassInt4PackedLayout

@jainapurva jainapurva changed the base branch from main to move_block_sparsity November 4, 2025 18:27
)
from torchao.dtypes.uintx.plain_layout import (
_aqt_is_int8,
warnings.warn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add #2752 to the message

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, I'd remove torchao v0.16.0 and just say "in a future release of torchao", just in case the work gets delayed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still prefer adding a deprecation timeline, maybe we can add it in the issue description

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, add it to the issue! that way it can be modified without a code change.

@jainapurva jainapurva changed the base branch from move_block_sparsity to main November 5, 2025 20:49
@jainapurva jainapurva merged commit aadfded into main Nov 5, 2025
21 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: bc-breaking Use this tag if this PR breaks backward compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants