Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Traceable FSDP2] [Dynamo] Fix OptimizedModule._initialize to allow t…
…racing into FSDP2 module hooks for module from user-defined module class (#129046) This is a workaround to allow inplace fully-sharded module to still go into this branch: https://github.com/pytorch/pytorch/blob/3a185778edb18abfbad155a87ff3b2d716e4c220/torch/_dynamo/eval_frame.py#L163 instead of the second branch: https://github.com/pytorch/pytorch/blob/3a185778edb18abfbad155a87ff3b2d716e4c220/torch/_dynamo/eval_frame.py#L166 If we don't do this, `torch.compile(fully_shard(module_from_user_defined_module_class))` will ignore all module hooks which will break FSDP tracing. Pull Request resolved: #129046 Approved by: https://github.com/anijain2305
- Loading branch information