Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix OSS pre-commit error #2668

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions torchrec/distributed/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ def create_global_tensor_shape_stride_from_metadata(
"""
size = None
if parameter_sharding.sharding_type == ShardingType.COLUMN_WISE.value:
row_dim = parameter_sharding.sharding_spec.shards[0].shard_sizes[0] # pyre-ignore[16]
# pyre-ignore[16]
row_dim = parameter_sharding.sharding_spec.shards[0].shard_sizes[0]
col_dim = 0
for shard in parameter_sharding.sharding_spec.shards:
col_dim += shard.shard_sizes[1]
Expand All @@ -551,4 +552,5 @@ def create_global_tensor_shape_stride_from_metadata(
for _ in range(devices_per_node):
row_dim += parameter_sharding.sharding_spec.shards[0].shard_sizes[0]
size = torch.Size([row_dim, col_dim])
return size, (size[1], 1) if size else (torch.Size([0, 0]), (0, 1)) # pyre-ignore[7]
# pyre-ignore[7]
return size, (size[1], 1) if size else (torch.Size([0, 0]), (0, 1))
Loading