From 0bdf0196d98ea43afc5a58ee02e78437e5742e69 Mon Sep 17 00:00:00 2001 From: Yu Chin Fabian Lim Date: Wed, 1 May 2024 04:46:47 +0000 Subject: [PATCH] replace raise in accelerate.launch --- src/accelerate/utils/launch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/accelerate/utils/launch.py b/src/accelerate/utils/launch.py index 38e4dc1cea9..1932fe0592a 100644 --- a/src/accelerate/utils/launch.py +++ b/src/accelerate/utils/launch.py @@ -225,6 +225,8 @@ def prepare_multi_gpu_env(args: argparse.Namespace) -> Dict[str, str]: if args.use_fsdp: current_env["ACCELERATE_USE_FSDP"] = "true" + if args.fsdp_cpu_ram_efficient_loading and not args.fsdp_sync_module_states: + raise ValueError("When using `--fsdp_cpu_ram_efficient_loading` set `--fsdp_sync_module_states` to `True`") current_env["FSDP_SHARDING_STRATEGY"] = str(args.fsdp_sharding_strategy) current_env["FSDP_OFFLOAD_PARAMS"] = str(args.fsdp_offload_params).lower()