Skip to content

Conversation

fanshiqing
Copy link

@fanshiqing fanshiqing commented Aug 12, 2025

Description

Support communication/gemm overlap for [Wgrad->Dgrad] execution order in the bwd pass.

Taking MLP modules as an example:

image

New added comm/gemm patterns include:

  • ⑥ AG->fc2_wgrad / proj_wgrad
  • ⑦ AG->fc1_wgrad / qkv_wgrad

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • 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 refactoring

Changes

Please list the changes introduced in this PR:

  • transformer_engine/common/comm_gemm_overlap/comm_gemm_overlap.{cpp, h}: support new patterns ⑥ and ⑦; aggregate 2X AG and GEMM chunks to lower then overhead
  • transformer_engine/pytorch/module/base.py: verify and clean the user specified comm/gemm overlap knobs to avoid conflicts.

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

… in the bwd pass. New comm/gemm overlapping patterns:

   - ag->fc2_wgrad
   - ag->fc1_wgrad
   - ag->proj_wgrad
   - ag->qkv_wgrad
@zhongbozhu
Copy link
Collaborator

/te-ci pytorch L1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants