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

Conversation

TroyGarden
Copy link
Contributor

Summary:

context

to address the following issue:

check toml...............................................................Passed
check yaml...............................................................Passed
fix end of files.........................................................Passed
Format files with µfmt...................................................::debug::Aborting download, socket timed out after 5000 ms
Failed
- hook id: ufmt
- files were modified by this hook

Formatted /home/runner/work/torchrec/torchrec/torchrec/distributed/utils.py
✨ 1 file formatted, 448 files already formatted ✨

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/torchrec/distributed/utils.py b/torchrec/distributed/utils.py
index 8a3db12..830fef4 100644
--- a/torchrec/distributed/utils.py
+++ b/torchrec/distributed/utils.py
@@ -525,7 +525,9 @@ 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]
+        row_dim = parameter_sharding.sharding_spec.shards[0].shard_sizes[
+            0
+        ]  # pyre-ignore[16]
         col_dim = 0
         for shard in parameter_sharding.sharding_spec.shards:
             col_dim += shard.shard_sizes[1]
@@ -551,4 +553,6 @@ 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]
+    return size, (
+        (size[1], 1) if size else (torch.Size([0, 0]), (0, 1))
+    )  # pyre-ignore[7]
Error: The process '/opt/hostedtoolcache/Python/3.9.20/x64/bin/pre-commit' failed with exit code 1

Differential Revision: D67914742

Summary:
# context
to address the following issue:
```
check toml...............................................................Passed
check yaml...............................................................Passed
fix end of files.........................................................Passed
Format files with µfmt...................................................::debug::Aborting download, socket timed out after 5000 ms
Failed
- hook id: ufmt
- files were modified by this hook

Formatted /home/runner/work/torchrec/torchrec/torchrec/distributed/utils.py
✨ 1 file formatted, 448 files already formatted ✨

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/torchrec/distributed/utils.py b/torchrec/distributed/utils.py
index 8a3db12..830fef4 100644
--- a/torchrec/distributed/utils.py
+++ b/torchrec/distributed/utils.py
@@ -525,7 +525,9 @@ 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]
+        row_dim = parameter_sharding.sharding_spec.shards[0].shard_sizes[
+            0
+        ]  # pyre-ignore[16]
         col_dim = 0
         for shard in parameter_sharding.sharding_spec.shards:
             col_dim += shard.shard_sizes[1]
@@ -551,4 +553,6 @@ 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]
+    return size, (
+        (size[1], 1) if size else (torch.Size([0, 0]), (0, 1))
+    )  # pyre-ignore[7]
Error: The process '/opt/hostedtoolcache/Python/3.9.20/x64/bin/pre-commit' failed with exit code 1
```

Differential Revision: D67914742
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 7, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67914742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants