Skip to content

Commit e0c24ec

Browse files
zhaojuanmaopytorchmergebot
authored andcommitted
Print fqn in the warning message (#94313)
Print fqn in the warning message, also make "else" match with the "if" in _apply_to_modules() Pull Request resolved: #94313 Approved by: https://github.com/fegin
1 parent e16daa7 commit e0c24ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torch/distributed/fsdp/_common_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,12 @@ def f(module: torch.nn.Module, prefix: str, *args, **kwargs):
280280
break
281281
else:
282282
# TODO: Remove this hack once DMP + FSDP is not supported.
283+
first_fqn = next(iter(filter_fqns), "")
283284
warnings.warn(
284285
"An unexpected prefix is detected. "
285286
"This case should only happen when using "
286287
"DistributedModelParallel with FullyShardedDataParallel."
288+
f"one fqn: {first_fqn}"
287289
)
288290
new_prefix = prefix
289291
f(submodule, new_prefix, *args, **kwargs)

0 commit comments

Comments
 (0)