"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "520198f56f31eef2fe032562ecf52b21928cb3bf"
Unverified Commit b85b8806 authored by Sourab Mangrulkar's avatar Sourab Mangrulkar Committed by GitHub
Browse files

fix ram efficient fsdp init (#25686)

parent 68fa9a59
...@@ -113,11 +113,11 @@ _init_weights = True ...@@ -113,11 +113,11 @@ _init_weights = True
def is_fsdp_enabled(): def is_fsdp_enabled():
return strtobool(os.environ.get("ACCELERATE_USE_FSDP", "False")) == 1 return torch.distributed.is_initialized() and strtobool(os.environ.get("ACCELERATE_USE_FSDP", "False")) == 1
def is_fsdp_enabled_and_dist_rank_0(): def is_fsdp_enabled_and_dist_rank_0():
return is_fsdp_enabled() and torch.distributed.is_initialized() and torch.distributed.get_rank() == 0 return is_fsdp_enabled() and torch.distributed.get_rank() == 0
if is_sagemaker_mp_enabled(): if is_sagemaker_mp_enabled():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment