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

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

Closed
wants to merge 1 commit into from

Conversation

fegin
Copy link
Contributor

@fegin fegin commented Jan 24, 2024

Stack from ghstack (oldest at bottom):

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

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @XilunWu @wanchaol @fduwjj @wz337 @tianyu-l @wconstab @yf225

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 force `_gather_state_dict()` to be synchronous with respect to the mian stream.

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

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jan 24, 2024

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit c23292f with merge base cef5b93 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@github-actions github-actions bot added the oncall: distributed Add this issue/PR to distributed oncall triage queue label Jan 24, 2024
@fegin fegin changed the title [state_dict] Calling wait() for DTensor redistribution [state_dict] Calls wait() for the DTensor to_local() result Jan 24, 2024
@fegin fegin requested review from awgu and wz337 January 24, 2024 17:20
@fegin fegin added the topic: not user facing topic category label Jan 24, 2024
@fegin fegin requested a review from LucasLLC January 24, 2024 17:20
Copy link
Contributor

@wz337 wz337 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@LucasLLC LucasLLC left a comment

Choose a reason for hiding this comment

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

lgtm!

@fegin fegin added ciflow/trunk Trigger trunk jobs on your pull request ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR labels Jan 24, 2024
@facebook-github-bot
Copy link
Contributor

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@kwen2501
Copy link
Contributor

Maybe add a TODO here (to change things back) in case the ACT + torch.clone bug is fixed?

pytorchmergebot pushed a commit that referenced this pull request Jan 25, 2024
pytorchmergebot pushed a commit that referenced this pull request Jan 26, 2024
pytorchmergebot pushed a commit that referenced this pull request Jan 29, 2024
D53049807 and #118197 got out of sync somehow

Fixing externally since I'm pretty sure the internal version is correct

Pull Request resolved: #118509
Approved by: https://github.com/malfet
jeffdaily pushed a commit to ROCm/pytorch that referenced this pull request Feb 8, 2024
D53049807 and pytorch#118197 got out of sync somehow

Fixing externally since I'm pretty sure the internal version is correct

Pull Request resolved: pytorch#118509
Approved by: https://github.com/malfet
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Feb 12, 2024
…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
yoyoyocmu added a commit to yoyoyocmu/pytorch that referenced this pull request Feb 12, 2024
…e dict loading

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
pytorchmergebot pushed a commit that referenced this pull request Feb 13, 2024
…e dict loading (#119716)

Summary:
This PR serves as a follow-up fix to address numerical correctness concerns identified in PR #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: #119716
Approved by: https://github.com/fegin, https://github.com/Skylion007, https://github.com/wz337
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Feb 13, 2024
…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
atalman pushed a commit that referenced this pull request Feb 14, 2024
…#119692)

Co-authored-by: Chien-Chin Huang <chienchin@fb.com>
Co-authored-by: Yue Dong <yoyoyod@meta.com>
resolved: #118197
fix to address numerical correctness concerns identified in PR #118197, and we should only wait on `AsyncCollectiveTensor`.
resolved: #119716
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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