Skip to content

[Pytorch] Optimize CPU overhead for NCCL EP eager mode - #3378

Merged
phu0ngng merged 3 commits into
NVIDIA:mainfrom
YangFei1990:ncclep_cpu_overhead
Aug 15, 2026
Merged

[Pytorch] Optimize CPU overhead for NCCL EP eager mode#3378
phu0ngng merged 3 commits into
NVIDIA:mainfrom
YangFei1990:ncclep_cpu_overhead

Conversation

@YangFei1990

@YangFei1990 YangFei1990 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Description

Reduce NCCL EP CPU overhead by using pinned memory CPU tensor.

Fixes # (issue)

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:

  • Change A
  • Change B

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

Signed-off-by: YangFei1990 <feiw@nvidia.com>
@YangFei1990
YangFei1990 marked this pull request as ready for review August 13, 2026 21:51
@YangFei1990
YangFei1990 requested a review from ksivaman as a code owner August 13, 2026 21:51
@YangFei1990
YangFei1990 requested a review from phu0ngng August 13, 2026 21:52
@YangFei1990

Copy link
Copy Markdown
Collaborator Author

/te-ci L1 pytorch

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR reduces eager-mode NCCL expert-parallel CPU overhead by storing the per-step receive-token count in pinned host memory.

  • Keeps graph-mode receive-token accounting on the CUDA device.
  • Synchronizes the active CUDA stream before reading the eager-mode host counter.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
transformer_engine/pytorch/ep.py Uses a pinned host receive counter in eager mode and synchronizes before host-side output sizing; no eligible follow-up defect was established.

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

@phu0ngng
phu0ngng merged commit e61a2fb into NVIDIA:main Aug 15, 2026
9 of 14 checks passed
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