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

HSDP + TP integration bug fixes #119819

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
merged 5 commits into from
Feb 14, 2024
Merged

Conversation

mvpatel2000
Copy link
Contributor

Contains bug fixes for the HSDP + TP integration with device_mesh, which was announced in torch 2.2

mvpatel2000 and others added 5 commits February 13, 2024 14:07
Currently, HSDP validates that all intra/inter node PGs are the same. This makes sense if you are only using HSDP with no other forms of parallelism and is a nice but not necessary sanity check.

However, if you want to mix HSDP with other forms, say tensor parallelism on the FFN of a transformer block, the intra/inter node PGs will be different for that layer. This check raises errors in this scenario, so we need to remove this assumption.

Pull Request resolved: pytorch#112435
Approved by: https://github.com/wz337, https://github.com/Skylion007
Removes raising error if a device_mesh has a parent.

The comment says that HSDP + TP is not supported, but I'm able to do 2D parallelism + HSDP fine. The only issues are:
- this check
- pytorch#118618
- a series of PRs related to checkpointing with 3D meshes that I will open
We currently monkeypatch for the above which I am slowly upstreaming.

I imagine torch will have a better, native integration eventually, but this check seems too aggressive in the meantime given DTensor now lets users do some things themselves (which is amazing 🎉)!

Pull Request resolved: pytorch#118620
Approved by: https://github.com/Skylion007
If the user passes `device_mesh`, then we should not forward the process groups to the children during auto wrap and instead just rely on the `device_mesh` argument. This should fix pytorch#118906.

Pull Request resolved: pytorch#119064
Approved by: https://github.com/wz337
Update all_gather to support HSDP + TP.

Currently, the `_all_gather_dtensor` function for dtensors only replaces the first dimension with replicate (the FSDP dimension) and does not touch the second dimension (which is assumed to be the TP dimension). With HSDP, we have two dimensions ahead of the TP dimension as opposed to 1. This PR updates to replace all other dimensions with replicate to run the all-gather.

Pull Request resolved: pytorch#118638
Approved by: https://github.com/fegin, https://github.com/awgu, https://github.com/wz337
Fixes pytorch#118639.

Adds support to replicate across HSDP dimensions instead of sharding for shard placement

Pull Request resolved: pytorch#119481
Approved by: https://github.com/Skylion007, https://github.com/wz337
@pytorch-bot pytorch-bot bot added the release notes: distributed (fsdp) release notes category label Feb 13, 2024
Copy link

pytorch-bot bot commented Feb 13, 2024

🔗 Helpful Links

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

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

❌ 1 New Failure, 3 Unrelated Failures

As of commit 20a5c32 with merge base a8bd593 (image):

NEW FAILURE - The following job has failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

@Skylion007 Skylion007 added the ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR label Feb 14, 2024
@atalman atalman merged commit 0aa3fd3 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
Labels
ciflow/inductor ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR open source release notes: distributed (fsdp) release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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