style: apply ruff formatting to FSDP2 changes
This commit is contained in:
@@ -363,9 +363,7 @@ class FSDP2Executor(BaseExecutor):
|
||||
|
||||
@contextmanager
|
||||
def _no_sync(self, model: nn.Module):
|
||||
fsdp_modules = [
|
||||
m for m in model.modules() if isinstance(m, FSDPModule)
|
||||
]
|
||||
fsdp_modules = [m for m in model.modules() if isinstance(m, FSDPModule)]
|
||||
if fsdp_modules:
|
||||
for m in fsdp_modules:
|
||||
m.set_requires_gradient_sync(False, recurse=True)
|
||||
|
||||
@@ -472,7 +472,9 @@ def train(
|
||||
]
|
||||
assert os.path.exists(param_path)
|
||||
if nprocs > 1 and parallel_mode == "none":
|
||||
raise ValueError("--nprocs > 1 requires --parallel_mode to be 'ddp', 'fsdp', or 'fsdp2'")
|
||||
raise ValueError(
|
||||
"--nprocs > 1 requires --parallel_mode to be 'ddp', 'fsdp', or 'fsdp2'"
|
||||
)
|
||||
|
||||
# Load config
|
||||
config_path = os.path.join(param_path, "config.json")
|
||||
|
||||
Reference in New Issue
Block a user