Skip to content

Commit d68b3ec

Browse files
generatedunixname89002005307016facebook-github-bot
authored andcommitted
upgrade pyre version in fbcode/torchsnapshot - batch 1
Differential Revision: D60991359 fbshipit-source-id: 99ff5a87c15387c7e7bdc018fd073fff60ab7d40
1 parent 3f5ad9c commit d68b3ec

File tree

8 files changed

+2
-13
lines changed

8 files changed

+2
-13
lines changed

tests/gpu_tests/test_dtensor_io_preparer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ async def test_dtensor_io_preparer(
7272
"""
7373
Verify the basic behavior of DTensorIOPreparer prepare_write.
7474
"""
75-
# pyre-fixme[6]: For 2nd argument expected `Union[_SupportsArray[typing.Any],...
7675
device_mesh = DeviceMesh("cuda", mesh=mesh)
7776

7877
if len(placements) > device_mesh.ndim:

tests/gpu_tests/test_dtensor_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class TestDTensorUtils(DTensorTestBase):
3131
@skip_if_lt_x_gpu(WORLD_SIZE)
3232
# pyre-fixme[3]: Return type must be annotated.
3333
def test_is_sharded_is_replicated(self):
34-
# pyre-fixme[6]: For 2nd argument expected `Union[_SupportsArray[typing.Any],...
3534
mesh = DeviceMesh("cuda", mesh=[[0, 1], [2, 3]])
3635
placements = [Replicate(), Shard(0)]
3736
local_tensor = torch.rand((16, 16))

tests/gpu_tests/test_snapshot_dtensor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ def _create_model(
8181
inter_node_pg = mesh_2d.get_group(mesh_dim=0)
8282
model = FSDP(
8383
DummyModel().cuda(),
84-
# pyre-fixme[6]: For 2nd argument expected `Union[None,
85-
# Tuple[ProcessGroup, ProcessGroup], ProcessGroup]` but got
86-
# `Tuple[Union[List[ProcessGroup], ProcessGroup],
87-
# Union[List[ProcessGroup], ProcessGroup]]`.
8884
process_group=(intra_node_pg, inter_node_pg),
8985
sharding_strategy=ShardingStrategy.HYBRID_SHARD,
9086
)

tests/test_batcher.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,8 @@ def dtensor_test_cases(
165165
dsts = []
166166
for idx in range(NUM_TENSORS):
167167
mesh = (
168-
# pyre-fixme[6]: For 2nd argument expected `Union[_SupportsArray[typing.A...
169168
DeviceMesh("cuda", mesh=[0])
170169
if use_gpu and idx % 2 == 0
171-
# pyre-fixme[6]: For 2nd argument expected `Union[_SupportsArray[typing.A...
172170
else DeviceMesh("cpu", mesh=[0])
173171
)
174172
srcs.append(

tests/test_test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def _create_dtensor() -> DTensor:
123123

124124
local_tensor = torch.rand((dim_0, dim_1))
125125

126-
# pyre-fixme[6]: For 2nd argument expected `Union[_SupportsArray[typing.Any],...
127126
mesh = DeviceMesh("cpu", mesh=[[0, 1], [2, 3]])
128127
placements = [Replicate(), Shard(0)]
129128
dtensor = distribute_tensor(

torchsnapshot/batcher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ def batch_read_requests(read_reqs: List[ReadReq]) -> List[ReadReq]:
469469
path=location,
470470
buffer_consumer=BatchedBufferConsumer(
471471
byte_range_to_buffer_consumer=byte_range_to_buffer_consumer,
472+
# pyre-fixme[61]: `byte_range` is undefined, or not always defined.
472473
buf_sz_bytes=byte_range[1] - byte_range[0],
473474
),
474475
byte_range=location_to_byte_range[location],

torchsnapshot/snapshot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ def _infer_replicated(replicated: List[str], app_state: AppState) -> List[str]:
907907

908908
@staticmethod
909909
def _coalesce_replicated(global_replicated: List[List[str]]) -> Set[str]:
910+
# pyre-fixme[6]: For 1st argument expected `(_T1) -> _S` but got `Type[set]`.
910911
verified_replicated = set.intersection(*map(set, global_replicated))
911912
return verified_replicated
912913

torchsnapshot/test_utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,6 @@ def _dtensor_test_case(
317317
replicated: bool,
318318
) -> Tuple[DTensor, Entry, List[WriteReq]]:
319319
# WORLD_SIZE needs to be at least 4
320-
# pyre-fixme[6]: For 2nd argument expected `Union[_SupportsArray[typing.Any],
321-
# _NestedSequence[Union[bool, bytes, complex, float, int, str]],
322-
# _NestedSequence[_SupportsArray[typing.Any]], bool, bytes, complex, float, int,
323-
# str, Tensor]` but got `List[List[int]]`.
324320
mesh = DeviceMesh("cuda", mesh=[[0, 1], [2, 3]])
325321
placements = [Replicate(), Shard(0)]
326322
local_tensor = rand_tensor(shape, dtype=dtype)

0 commit comments

Comments
 (0)