mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "[dynamo][fsdp] Consistent behavior of int attributes (#157262)"
This reverts commit 42b48ee67229286127390000f103a11dfc8901f5. Reverted https://github.com/pytorch/pytorch/pull/157262 on behalf of https://github.com/jeanschmidt due to Newly introduced tests are red in internal runs, check D77593713 ([comment](https://github.com/pytorch/pytorch/pull/157262#issuecomment-3026944993))
This commit is contained in:
@ -155,6 +155,17 @@ class GuardSource(enum.Enum):
|
||||
return self in (GuardSource.GLOBAL_FSDP_MODULE, GuardSource.LOCAL_FSDP_MODULE)
|
||||
|
||||
def is_specialized_nn_module(self) -> bool:
|
||||
import torch._dynamo.config as config
|
||||
|
||||
if config._unsafe_skip_fsdp_module_guards:
|
||||
return (
|
||||
self
|
||||
in (
|
||||
GuardSource.GLOBAL_SPECIALIZED_NN_MODULE,
|
||||
GuardSource.LOCAL_SPECIALIZED_NN_MODULE,
|
||||
)
|
||||
or self.is_fsdp_module()
|
||||
)
|
||||
return self in (
|
||||
GuardSource.GLOBAL_SPECIALIZED_NN_MODULE,
|
||||
GuardSource.LOCAL_SPECIALIZED_NN_MODULE,
|
||||
|
||||
Reference in New Issue
Block a user