System Info
Information
Tasks
Reproduction
I am trying to train a model using LLaMAFactory or MsSwift. When using FSDP2 with Accelerate, the process gets stuck during fsdp2_load_full_state_dict, specifically at this line:
https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/fsdp_utils.py#L516
full_param = full_param.detach().to(device_mesh.device_type)
At this point, the available memory keeps decreasing. The process remains stuck here for nearly half an hour without completing.
and the fsdp yaml looks like
compute_environment: LOCAL_MACHINE
debug: false
distributed_type: FSDP
downcast_bf16: 'no'
fsdp_config:
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
fsdp_cpu_ram_efficient_loading: true
fsdp_offload_params: false
fsdp_reshard_after_forward: true
fsdp_state_dict_type: FULL_STATE_DICT
fsdp_version: 2
machine_rank: 0
main_training_function: main
mixed_precision: bf16 # or fp16
num_machines: 1 # the number of nodes
num_processes: 8 # the number of GPUs in all nodes
rdzv_backend: static
same_network: true
tpu_env: []
tpu_use_cluster: false
tpu_use_sudo: false
use_cpu: false
Expected behavior
None
System Info
Information
Tasks
no_trainerscript in theexamplesfolder of thetransformersrepo (such asrun_no_trainer_glue.py)Reproduction
I am trying to train a model using LLaMAFactory or MsSwift. When using FSDP2 with Accelerate, the process gets stuck during
fsdp2_load_full_state_dict, specifically at this line:https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/fsdp_utils.py#L516
At this point, the available memory keeps decreasing. The process remains stuck here for nearly half an hour without completing.
and the fsdp yaml looks like
Expected behavior
None