Skip to content
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

update FSDPTransform to delegate materialization to the MaterializationTransform #995

Merged
merged 21 commits into from
Aug 20, 2024

Conversation

t-vi
Copy link
Collaborator

@t-vi t-vi commented Aug 19, 2024

This is the fourth / final step for #987 .

After this, the FSDP transform plays well with Materialization Transform and should also work with previous transforms (however, the bnb quantization changes tensor layout in a way not terribly amenable to sharding, this needs investigation).

This is a draft to remember to update the branch.

cc: @crcrpar

Edit I need to do my rebasing homework. This PR only changes files in distributed/ the others are from a merge with #980 which will go away after rebasing.

thunder/core/module.py Outdated Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Outdated Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Outdated Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Outdated Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Outdated Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Outdated Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Show resolved Hide resolved
thunder/transforms/materialization.py Outdated Show resolved Hide resolved
thunder/tests/test_transforms.py Outdated Show resolved Hide resolved
@t-vi t-vi force-pushed the tom/fsdp-composable-step3 branch from 4ce64b7 to be3c931 Compare August 19, 2024 12:32
t-vi and others added 3 commits August 19, 2024 15:05
Co-authored-by: Masaki Kozuki <mkozuki@nvidia.com>
Co-authored-by: Masaki Kozuki <mkozuki@nvidia.com>
@t-vi t-vi force-pushed the tom/fsdp-composable-step4 branch from bdc0f4b to 4ae9d49 Compare August 19, 2024 13:14
@t-vi
Copy link
Collaborator Author

t-vi commented Aug 19, 2024

I need to investigate the failing test in test_transforms in more detail, the FSDP part seems in good shape.

Base automatically changed from tom/fsdp-composable-step3 to main August 20, 2024 08:41
@t-vi t-vi marked this pull request as ready for review August 20, 2024 08:42
@t-vi t-vi requested review from mruberry and lantiga as code owners August 20, 2024 08:42
Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, although to @crcrpar's point I'm not sure about no_grad for broadcast - we weren't doing it earlier.

thunder/core/transforms.py Show resolved Hide resolved
thunder/distributed/transforms/fsdp_v2.py Outdated Show resolved Hide resolved
t-vi and others added 2 commits August 20, 2024 15:56
Co-authored-by: Luca Antiga <luca@lightning.ai>
@t-vi t-vi enabled auto-merge (squash) August 20, 2024 14:15
@t-vi t-vi merged commit 820a7d2 into main Aug 20, 2024
37 checks passed
@t-vi t-vi deleted the tom/fsdp-composable-step4 branch August 20, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants