TransformerEngine
TransformerEngine copied to clipboard
[PyTorch] Bugfix for wgrad bulk overlap conflict when dgrad overlap is reduce-scatter
Description
When Userbuffers config dictionary sets overlap method to ring-exchange or pipeline for any *_dgrad layer, that layer's *_wgrad overlap needs to be disabled in order for ub_overlap_rs_dgrad=True option for related TE modules to function correctly.
This PR fixes a bug where the "*_wgrad" overlap was persisting in the Userbuffer configuration and the corresponding UB object was being initialized even when it was not needed.
- @fanshiqing for viz.
Type of change
- [ ] Documentation change (change only to the documentation, either a fix or a new content)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Infra/Build change
- [ ] Code refractor
Changes
Please list the changes introduced in this PR:
*_wgradoverlap is now removed frommethods["bulk"]list when the same layer's*_dgradoverlap has its method set to eitherring-exchangeorpipeline.add_ub(name, **ub_cfg)is now only called ifnameis in the original user-providedub_cfg. This avoids creating UB objects with default configs that may conflict with the user's intended TP overlap use.
Checklist:
- [x] I have read and followed the contributing guidelines
- [x] The functionality is complete
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
/te-ci pytorch L0 L1
/te-ci pytorch L0 L1