Skip to content

Perf scripts updates #14005

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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Perf scripts updates #14005

wants to merge 22 commits into from

Conversation

guyueh1
Copy link
Collaborator

@guyueh1 guyueh1 commented Jun 24, 2025

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 ?

Performance scripts updates

Collection: [Note which collection this PR will affect]

Changelog

  • Use TORCH_NCCL_HIGH_PRIORITY=1 in perf scripts
  • MXFP8: Enable TP comm overlap
  • MXFP8: Enable sharing RS buffer for param AG
  • Use full layer spec for GPT

Usage

  • You can potentially add a usage example below
# 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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

  • Related to # (issue)

@guyueh1 guyueh1 requested a review from erhoo82 June 24, 2025 18:51
@guyueh1 guyueh1 added Run CICD r2.4.0 Pick this label for auto-cherry-picking into r2.4.0 labels Jun 24, 2025
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels Jun 24, 2025
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels Jun 24, 2025
# because it is not supported with reuse_grad_buf_for_mxfp8_param_ag
if compute_dtype.lower() == "fp8" and fp8_recipe.lower() == "mxfp8":
recipe.trainer.strategy.ddp.reuse_grad_buf_for_mxfp8_param_ag = True
recipe.trainer.strategy.ddp.overlap_param_gather = False
Copy link
Collaborator

@malay-nagda malay-nagda Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can control/override this config...

It will be set if DP > 1 in MegatronCommOverlapCallback- https://github.com/NVIDIA/NeMo/blob/main/nemo/lightning/pytorch/callbacks/megatron_comm_overlap.py#L188

cc: @JimmyZhang12

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the code to use MegatronCommCallback to set it, I think that will override the inferred config.

@ko3n1g ko3n1g added Run CICD and removed Run CICD labels Jun 25, 2025
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels Jun 25, 2025
malay-nagda
malay-nagda previously approved these changes Jun 26, 2025
@github-actions github-actions bot added the NLP label Jul 1, 2025
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels Jul 1, 2025
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels Jul 1, 2025
Signed-off-by: Guyue Huang <[email protected]>
malay-nagda
malay-nagda previously approved these changes Jul 3, 2025
@@ -66,6 +66,7 @@ def slurm_executor(
"NVTE_FLASH_ATTN": "1", # Enable Flash Attention, which is needed to enable cuDNN fused attention
"NVTE_FUSED_ATTN": "1", # Enable cuDNN fused attention
"NEMO_LOG_MEMORY_USAGE": "1", # Print memory allocation
"TORCH_NCCL_HIGH_PRIORITY": "1", # Enable high priority for NCCL communication in pytorch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved there; do we need any condition on applying that envvar, or always applying (as I do now)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think always applying should be fine. Had it enabled for all recent workloads I ran...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NLP r2.4.0 Pick this label for auto-cherry-picking into r2.4.0 RC4 Run CICD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants