-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
LLM Forward Step #12673
LLM Forward Step #12673
Conversation
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Co-authored-by: Ananth Subramaniam <[email protected]> Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
from nemo.tron.state import GlobalState | ||
|
||
|
||
def get_batch(data_iterator, cfg: ConfigContainer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to add typehint + docs for the return value
return batch.values() | ||
|
||
|
||
def forward_step(state: GlobalState, data_iterator: Iterable, model: GPTModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, the return type will be helpful
nemo/tron/utils/train_utils.py
Outdated
@@ -509,3 +512,12 @@ def reduce_aux_losses_tracker_across_ranks(): | |||
torch.distributed.all_reduce(values, group=tracker[name].get("reduce_group")) | |||
if tracker[name].get("avg_group") is not None: | |||
torch.distributed.all_reduce(values, group=tracker[name]["avg_group"], op=torch.distributed.ReduceOp.AVG) | |||
|
|||
|
|||
def maybe_inject_state(forward_step_func: Callable, state: GlobalState) -> Callable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in some types.py
file please define the typehint for forward_step_func
since this will serve as additional docs
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
Signed-off-by: Maanu Grover <[email protected]>
* pretrain loss func Signed-off-by: Maanu Grover <[email protected]> * get batch and forward Signed-off-by: Maanu Grover <[email protected]> * add rerun functionality to loss Signed-off-by: Maanu Grover <[email protected]> * formatting Signed-off-by: Maanu Grover <[email protected]> * injection of state Signed-off-by: Maanu Grover <[email protected]> * remove globalstate singleton functionality Signed-off-by: Maanu Grover <[email protected]> * update example Signed-off-by: Maanu Grover <[email protected]> * missing copyright Signed-off-by: Maanu Grover <[email protected]> * fix for latest mcore Signed-off-by: Maanu Grover <[email protected]> * syntax Co-authored-by: Ananth Subramaniam <[email protected]> Signed-off-by: Maanu Grover <[email protected]> * move assertion Signed-off-by: Maanu Grover <[email protected]> * refactor for eval Signed-off-by: Maanu Grover <[email protected]> * move to avoid circular import Signed-off-by: Maanu Grover <[email protected]> * fix Signed-off-by: Maanu Grover <[email protected]> * unused Signed-off-by: Maanu Grover <[email protected]> * cache num fw args in train and eval Signed-off-by: Maanu Grover <[email protected]> * docstring fix Signed-off-by: Maanu Grover <[email protected]> * remove duplicate Signed-off-by: Maanu Grover <[email protected]> --------- Signed-off-by: Maanu Grover <[email protected]> Signed-off-by: Maanu Grover <[email protected]> Co-authored-by: Ananth Subramaniam <[email protected]>
Important
The
Update branch
button must only be pressed in very rare occassions.An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
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