-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: regular torch optims (e.g., sgd) no longer error with closure spec #11189
Open
terrykong
wants to merge
3
commits into
main
Choose a base branch
from
terryk/allow-optim-closure-repeat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terrykong
force-pushed
the
terryk/allow-optim-closure-repeat
branch
from
November 6, 2024 18:23
3c8e5c9
to
90d82dc
Compare
terrykong
changed the title
Terryk/allow optim closure repeat
fix: regular torch optims (e.g., sgd) no longer error with closure spec
Nov 6, 2024
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
terrykong
force-pushed
the
terryk/allow-optim-closure-repeat
branch
from
November 6, 2024 22:39
a559083
to
ba8edbd
Compare
terrykong
added a commit
to NVIDIA/NeMo-Aligner
that referenced
this pull request
Nov 6, 2024
Signed-off-by: Terry Kong <[email protected]>
terrykong
added a commit
to NVIDIA/NeMo-Aligner
that referenced
this pull request
Nov 7, 2024
- Needed for sequence parallel where the sequence length needs to be divisible Signed-off-by: Terry Kong <[email protected]> missing plumbing Signed-off-by: Terry Kong <[email protected]> fix: update other APIs required for MCore dist opt Signed-off-by: Terry Kong <[email protected]> feat: more informative error for DPO dataset tokenization failure Signed-off-by: Terry Kong <[email protected]> more functional tests Signed-off-by: Terry Kong <[email protected]> rename Signed-off-by: Terry Kong <[email protected]> convenience script to run all functional tests Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> more Signed-off-by: Terry Kong <[email protected]> fix closure, but need NVIDIA/NeMo#11189 Signed-off-by: Terry Kong <[email protected]> eosid -> -100 Signed-off-by: Terry Kong <[email protected]> revert black Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> global pad Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> test cleanup Signed-off-by: Terry Kong <[email protected]> make all scripts output the same Signed-off-by: Terry Kong <[email protected]> license Signed-off-by: Terry Kong <[email protected]> more comment Signed-off-by: Terry Kong <[email protected]>
terrykong
added a commit
to NVIDIA/NeMo-Aligner
that referenced
this pull request
Nov 7, 2024
- Needed for sequence parallel where the sequence length needs to be divisible Signed-off-by: Terry Kong <[email protected]> missing plumbing Signed-off-by: Terry Kong <[email protected]> fix: update other APIs required for MCore dist opt Signed-off-by: Terry Kong <[email protected]> feat: more informative error for DPO dataset tokenization failure Signed-off-by: Terry Kong <[email protected]> more functional tests Signed-off-by: Terry Kong <[email protected]> rename Signed-off-by: Terry Kong <[email protected]> convenience script to run all functional tests Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> more Signed-off-by: Terry Kong <[email protected]> fix closure, but need NVIDIA/NeMo#11189 Signed-off-by: Terry Kong <[email protected]> eosid -> -100 Signed-off-by: Terry Kong <[email protected]> revert black Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> global pad Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> test cleanup Signed-off-by: Terry Kong <[email protected]> make all scripts output the same Signed-off-by: Terry Kong <[email protected]> license Signed-off-by: Terry Kong <[email protected]> more comment Signed-off-by: Terry Kong <[email protected]>
terrykong
added a commit
to NVIDIA/NeMo-Aligner
that referenced
this pull request
Nov 7, 2024
- Needed for sequence parallel where the sequence length needs to be divisible Signed-off-by: Terry Kong <[email protected]> missing plumbing Signed-off-by: Terry Kong <[email protected]> fix: update other APIs required for MCore dist opt Signed-off-by: Terry Kong <[email protected]> feat: more informative error for DPO dataset tokenization failure Signed-off-by: Terry Kong <[email protected]> more functional tests Signed-off-by: Terry Kong <[email protected]> rename Signed-off-by: Terry Kong <[email protected]> convenience script to run all functional tests Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> more Signed-off-by: Terry Kong <[email protected]> fix closure, but need NVIDIA/NeMo#11189 Signed-off-by: Terry Kong <[email protected]> eosid -> -100 Signed-off-by: Terry Kong <[email protected]> revert black Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> global pad Signed-off-by: Terry Kong <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <[email protected]> test cleanup Signed-off-by: Terry Kong <[email protected]> make all scripts output the same Signed-off-by: Terry Kong <[email protected]> license Signed-off-by: Terry Kong <[email protected]> more comment Signed-off-by: Terry Kong <[email protected]> license and fix sft Signed-off-by: Terry Kong <[email protected]> sft torchrun -> mpirun Signed-off-by: Terry Kong <[email protected]> guard nonsense padding Signed-off-by: Terry Kong <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Mcore distributed optimizers now require us to specify the
closure
kwarg. Example:https://github.com/NVIDIA/NeMo-Aligner/blob/ac97fe334eff9ad3177edf274c011e74d14a4d60/nemo_aligner/algorithms/dpo.py#L202
This means that if the application also specifies
None
forclosure
, we'll error b/c closure is passed twice. This change pops off closure and ensures it isNone
to be compliant.Collection: [Note which collection this PR will affect]
Changelog
Usage
# 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:
PR Type:
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