Debian Codegraph @

examples/config_yaml_templates/fsdp.yaml

raw
1 # Since we are doing FSDP (even though it's multi-accelerator), we need to specify the distributed type as FSDP
2 distributed_type: FSDP
3 # Can be one of "no", "fp16", or "bf16" (see `transformer_engine.yaml` for `fp8`, but it works for FSDP as well)
4 mixed_precision: 'bf16'
5 # Specify the number of accelerators to use
6 num_processes: 2
7 # Then we can specify the FSDP config
8 fsdp_config:
9 fsdp_activation_checkpointing: false
10 fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
11 fsdp_backward_prefetch: BACKWARD_PRE
12 fsdp_cpu_ram_efficient_loading: true
13 fsdp_forward_prefetch: false
14 fsdp_offload_params: false
15 fsdp_sharding_strategy: FULL_SHARD
16 fsdp_state_dict_type: SHARDED_STATE_DICT
17 fsdp_sync_module_states: true
18 fsdp_use_orig_params: true