Skip to content

[MD-TRT] Support subgroup parent communicators for native collectives - #4829

Draft
apbose wants to merge 2 commits into
abose/followup_subgroup4680from
abose/followup_subgroup4680_parent_support
Draft

apbose wants to merge 2 commits into
abose/followup_subgroup4680from
abose/followup_subgroup4680_parent_support

Conversation

@apbose

@apbose apbose commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Allow compilation inside distributed_context(subgroup) while preserving the engine parent's ordered global membership. For a parent [2, 3], collective participants [2, 3] become communicator-local IDs [0, 1]. Participants outside the parent are rejected, and rooted operations use the parent's numbering.

All requested engine parents are validated before any binding is changed, including contexts containing multiple modules. Rejected entry preserves the previous active group, bindings and engine discovery. The regression checks mixed-parent rejection, repeated rejection and valid-parent reuse.

The four-GPU roundtrip coverage is split by runtime:

  • C++: wrap the fully compiled engine in a one-call FX GraphModule accepted by torch_tensorrt.save, then check exported save/load, repeated wrong-parent rejection and correct-parent execution.
  • Python: construct TRTEngine from the same compiled engine metadata and call its execution API directly; pickle/reload and check rejection/rebinding. This avoids pretending that changing feature flags after import can replace the registered C++ operator schema. It covers the Python engine API, not Python-only AOT export.

Compatibility: serialized-engine ABI changes from 10 to 11, so existing engines must be rebuilt. Engine caching remains rejected for subgroup-parent compilation until its cache identity includes the ordered parent mapping. Different groups in one engine still require the TensorRT/Myelin fix; this PR inherits #4772's separate mesh capability gate.

Validation of this update: 47 CPU context/contract tests and 12 parent-mapping tests (including two mixed-parent subcases), with real PyTorch 2.15 CPU and TensorRT construction/imports stubbed; ordered-parent serialization helper checks; formatting, parsing and diff checks. Changed runtime/mapping files pass Ruff; the existing NCCL test-file diagnostics are unchanged from the updated parent. Earlier B300 diagnostics validated the corrected C++ save/load approach and direct subgroup parents. The revised GPU tests, including direct Python engine execution, were not rerun in this GPU-less session; the PR remains a draft.

Stack: depends on #4772 (abose/followup_subgroup4680) and has been restacked onto its fixes. The diff contains the subgroup-parent enhancement and its follow-up fixes.

@apbose
apbose added this pull request to stack #4830 October 8, 2026 22:20
@apbose apbose changed the title abose/followup subgroup4680 parent support [MD-TRT] Support subgroup parent communicators for native collectives Oct 8, 2026
@meta-cla meta-cla Bot added the cla signed label Oct 8, 2026
@github-actions github-actions Bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters component: api [Python] Issues re: Python API component: runtime component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Oct 8, 2026
@github-actions
github-actions Bot requested a review from narendasan October 8, 2026 22:20
@lanluo-nvidia lanluo-nvidia added this to the v2.16.0 milestone Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: runtime component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants