Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[state_dict] Calls wait() for the DTensor to_local() result (#118197) #119692

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

Merged

Conversation

Skylion007
Copy link
Collaborator

See the discussion in #117799.

There are some issues when returning a AsyncCollectiveTensor (haven't found the root causes), including OOM and unexpected values.

This PR forces _gather_state_dict() to be synchronous with respect to the mian stream.

Differential Revision: D53049807

Pull Request resolved: #118197
Approved by: https://github.com/wz337, https://github.com/LucasLLC

Fixes #ISSUE_NUMBER

…118197)

See the discussion in pytorch#117799.

There are some issues when returning a AsyncCollectiveTensor (haven't found the
root causes), including OOM and unexpected values.

This PR forces `_gather_state_dict()` to be synchronous with respect to the mian stream.

Differential Revision: [D53049807](https://our.internmc.facebook.com/intern/diff/D53049807/)

Pull Request resolved: pytorch#118197
Approved by: https://github.com/wz337, https://github.com/LucasLLC
…e dict loading (pytorch#119716)

Summary:
This PR serves as a follow-up fix to address numerical correctness concerns identified in PR pytorch#118197, and we should only wait on `AsyncCollectiveTensor`.

Without the change, we occasionally ran into exception: `AttributeError("'Tensor' object has no attribute 'wait'")`

Test Plan:
**CI**:
Wait for the CI test

**Test with prod model**:
- Tested with models and no-longer ran into the exception after checkpoint loading.

Differential Revision: D53680406

Pull Request resolved: pytorch#119716
Approved by: https://github.com/fegin, https://github.com/Skylion007, https://github.com/wz337
Copy link

pytorch-bot bot commented Feb 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/119692

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 341e7e9 with merge base a8bd593 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@atalman atalman merged commit 24e4751 into pytorch:release/2.2 Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.