Skip to content
Merged
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
4 changes: 1 addition & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ def main(job_config: JobConfig):
model = models_parallelize_fns[model_name](
model, world_mesh, parallel_dims, job_config
)
# set this as required by DTensor to work with `to_empty`
# TODO: remove in the future when enabled by default for wrapper subclasses
torch.__future__.set_swap_module_params_on_conversion(True)
# allocate sharded model on GPU and initialize weights via DTensor
model.to_empty(device="cuda")
model.init_weights()

Expand Down