mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Internal only: the before way meant that `from torch.distributed._composable.fsdp import fully_shard` was importing `fully_shard.py` not the function `fully_shard`. For some reason, the resolution order is different from open source. To fix this, we match the old import as closely as possible. Namely, we import `fully_shard.py` contents from `.fully_shard`. This should force that import to take precedence. @diff-train-skip-merge Differential Revision: [D66990327](https://our.internmc.facebook.com/intern/diff/D66990327) Pull Request resolved: https://github.com/pytorch/pytorch/pull/142419 Approved by: https://github.com/weifengpy