Skip to content

Commit 268eb77

Browse files
YulunWmeta-codesync[bot]
authored andcommitted
Fix test device_mesh-type-checking
Summary: Test [device_mesh-type-checking](https://www.internalfb.com/intern/test/562950220141718) was failing due to expecting type GroupName (an alias for str) while getting str. Make the manual conversion to make linter happy. Reviewed By: siyengar Differential Revision: D88663935 fbshipit-source-id: 1de27344d1eea830400ffea5f5599441eddff321
1 parent d4b5bee commit 268eb77

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

comms/torchcomms/device_mesh.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from torch.distributed.device_mesh import _mesh_resources
1111

12+
from torch.distributed.distributed_c10d import GroupName
13+
1214
from torchcomms._comms import _BackendWrapper, _get_store, new_comm, TorchComm
1315

1416

@@ -33,6 +35,10 @@ def _create_torchcomm_process_group(
3335
Returns:
3436
The created and registered ProcessGroup instance
3537
"""
38+
# Make the linter happy. GroupName is just an alias for str. The cost of
39+
# this conversion is negligible.
40+
group_name = GroupName(group_name)
41+
3642
wrapper = _BackendWrapper(comm) # noqa: F405
3743
backend_type = dist.ProcessGroup.BackendType.CUSTOM # noqa: F841
3844
backend_config = dist.BackendConfig(dist.Backend(backend_str))

0 commit comments

Comments
 (0)