[Main] fix cg missing wgrad hook#3074
Conversation
|
@jiemingz Can you take a look at this PR, thanks~ |
| assert is_te_min_version("2.8.0"), ( | ||
| "overlap_grad_reduce is only supported with TE >= 2.8.0 when enabling delay_wgrad_compute" | ||
| ) | ||
| wgrad_in_graph_scope = CudaGraphScope.attn in args.cuda_graph_scope or ( |
There was a problem hiding this comment.
LGTM; could you move this to transformer_config? I think we're trying to keep the arguments.py minimal
There was a problem hiding this comment.
I am afraid not, since TransformerConfig cannot access overlap_grad_reduce, which is DDPConfig
There was a problem hiding this comment.
[Plug/FYI] Megatron-bridge has a validate() for all the configs together.
https://github.com/NVIDIA-NeMo/Megatron-Bridge/blob/main/src/megatron/bridge/training/config.py#L1399-L1661
We are trying to upstream to megatron-lm, this should help cross-config object validations.
|
@gautham-kollu , will Bridge need the same fix? |
Yes. We need to upstream this to the ConfigContainer.Validate(). Filed this to track NVIDIA-NeMo/Megatron-Bridge#2216 |
|
/ok to test 5973386 |
|
/ok to test 8553313 |
Co-authored-by: Philip Petrakian <ppetrakian@nvidia.com>
What does this PR do ?
This PR fixes the missing backward post hook bug, this bug happens when
delay_wgrad_computeandcuda_graphare both enabled, the parameters within delayed wgrad computation scope will skip the backward post hook.The fix is in TE, this PR only adds version guard and several flag assertions.
Related TE PR: NVIDIA/TransformerEngine#2614
PR for dev: #2999
Contribution process
flowchart LR A[Pre-checks] --> B[PR Tests] subgraph Code Review/Approval C1[Expert Review] --> C2[Final Review] end B --> C1 C2 --> D[Merge]Pre-checks
Core 0.8)Code review
The following process is enforced via the CODEOWNERS file for changes into
megatron/core. For changes outside ofmegatron/core, it is up to the PR author whether or not to tag the Final Reviewer team.For MRs into `main` branch
Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
(Step 1): Add PR label
Expert Review(Step 2): Collect the expert reviewers reviews
Expert Reviewlabel when your PR is ready for review.Final Review might get declined if these requirements are not fulfilled.
(Step 3): Final Review
Final Reviewlabel(Optional Step 4): Cherry-pick into release branch
If this PR also needs to be merged into
core_r*release branches, after this PR has been merged, selectCherry-pickto open a new PR into the release branch.For MRs into `dev` branch
The proposed review process for `dev` branch is under active discussion.MRs are mergable after one approval by either
eharper@nvidia.comorzijiey@nvidia.com.Merging your PR
Any member of core-adlr and
core-nemowill be able to merge your PR.