Fix setup_model typos in Fabric (#17498)
This commit is contained in:
parent
6b6594b831
commit
abc634d17c
|
@ -835,7 +835,7 @@ class Fabric:
|
|||
if isinstance(self._strategy, FSDPStrategy) and not _TORCH_GREATER_EQUAL_2_0:
|
||||
raise RuntimeError(
|
||||
f"The `{type(self).__name__}` requires the model and optimizer(s) to be set up separately."
|
||||
" Create and set up the model first through `model = self.setup_model(model)`. Then create the"
|
||||
" Create and set up the model first through `model = self.setup_module(model)`. Then create the"
|
||||
" optimizer and set it up: `optimizer = self.setup_optimizer(optimizer)`."
|
||||
)
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ def test_amp_fused_optimizer_parity():
|
|||
seed_everything(1234)
|
||||
fabric = Fabric(accelerator="cuda", precision=16, devices=1)
|
||||
|
||||
model = nn.Linear(10, 10).to(fabric.device) # TODO: replace with individual setup_model call
|
||||
model = nn.Linear(10, 10).to(fabric.device) # TODO: replace with individual setup_module call
|
||||
optimizer = torch.optim.Adam(model.parameters(), lr=1.0, fused=fused)
|
||||
|
||||
model, optimizer = fabric.setup(model, optimizer)
|
||||
|
|
Loading…
Reference in New Issue