-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[RFC][FSDP2] Renamed FSDP
to FSDPModule
#124955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/124955
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 93cf3c1 with merge base c82fcb7 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
cc mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse H-Huang kwen2501 penguinwu fegin XilunWu wanchaol fduwjj wz337 tianyu-l wconstab yf225 chauhang d4l3k [ghstack-poisoned]
cls = module.__class__ | ||
dct = {"__deepcopy__": unimplemented_deepcopy} | ||
new_cls = type(f"FSDP{cls.__name__}", (FSDP, cls), dct) | ||
new_cls = type(f"FSDP{cls.__name__}", (FSDPModule, cls), dct) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't affect the __repr__
of the wrapped class iiuc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should not.
cc: @wconstab If we land this change, then I think we need to change the PiPPy code to migrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for the heads up RE pippy, i dont mind changing that to match.
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
This PR renames the `FSDP` class to `FSDPModule`. This is a BC breaking change. The rationale is that `FSDPModule` is more descriptive since `fully_shard` is a module-level API (applied to a `module` arg), so the `FSDP` class will always correspond to a module. Also, users commonly import `FullyShardedDataParallel` as `FSDP`, so this can help avoid some name conflict in some cases. Pull Request resolved: #124955 Approved by: https://github.com/wanchaol, https://github.com/wconstab ghstack dependencies: #124651, #124741, #124767, #124768, #124780, #124787
oops. now I will use try-except in TorchTune to import FSDPModule |
Stack from ghstack (oldest at bottom):
FSDP
toFSDPModule
#124955DeviceMesh.from_group()
#124787.to(cpu)
#124768This PR renames the
FSDP
class toFSDPModule
. This is a BC breaking change. The rationale is thatFSDPModule
is more descriptive sincefully_shard
is a module-level API (applied to amodule
arg), so theFSDP
class will always correspond to a module.Also, users commonly import
FullyShardedDataParallel
asFSDP
, so this can help avoid some name conflict in some cases.cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @penguinwu @fegin @XilunWu @wanchaol @fduwjj @wz337 @tianyu-l @wconstab @yf225 @chauhang @d4l3k