Skip to content

Commit fd9d78a

Browse files
SSYernarfacebook-github-bot
authored andcommitted
Fix Github failing pre-commit (#3192)
Summary: Pull Request resolved: #3192 Some of the recent diffs in the TorchRec codebase have errors related to Github pre-commit failure due to `ufmt` formatting rules on a recent code change. Example error: https://github.com/pytorch/torchrec/actions/runs/16280345272/job/45968505367 {F1980271006} This diff changes the formatting to fix the pre-commit errors. Reviewed By: iamzainhuda Differential Revision: D78312884 fbshipit-source-id: 919930ccd929e72ecf41d30346263e2750831842
1 parent 3689535 commit fd9d78a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

torchrec/distributed/model_parallel.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,8 @@ def __init__(
895895
)
896896

897897
if ctx.module:
898-
ctx.sharded_module = self._sharder_map[ctx.module].sharded_module_type # pyre-ignore[16]
898+
# pyre-ignore[16]
899+
ctx.sharded_module = self._sharder_map[ctx.module].sharded_module_type
899900

900901
consolidated_plan = copy.deepcopy(self._ctxs[0].plan)
901902
for ctx in self._ctxs[1:]:
@@ -1195,10 +1196,13 @@ def _group_sharded_modules(
11951196
) -> None:
11961197
# Post init DMP, save the embedding kernels, with respect to contexts
11971198
for context in contexts[1:]:
1198-
context.modules_to_sync = self._group_sharded_module(context.sharded_module) # pyre-ignore[6]
1199+
context.modules_to_sync = self._group_sharded_module(
1200+
context.sharded_module # pyre-ignore[6]
1201+
)
11991202

12001203
# Group leftover embedding kernels, with respect to default context
1201-
modules_to_skip: List[nn.Module] = [c.sharded_module for c in contexts[1:]] # pyre-ignore[9]
1204+
# pyre-ignore[9]
1205+
modules_to_skip: List[nn.Module] = [c.sharded_module for c in contexts[1:]]
12021206
sharded_modules: List[nn.Module] = []
12031207

12041208
def _find_sharded_modules(

torchrec/distributed/test_utils/test_sharding.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,9 @@ def sharding_single_rank_test_single_process(
856856
qcomms_config=qcomms_config,
857857
)
858858
sharders.append(sharder) # pyre-ignore[6]
859-
config.plan = planner.collective_plan(local_model, [sharder], pg) # pyre-ignore[6]
859+
config.plan = planner.collective_plan(
860+
local_model, [sharder], pg # pyre-ignore[6]
861+
)
860862

861863
"""
862864
Simulating multiple nodes on a single node. However, metadata information and

0 commit comments

Comments
 (0)