Skip to content

Remove unused CustomClassHolder bases from Userbuffers wrappers - #3732

Merged
ksivaman merged 2 commits into
NVIDIA:mainfrom
pggPL:remove_custom_class_holder
Oct 23, 2026
Merged

ksivaman merged 2 commits into
NVIDIA:mainfrom
pggPL:remove_custom_class_holder

Conversation

@pggPL

@pggPL pggPL commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Remove unused torch::CustomClassHolder inheritance from the three C++ Userbuffers wrappers: CommOverlapHelper, CommOverlap, and CommOverlapP2P.

These classes are exposed through pybind11, with std::shared_ptr holders for the overlap classes. They are not registered as TorchBind classes and do not use the intrusive-pointer functionality supplied by CustomClassHolder. Removing the bases eliminates an unnecessary PyTorch dependency; the existing TE base classes and pybind11 bindings are retained.

Type of change

  • Code refactoring

Changes

  • Remove the three torch::CustomClassHolder bases in transformer_engine/pytorch/csrc/extensions.h.

Validation

  • Rebuilt and linked all 34 PyTorch-extension C++ translation units from this branch on one RTX 5880 Ada, PyTorch 2.15.0a0+875d815502, CUDA 13.4. Reused the previously built common CUDA library; MPI, cuBLASMp, NVSHMEM and NCCL EP disabled.
  • Four separate-process, one-rank GPU smoke tests passed: helper construction/destruction, CommOverlap, P2P AG, P2P RS. Verified TE base-class dispatch, exact BF16 buffer round-trips, communication streams, and Python ownership/release.
  • Pre-commit, C++ L0 PyTorch lint (CPP_ONLY=1), license check and git diff --check passed.

Multi-GPU communication/GEMM overlap, optional backends, and the full L0 runtime suite were not run. This is not a complete stable-ABI migration. C++ consumers must rebuild against the updated class declarations.

Checklist

  • Read and followed the contributing guidelines.
  • Implementation complete.
  • Focused validation passed.

Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
@pggPL
pggPL requested a review from ksivaman as a code owner October 22, 2026 21:54
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Removes torch::CustomClassHolder inheritance from CommOverlapHelper, CommOverlap, and CommOverlapP2P.

  • The Userbuffers wrappers drop an unused Torch custom-class base.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into remove_custom_c..." · Reviewed by Greptile

@ksivaman ksivaman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ksivaman

Copy link
Copy Markdown
Member

/te-ci pytorch L1

@ksivaman
ksivaman merged commit dd02f3f into NVIDIA:main Oct 23, 2026
20 of 28 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