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

[AnyPrecision optimizer] add automatic BF16 support check (network and gpu) #65

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lessw2020
Copy link
Contributor

What does this PR do? Please describe:
Adds an automatic check for BFloat16 support to AnyPrecision optimizer (self.verify_bfloat_support()).
This happens at optimizer init if any of the relevant states are using torch.bfloat16.
This checks both GPU and Network (NCCL) BFloat16 support, and errs out with both error message and an exception if it fails.

Fixes #{issue number}

Does your PR introduce any breaking changes? If yes, please list them:
List of all backwards-incompatible API changes.

Check list:

  • Was this discussed and approved via a GitHub issue? (not for typos or docs)
  • Did you read the contributor guideline?
  • Did you make sure that your PR does only one thing instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, or minor internal changes)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 13, 2022
@lessw2020 lessw2020 changed the title add automatic BF16 support check (network and gpu) [AnyPrecision optimizer] add automatic BF16 support check (network and gpu) Sep 13, 2022
Copy link
Member

@rohan-varma rohan-varma left a comment

Choose a reason for hiding this comment

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

some comments, also looks like CI is failing

@rohan-varma rohan-varma self-requested a review September 19, 2022 22:40
Copy link
Member

@rohan-varma rohan-varma left a comment

Choose a reason for hiding this comment

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

LGTM, but before merging, let's add unittests to ensure correctness. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants