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

Fsdp pytorch draft PR #823

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Draft

Conversation

davidtweedle
Copy link

A draft PR for potential changes for the pytorch workloads to upgrade to FSDP (fully sharded data parallel) from DDP (distributed data parallel).

Summary for changes to: cifar, mnist, criteo1tb, imagenet vit, imagenet resnet, librispeech deepspeech, librispeech conformer, ogbg, wmt, fastmri

  • import required packages (e.g., fsdp)
  • construct model using FSDP constructor instead of DDP constructor
  • very naive sharding for now
  • Crucially: must zero grad before eval

Summary for changes to momentum (as simple test optimizer):

  • first compute weighted loss on each device
  • then loss.backward (the gradient of the losses will now be all reduced by a pytorch communication hook)
  • then display the correct loss

Copy link

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

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.

1 participant