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

[NeMo-UX] Use single instance of loss reductions in GPTModel #9801

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

hemildesai
Copy link
Collaborator

@hemildesai hemildesai commented Jul 18, 2024

What does this PR do ?

Uses a singleton for training_loss_reduction and validation_loss_reduction in GPTModel.

Collection: llm

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

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

  • Related to # (issue)

@hemildesai hemildesai changed the title Use single instance of loss reductions [NeMo-UX] Use single instance of loss reductions Jul 18, 2024
@hemildesai hemildesai changed the title [NeMo-UX] Use single instance of loss reductions [NeMo-UX] Use single instance of loss reductions in GPTModel Jul 18, 2024
@hemildesai hemildesai force-pushed the hemil/potential-memory-fix branch from b66e35d to 6306228 Compare July 18, 2024 22:22
@ShriyaPalsamudram ShriyaPalsamudram self-assigned this Jul 19, 2024
@hemildesai hemildesai marked this pull request as ready for review July 19, 2024 18:36
Copy link
Collaborator

@ShriyaPalsamudram ShriyaPalsamudram left a comment

Choose a reason for hiding this comment

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

Functionality works

Comment on lines 28 to 29
TRAIN_LOSS_REDUCTION = MaskedTokenLossReduction()
VALIDATION_LOSS_REDUCTION = MaskedTokenLossReduction(validation_step=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's comment that this is a temporary WAR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or remove the globals.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Member

@akoumpa akoumpa left a comment

Choose a reason for hiding this comment

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

LGTM,

Alternatively we could decorate training_loss_reduction & validation_loss_reduction with @cache, but I have no preference. Please proceed with the merge.

Thanks.

@hemildesai hemildesai force-pushed the hemil/potential-memory-fix branch 2 times, most recently from 6d35351 to 537259b Compare July 23, 2024 16:14
hemildesai and others added 3 commits July 23, 2024 12:14
@hemildesai hemildesai force-pushed the hemil/potential-memory-fix branch from 537259b to eded322 Compare July 23, 2024 19:14
@hemildesai hemildesai merged commit 0ba1991 into r2.0.0rc1 Jul 24, 2024
184 of 225 checks passed
@hemildesai hemildesai deleted the hemil/potential-memory-fix branch July 24, 2024 07:35
github-actions bot pushed a commit that referenced this pull request Jul 24, 2024
* Use single instance of loss reductions

Signed-off-by: Hemil Desai <[email protected]>

* Apply isort and black reformatting

Signed-off-by: hemildesai <[email protected]>

* Refactor

Signed-off-by: Hemil Desai <[email protected]>

---------

Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: hemildesai <[email protected]>
Co-authored-by: hemildesai <[email protected]>
hemildesai added a commit that referenced this pull request Jul 31, 2024
* Use single instance of loss reductions

Signed-off-by: Hemil Desai <[email protected]>

* Apply isort and black reformatting

Signed-off-by: hemildesai <[email protected]>

* Refactor

Signed-off-by: Hemil Desai <[email protected]>

---------

Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: hemildesai <[email protected]>
Co-authored-by: hemildesai <[email protected]>
hemildesai added a commit that referenced this pull request Aug 1, 2024
…9861)

* Use single instance of loss reductions



* Apply isort and black reformatting



* Refactor



---------

Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: hemildesai <[email protected]>
Co-authored-by: Hemil Desai <[email protected]>
Co-authored-by: hemildesai <[email protected]>
adityavavre pushed a commit to adityavavre/NeMo that referenced this pull request Sep 15, 2024
…9801) (NVIDIA#9861)

* Use single instance of loss reductions

* Apply isort and black reformatting

* Refactor

---------

Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: hemildesai <[email protected]>
Co-authored-by: Hemil Desai <[email protected]>
Co-authored-by: hemildesai <[email protected]>
Signed-off-by: adityavavre <[email protected]>
monica-sekoyan pushed a commit that referenced this pull request Oct 14, 2024
…9861)

* Use single instance of loss reductions



* Apply isort and black reformatting



* Refactor



---------

Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: hemildesai <[email protected]>
Co-authored-by: Hemil Desai <[email protected]>
Co-authored-by: hemildesai <[email protected]>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
…9801) (NVIDIA#9861)

* Use single instance of loss reductions



* Apply isort and black reformatting



* Refactor



---------

Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: hemildesai <[email protected]>
Co-authored-by: Hemil Desai <[email protected]>
Co-authored-by: hemildesai <[email protected]>
Signed-off-by: Hainan Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants