Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Update on "[2/x] clean up casting functions: delayed scaling"
Browse files Browse the repository at this point in the history
Summary:

Removes delayed scaling from `float8_tensor.py`. After this PR, the
invariant is that everything in `float8_tensor.py` requires the scale to
be calculated elsewhere. This moves the codebase towards separation of
concerns for calculating the scale (via various scaling strategies),
separated from creating an instance of `Float8Tensor`.

Note that stateful delayed scaling is the reason we need this separation.

Test Plan:

```
./test/test_everything.sh
```

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D60291447](https://our.internmc.facebook.com/intern/diff/D60291447)

[ghstack-poisoned]
  • Loading branch information
vkuzo committed Jul 26, 2024
1 parent 09d770e commit e7c0463
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
get_float8_layers,
sync_float8_amax_and_scale_history,
)
from float8_experimental.float8_scaling_utils import cast_to_float8_delayed
from float8_experimental.float8_tensor import LinearMMConfig
from float8_experimental.float8_utils import e4m3_dtype
from float8_experimental.float8_scaling_utils import cast_to_float8_delayed

from torch._dynamo.test_case import TestCase as DynamoTestCase
from torch._dynamo.testing import CompileCounterWithBackend
Expand Down

0 comments on commit e7c0463

Please sign in to comment.