Skip to content
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

add a deprecation warning for float8 delayed and static scaling #1681

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchao/float8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ for _ in range(10):

## float8 linear with delayed scaling

:warning: <em>We plan to deprecate delayed scaling in a future release, see /~https://github.com/pytorch/ao/issues/1680 for more details.</em>

This is theoretically the most performant recipe as it minimizes memory reads.

```python
Expand Down
10 changes: 10 additions & 0 deletions torchao/float8/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,16 @@ def __post_init__(self):
"When using FSDP, it's recommended to enable config.force_recompute_fp8_weight_in_bwd."
)

# Future deprecation warning for delayed scaling
if (
self.cast_config_input.scaling_type != ScalingType.DYNAMIC
or self.cast_config_weight.scaling_type != ScalingType.DYNAMIC
or self.cast_config_grad_output.scaling_type != ScalingType.DYNAMIC
):
logger.warning(
"Note: delayed and static scaling will be deprecated in a future release of torchao. Please see /~https://github.com/pytorch/ao/issues/1680 for more details."
)


# Pre-made recipes for common configurations
# TODO(future PR): go through a round of design on this, and eventually expose
Expand Down
Loading