Skip to content

Commit 884c4bd

Browse files
committed
Update
[ghstack-poisoned]
1 parent 24126da commit 884c4bd

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

torchft/process_group.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import threading
2121
from abc import ABC
2222
from datetime import timedelta
23-
from typing import Dict, List, Optional, Tuple, Type, TYPE_CHECKING, Union
23+
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
2424

2525
import torch
2626
import torch.distributed as dist
@@ -31,16 +31,16 @@
3131
from torch.distributed import (
3232
BroadcastOptions,
3333
DeviceMesh,
34-
get_rank,
35-
init_device_mesh,
3634
PrefixStore,
3735
ProcessGroup as BaseProcessGroup,
3836
ProcessGroupGloo as BaseProcessGroupGloo,
3937
ProcessGroupNCCL as BaseProcessGroupNCCL,
4038
Store,
4139
TCPStore,
40+
get_rank,
41+
init_device_mesh,
4242
)
43-
from torch.distributed.distributed_c10d import _world, Work
43+
from torch.distributed.distributed_c10d import Work, _world
4444
from torch.futures import Future
4545

4646
if TYPE_CHECKING:

torchft/process_group_test.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,32 @@
77
import os
88
from concurrent.futures import ThreadPoolExecutor
99
from typing import Any, Dict, Tuple
10-
from unittest import skipUnless, TestCase
10+
from unittest import TestCase, skipUnless
1111
from unittest.mock import Mock
1212

1313
import torch
1414
import torch.distributed as dist
1515
from torch import nn
1616
from torch._C._distributed_c10d import (
17-
_resolve_process_group,
1817
AllgatherOptions,
1918
AllreduceOptions,
2019
BroadcastOptions,
2120
ReduceOp,
21+
_resolve_process_group,
2222
)
2323
from torch.distributed import (
24-
_functional_collectives,
25-
get_world_size,
2624
ReduceOp,
2725
TCPStore,
2826
Work,
27+
_functional_collectives,
28+
get_world_size,
2929
)
3030
from torch.distributed.device_mesh import init_device_mesh
3131
from torch.testing._internal.common_distributed import MultiProcessTestCase
3232

3333
from torchft.manager import Manager
3434
from torchft.process_group import (
35-
_DummyWork,
36-
_ErrorSwallowingWork,
37-
_ManagedWork,
3835
ErrorSwallowingProcessGroupWrapper,
39-
extend_device_mesh,
40-
ft_init_device_mesh,
4136
ManagedDeviceMesh,
4237
ManagedProcessGroup,
4338
ProcessGroup,
@@ -47,6 +42,11 @@
4742
ProcessGroupGloo,
4843
ProcessGroupNCCL,
4944
ProcessGroupWrapper,
45+
_DummyWork,
46+
_ErrorSwallowingWork,
47+
_ManagedWork,
48+
extend_device_mesh,
49+
ft_init_device_mesh,
5050
)
5151

5252

0 commit comments

Comments
 (0)