Skip to content

Commit

Permalink
[FSDP] Add FairScale FSDP adoptions logging (#913)
Browse files Browse the repository at this point in the history
* Add FairScale FSDP adoptions logging

* Add FairScale FSDP adoptions logging
  • Loading branch information
zhaojuanmao committed Jan 20, 2022
1 parent fef4423 commit 6f18e77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fairscale/experimental/nn/ssd_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def copy_into_tensor(self, tensor: torch.Tensor) -> None:
else:
read(tensor, self.filename, self.offset * tensor.element_size())

__torch_function__ = torch._C._disabled_torch_function_impl # type: ignore
__torch_function__ = torch._C._disabled_torch_function_impl

@classmethod
def __torch_dispatch__(cls, func, types, args=(), kwargs=None): # type: ignore
Expand Down
7 changes: 7 additions & 0 deletions fairscale/nn/data_parallel/fully_sharded_data_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ def __init__(
offload_config: Optional[OffloadConfig] = None,
state_dict_on_rank_0_only: bool = False,
):
try:
import torch._C

torch._C._log_api_usage_once("fairscale.fsdp")
except ImportError:
pass

init_start = time.time()
super().__init__()
self.process_group = process_group or get_process_group_cached()
Expand Down

0 comments on commit 6f18e77

Please sign in to comment.