Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eager child attributes in excluded modules
Summary: Some modules imported at the application level, could be importing modules whose parent is listed in the eager list. The attributes added to the (eager) parent would then be lazy attributes. This is undesirable for the purposes of having whole packages flagged as eager. For example, doing `import torch.distributed.fsdp` from a non-eager module, adds `fsdp` as a lazy attribute to `torch.distributed` (even when `torch.*` is in the "eager list"). This produces a problem with a PyTorch subsystem that walks all objects inside all the `torch` namespace. This in turn triggers imports and eventually import cycles. This diff prevents adding lazy attributes pointing to children submodules on modules that are flagged as eager. This is the traceback for the example: P834477377 Reviewed By: cxxxs Differential Revision: D49647778 fbshipit-source-id: d475bc18964533f2ca810fa3417874c4b9de9752
- Loading branch information