Skip to content

Commit fe7479b

Browse files
TroyGardenmeta-codesync[bot]
authored andcommitted
fix pre-commit error (#3420)
Summary: Pull Request resolved: #3420 # context * torchrec github workflow [pre-commit](https://github.com/meta-pytorch/torchrec/actions/runs/18187119531/job/51773690358) failed with the following message ``` diff --git a/torchrec/distributed/embedding_kernel.py b/torchrec/distributed/embedding_kernel.py index e444f59..6c1dea2 100644 --- a/torchrec/distributed/embedding_kernel.py +++ b/torchrec/distributed/embedding_kernel.py @@ -105,7 +105,9 @@ def create_virtual_table_global_metadata( # The param size only has the information for my_rank. In order to # correctly calculate the size for other ranks, we need to use the current # rank's shard size compared to the shard size of my_rank. - curr_rank_rows = (param.size()[0] * metadata.shards_metadata[rank].shard_sizes[0]) // my_rank_shard_size # pyre-ignore[16] + curr_rank_rows = ( + param.size()[0] * metadata.shards_metadata[rank].shard_sizes[0] + ) // my_rank_shard_size # pyre-ignore[16] else: curr_rank_rows = ( weight_count_per_rank[rank] if weight_count_per_rank is not None else 1 ``` Reviewed By: spmex Differential Revision: D83755478 fbshipit-source-id: e4ad086b66d79e203361e7853f547a8108b7181a
1 parent 3eba028 commit fe7479b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrec/modules/tests/test_hash_mc_modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def test_dynamically_switch_inference_training_mode(self) -> None:
695695
torch.cuda.device_count() < 1,
696696
"Not enough GPUs, this test requires at least two GPUs",
697697
)
698-
def test_zch_hash_disable_fallback_disabled_in_oss_compatatibility(self) -> None:
698+
def test_zch_hash_disable_fallback_disabled_in_oss_compatibility(self) -> None:
699699
m = HashZchManagedCollisionModule(
700700
zch_size=30,
701701
device=torch.device("cuda"),

0 commit comments

Comments
 (0)