Commit a68a119
Andrew Gu
Update on "[FSDP] Add unsafe setattr gated by env var"
This adds the option to use an unsafe `setattr` for `_use_sharded_views()` and `_use_unsharded_views()` gated by the environment variable `FSDP_USE_UNSAFE_SETATTR`, where a value of `1` means to use the unsafe `setattr`. The unsafe option is disabled by default.
The unsafe `setattr` may be able to save CPU overhead and may be used to intentionally bypass `setattr` checks. Both `_use_sharded_views()` and `_use_unsharded_views()` must use the unsafe version or use the safe versions atomically.
[ghstack-poisoned]1 parent 4704a52 commit a68a119
1 file changed
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
686 | 685 | | |
687 | 686 | | |
688 | 687 | | |
| |||
691 | 690 | | |
692 | 691 | | |
693 | 692 | | |
694 | | - | |
695 | 693 | | |
696 | 694 | | |
697 | 695 | | |
| |||
0 commit comments