Skip to content

Improve readability of dgrad overlap variable#3165

Open
Prachi-kushwaha wants to merge 3 commits into
NVIDIA:mainfrom
Prachi-kushwaha:rename_dgrad_reduce_scatter_overlap
Open

Improve readability of dgrad overlap variable#3165
Prachi-kushwaha wants to merge 3 commits into
NVIDIA:mainfrom
Prachi-kushwaha:rename_dgrad_reduce_scatter_overlap

Conversation

@Prachi-kushwaha

Copy link
Copy Markdown

Description

Rename dgrad_reduce_scatter_overlap to better reflect its purpose.

Please include a brief summary of the changes, relevant motivation and context.

Fixes #3164

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

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

@Prachi-kushwaha Prachi-kushwaha requested a review from ksivaman as a code owner July 2, 2026 02:33
@github-actions github-actions Bot added the community-contribution PRs from external contributor outside the core maintainers, representing community-driven work. label Jul 2, 2026
@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR renames the local variable dgrad_reduce_scatter_overlap to layers_dgrad_ag_and_rs_overlap inside initialize_ub in base.py to better reflect that the listed layers require both an all-gather and a reduce-scatter overlap, not just reduce-scatter.

  • The rename is applied consistently at all three sites (one definition on line 322, two for loop references on lines 493 and 526) with no missed occurrences elsewhere in the codebase.
  • No logic, default values, or layer lists are changed — this is a pure identifier rename.

Confidence Score: 5/5

Safe to merge — this is a pure local variable rename with no logic changes.

All three occurrences of the old name are updated consistently and the renamed variable is local to initialize_ub, so there is no public API surface or external callsite affected.

No files require special attention.

Important Files Changed

Filename Overview
transformer_engine/pytorch/module/base.py Renames local variable dgrad_reduce_scatter_overlap to layers_dgrad_ag_and_rs_overlap in initialize_ub; all three occurrences (1 definition, 2 loop uses) are updated correctly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["initialize_ub()"] --> B["Define layer lists"]
    B --> C["layers_all_gather_overlap"]
    B --> D["layers_reduce_scatter_overlap"]
    B --> E["layers_dgrad_ag_and_rs_overlap\n(renamed from dgrad_reduce_scatter_overlap)"]
    E --> F["Loop: validate user_ub_cfg methods\n(line 493)"]
    E --> G["Loop: append to layers_reduce_scatter_overlap\nor layers_all_gather_overlap\n(line 526)"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["initialize_ub()"] --> B["Define layer lists"]
    B --> C["layers_all_gather_overlap"]
    B --> D["layers_reduce_scatter_overlap"]
    B --> E["layers_dgrad_ag_and_rs_overlap\n(renamed from dgrad_reduce_scatter_overlap)"]
    E --> F["Loop: validate user_ub_cfg methods\n(line 493)"]
    E --> G["Loop: append to layers_reduce_scatter_overlap\nor layers_all_gather_overlap\n(line 526)"]
Loading

Reviews (4): Last reviewed commit: "Merge branch 'main' into rename_dgrad_re..." | Re-trigger Greptile

Comment thread transformer_engine/pytorch/module/base.py Outdated
Signed-off-by: Prachi Kushwaha <prachiku673@gmail.com>
@Prachi-kushwaha Prachi-kushwaha force-pushed the rename_dgrad_reduce_scatter_overlap branch from e38a7d3 to 7a3a724 Compare July 3, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution PRs from external contributor outside the core maintainers, representing community-driven work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve readability of dgrad_reduce_scatter_overlap variable name

1 participant