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

Commit

Permalink
fix README.md description of swap_linear_with_float8_linear (#319)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #319

Bringing the readme up to date with the PR that deleted
`Float8DynamicLinear`.

Reviewed By: wanchaol

Differential Revision: D59874121

fbshipit-source-id: e2af494e2b34889b580bedc341caaead345028f1
  • Loading branch information
vkuzo authored and facebook-github-bot committed Jul 18, 2024
1 parent 38c02fe commit e6bb1eb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ from float8_experimental.float8_linear_utils import (
swap_linear_with_float8_linear,
)
from float8_experimental.fsdp_utils import precompute_float8_dynamic_scale_for_fsdp
from float8_experimental.float8_linear import Float8Linear

# create model
m = Model(...)

# convert all `torch.nn.Linear` modules to `Float8Linear`
swap_linear_with_float8_linear(m, Float8Linear)
swap_linear_with_float8_linear(m)

# optional: use FSDP
model = FSDP(model, use_orig_params=True)
Expand Down Expand Up @@ -76,7 +75,7 @@ from float8_experimental.float8_linear_utils import (
swap_linear_with_float8_linear,
sync_float8_amax_and_scale_history,
)
from float8_experimental.float8_linear import Float8Linear, TensorScalingType
from float8_experimental.float8_linear import TensorScalingType

# create model
m = Model(...)
Expand All @@ -85,7 +84,6 @@ m = Model(...)
# type
swap_linear_with_float8_linear(
m,
Float8Linear,
scaling_type_x=TensorScalingType.DELAYED,
scaling_type_w=TensorScalingType.DELAYED,
scaling_type_dL_dY=TensorScalingType.DELAYED,
Expand Down

0 comments on commit e6bb1eb

Please sign in to comment.