Skip to content

Conversation

@Ali-Tehrani
Copy link
Contributor

Summary:
Context

TorchRec comms needs a way to obtain the pod-size (topology-domain-multiple) and the total amount of process groups of the topology group for TWRW/Grid-sharding.

We obtain the number of intra-nodes within a pod by obtaining the TOPOLOGY_DOMAIN_MULTIPLE from the environment variables (see diff stack).

Implementation

  • created get_intra_group_size function that obtains the number of intra-node-size from envrionemnt variable, and if not it defaults to usual get_local_size.
  • updated intra_and_cross_node_pg to utilize get_intra_node_size instead.

Differential Revision: D91617889

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 28, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 28, 2026

@Ali-Tehrani has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91617889.

Ali-Tehrani added a commit to Ali-Tehrani/torchrec that referenced this pull request Jan 30, 2026
Summary:

Context
---------
TorchRec comms needs a way to obtain the pod-size (topology-domain-multiple) and the total amount of process groups of the topology group for TWRW/Grid-sharding.

We obtain the number of intra-nodes within a pod by obtaining the `TOPOLOGY_DOMAIN_MULTIPLE` from the environment variables (see diff stack).

Implementation
------------------
- created `get_intra_group_size` function that obtains the number of intra-node-size from envrionemnt variable, and if not it defaults to usual `get_local_size`.
- updated `intra_and_cross_node_pg` to utilize `get_intra_node_size` instead.

Differential Revision: D91617889
Ali-Tehrani added a commit to Ali-Tehrani/torchrec that referenced this pull request Jan 30, 2026
Summary:

Context
---------
TorchRec comms needs a way to obtain the pod-size (topology-domain-multiple) and the total amount of process groups of the topology group for TWRW/Grid-sharding.

We obtain the number of intra-nodes within a pod by obtaining the `TOPOLOGY_DOMAIN_MULTIPLE` from the environment variables (see diff stack).

Implementation
------------------
- created `get_intra_group_size` function that obtains the number of intra-node-size from envrionemnt variable, and if not it defaults to usual `get_local_size`.
- updated `intra_and_cross_node_pg` to utilize `get_intra_node_size` instead.

Differential Revision: D91617889
Summary:

Context
---------

Every GB200 node has 2 B200 GPU attached to it, however allows up to 72 B200 connected via NVlink. The planner needs to know how big the intra topology group size is going to be.

 This causes the `local_world_size` to be different from the `intra_group_size`.

Implementation
------------------
- Topology class:
     - Adds `pod_size`, and uses that to calculate the `intra_group_size` (maximum number of processes linked with high intra bandwidth) to Topology class. If isn't given, then it defaults to local_world_size.
- `shard_estimators.py`
     - The shard estimators now use the `intra_group_size` instead of `local_world_size`, this allows RW/TW/CW to properly account for larger NVlink that comes with the pods.

Reviewed By: isururanawaka

Differential Revision: D91617887
Summary:

Context
---------
TorchRec comms needs a way to obtain the pod-size (topology-domain-multiple) and the total amount of process groups of the topology group for TWRW/Grid-sharding.

We obtain the number of intra-nodes within a pod by obtaining the `TOPOLOGY_DOMAIN_MULTIPLE` from the environment variables (see diff stack).

Implementation
------------------
- created `get_intra_group_size` function that obtains the number of intra-node-size from envrionemnt variable, and if not it defaults to usual `get_local_size`.
- updated `intra_and_cross_node_pg` to utilize `get_intra_node_size` instead.

Differential Revision: D91617889
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant