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

Move logic for distopt FP32 grads to models #8867

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

timmoon10
Copy link
Collaborator

What does this PR do ?

#8792 introduced some runtime failures in T5 since it adds GPT-specific logic to MegatronBaseModel. This PR moves the distopt FP32 grad logic to the specific models.

Collection: NLP

Changelog

  • Move logic for distopt FP32 grads to models

Usage

Run T5, e.g. with the config at https://github.com/NVIDIA/NeMo/blob/main/examples/nlp/language_modeling/conf/megatron_t5_config.yaml.

Enable the distributed optimizer with model.optim.name=distributed_fused_adam.

Jenkins CI

To run Jenkins, a NeMo User with write access must comment jenkins on the PR.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

Signed-off-by: Tim Moon <tmoon@nvidia.com>
@timmoon10 timmoon10 added the bug Something isn't working label Apr 9, 2024
@github-actions github-actions bot added the NLP label Apr 9, 2024
@timmoon10
Copy link
Collaborator Author

jenkins

@ericharper ericharper self-requested a review April 9, 2024 23:17
@timmoon10
Copy link
Collaborator Author

jenkins

ericharper
ericharper previously approved these changes Apr 9, 2024
Copy link
Collaborator

@ericharper ericharper left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@ericharper
Copy link
Collaborator

jenkins

Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
@timmoon10
Copy link
Collaborator Author

jenkins

1 similar comment
@ericharper
Copy link
Collaborator

jenkins

ericharper and others added 2 commits April 10, 2024 08:51
@timmoon10
Copy link
Collaborator Author

jenkins

Copy link
Collaborator

@ericharper ericharper left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@ericharper ericharper merged commit f7941cb into NVIDIA:main Apr 10, 2024
10 checks passed
anmolgupt pushed a commit to anmolgupt/NeMo that referenced this pull request Apr 11, 2024
* Move logic for FP32 embedding grads to models

Signed-off-by: Tim Moon <tmoon@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Harper <complex451@gmail.com>
ftxj pushed a commit to ftxj/NeMo that referenced this pull request Apr 12, 2024
* Move logic for FP32 embedding grads to models

Signed-off-by: Tim Moon <tmoon@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Harper <complex451@gmail.com>
Signed-off-by: jxin <jxin@nvidia.com>
suiyoubi pushed a commit that referenced this pull request May 2, 2024
* Move logic for FP32 embedding grads to models

Signed-off-by: Tim Moon <tmoon@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Harper <complex451@gmail.com>
Signed-off-by: Ao Tang <aot@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NLP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants