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

PyTorch 2.1 support #265

Open
schmidt-ai opened this issue Oct 12, 2023 · 3 comments · May be fixed by #281
Open

PyTorch 2.1 support #265

schmidt-ai opened this issue Oct 12, 2023 · 3 comments · May be fixed by #281

Comments

@schmidt-ai
Copy link

Looks like there are some breaking changes to the FSDP API in PyTorch 2.1.

For example, dinov2.fsdp.__init__.py::free_if_fsdp is broken when using torch==2.1: AttributeError: 'DinoVisionTransformer' object has no attribute '_handles'

@qasfb
Copy link
Contributor

qasfb commented Oct 13, 2023

Thanks for reporting ! We are still working on the transition to PT2.1 @patricklabatut

@schmidt-ai
Copy link
Author

Glad to hear it. Lmk if I can help.

@dsuess
Copy link

dsuess commented Oct 23, 2023

I found the following works in pytorch 2.1:

def free_if_fsdp(x: FSDP):
    if is_sharded_fsdp(x) and x._has_params:
        handle = x._handle
        _reshard(x, handle, True)

@schmidt-ai schmidt-ai linked a pull request Oct 26, 2023 that will close this issue
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 a pull request may close this issue.

3 participants