Delete deprecated TensorCoreTiledLayout and related code#4153
Conversation
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
…nd related code [ghstack-poisoned]
… paths - Remove PlainLayout class from dtypes/utils.py - Delete torchao/dtypes/uintx/plain_layout.py - Remove int8 weight and int8 dynamic activation dispatch from AQT dispatch table - Remove AQT embedding dispatch (used PlainAQTTensorImpl) - Change Int8WeightOnlyConfig default to version=2 (removes v1 AQT path) - Change Int8DynamicActivationInt8WeightConfig default to version=2 (removes v1 AQT path) - Remove PlainLayout from public exports - Update tests to use v2 tensor types [ghstack-poisoned]
- Copy bitpacking.py from torchao/dtypes/uintx/ to torchao/prototype/dtypes/uintx/ (original was deleted in the previous commit) - Add uintx_utils.py with UintxTensor and UintxLayout classes needed by autoround and codebook features until they migrate to the new quantization design [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4153
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7415455 with merge base 3e6c496 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly ghstack-source-id: 7132050 Pull Request resolved: #4153
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly ghstack-source-id: c23e77a Pull Request resolved: #4153
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly ghstack-source-id: 863d91a Pull Request resolved: #4153
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
|
@claude review |
|
Claude finished @jerryzh168's task in 2m 20s —— View job Review: Delete deprecated TensorCoreTiledLayout and related code
Overall this is a clean deprecation removal. The changes are straightforward and consistent across the codebase. A few observations: Looks Good
Minor Issues
SummaryThe PR is a clean removal of deprecated code. The two actionable items are the stale comment at |
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
|
@claude review again |
|
Claude finished @jerryzh168's task in 5m 10s —— View job Review: Delete deprecated TensorCoreTiledLayout and related code
This is a clean deprecation removal with complete reference cleanup. All stale comments from the previous review ( Potential Correctness Bug
The new code replaces the old Old code path: return to_affine_quantized_intx_static(
input_float=input_float, # qdq float weight from auto-round
scale=pad_scale,
zero_point=pad_shifted_zero_point,
...
zero_point_domain=ZeroPointDomain.FLOAT,
_layout=TensorCoreTiledLayout(...),
)This called mid_point = (quant_max + quant_min + 1) / 2 # 8 for uint4
min_val = zero_point - scale * mid_point
quant = clamp(round((input - min_val) / scale), quant_min, quant_max)New code: int_data = torch.clamp(
torch.round(input_float_padded).to(torch.int32),
quant_min,
quant_max,
)
This path is not covered by existing tests ( Looks Good
Remaining Item from Prior Review
|
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
…d related code" - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
- Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
|
@claude review |
|
Claude finished @jerryzh168's task in 3m 39s —— View job Review: Delete deprecated TensorCoreTiledLayout and related code
Clean deprecation removal. All previous review issues have been addressed — the correctness bug in autoround quantization is fixed, stale Verified Changes
One Remaining Note
|
|
@claude regard "torchao/dtypes/uintx/init.py should be deleted — The file now contains only all = []. No imports use the torchao.dtypes.uintx package (existing imports go directly to torchao.dtypes.uintx.plain_layout). This was #4153 (comment) in the prior review." I tried to remove but some import failed, so I'm going to do it later |
|
Claude finished @jerryzh168's task in 34s —— View job Acknowledging feedback on
|
Replace deleted TensorCoreTiledLayout with Int4PackingFormat.TILE_PACKED_TO_4D in torchtune's Int4WeightOnlyQuantizer to fix the import error caused by the upstream torchao change in pytorch/ao#4153.
Replace deleted TensorCoreTiledLayout with Int4PackingFormat.TILE_PACKED_TO_4D in torchtune's Int4WeightOnlyQuantizer to fix the import error caused by the upstream torchao change in pytorch/ao#4153.
* Delete deprecated BlockSparseLayout and related code - Delete torchao/dtypes/uintx/tensor_core_tiled_layout.py - Remove TensorCoreTiledLayout dispatch from AQT dispatch table - Remove TensorCoreTiledLayout from all public exports - Remove LAYOUT_TO_ZERO_POINT_DOMAIN and LAYOUT_TO_PRESERVE_ZEROS dicts - Remove TensorCoreTiledLayout padding logic from AffineQuantizedTensor.dequantize - Simplify HQQ path in AffineQuantizedTensor to always use raw_output=True - Remove dead v1 code path in fake_quantize_config.py - Update autoround to use Int4TilePackedTo4dTensor directly [ghstack-poisoned]
Stack from ghstack (oldest at bottom):