Skip to content

Commit d6fd553

Browse files
linting fix
Signed-off-by: cliu-us <[email protected]>
1 parent 04e4cb1 commit d6fd553

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fms_mo/fx/dynamo_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ def call_seq_hook(mod, *_args, **_kwargs):
12281228
# Therefore, length of qcfg["qkvsync_my_1st_sibling"] will be much shorter and keys of this dict
12291229
# won't exist in full list (like all_linears below).
12301230
all_linears = set(
1231-
[n for n, m in model.named_modules() if isinstance(m, torch.nn.Linear)]
1231+
n for n, m in model.named_modules() if isinstance(m, torch.nn.Linear)
12321232
)
12331233

12341234
if any(k not in all_linears for k in qcfg["qkvsync_my_1st_sibling"]):
@@ -1242,9 +1242,8 @@ def call_seq_hook(mod, *_args, **_kwargs):
12421242
lut_all_siblings[sib_1st].append(me)
12431243

12441244
full_sib_list = {}
1245-
for me in lut_all_siblings:
1245+
for me, all_sibs in lut_all_siblings.items():
12461246
partial_matches = [lin for lin in all_linears if me in lin]
1247-
all_sibs = lut_all_siblings[me]
12481247
# here lin is full_name, me and all_sibs are partial
12491248
for lin in partial_matches:
12501249
prefix = lin[: lin.index(me)]

0 commit comments

Comments
 (0)