DeepSpeedExamples icon indicating copy to clipboard operation
DeepSpeedExamples copied to clipboard

zero stage 3 error :NotImplementedError: Cannot copy out of meta tensor; no data!

Open EthenZhang opened this issue 3 years ago • 1 comments

In step3, i want to train ppo model ,one node with 4*A100 GPU, the actor_zero_stage and critic_zero_stage is set to 3,I get the error when the code load the model:

"/apsara/TempRoot/Odps/fc_marketing_algorithm_dev_2023051109362373gal6tgjphu3_f3606177_23d4_4173_b6c1_c14ec5223d4d_AlgoTask_0_0/PyTorchWorker@#0/workspace/utils/model/model_utils.py", line 45, in create_hf_model model = AutoModel.from_pretrained(model_name_or_path, config=model_config, trust_remote_code=True) File "/opt/conda/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 466, in from_pretrained return model_class.from_pretrained( File "/opt/conda/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2629, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 382, in wrapper f(module, *args, **kwargs) File "/home/admin/.cache/huggingface/modules/transformers_modules/modeling_chatglm.py", line 1017, in init self.transformer = ChatGLMModel(config) File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 382, in wrapper f(module, *args, **kwargs) File "/home/admin/.cache/huggingface/modules/transformers_modules/modeling_chatglm.py", line 801, in init self.word_embeddings = skip_init( File "/opt/conda/lib/python3.8/site-packages/torch/nn/utils/init.py", line 51, in skip_init return module_cls(*args, **kwargs).to_empty(device=final_device) File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 389, in wrapper self._post_init_method(module) File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 788, in _post_init_method param.partition() File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 913, in partition self._partition(param_list, has_been_updated=has_been_updated) File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 1050, in _partition self._partition_param(param, has_been_updated=has_been_updated) File "/opt/conda/lib/python3.8/site-packages/deepspeed/utils/nvtx.py", line 15, in wrapped_fn ret_val = func(*args, **kwargs) File "/opt/conda/lib/python3.8/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 1132, in partition_param param.ds_tensor.copy(src_tensor) NotImplementedError: Cannot copy out of meta tensor; no data! ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 635) of binary:

EthenZhang avatar May 11 '23 09:05 EthenZhang

according to https://github.com/THUDM/ChatGLM-6B/issues/530 ,i have solved this problem

EthenZhang avatar May 12 '23 01:05 EthenZhang