Skip to content

[Bug]: TypeError: cannot pickle 'paddle.fluid.libpaddle.Genera atorstate'object #6576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
sxl1993 opened this issue Aug 1, 2023 · 1 comment
Closed
1 task done
Assignees
Labels
bug Something isn't working triage

Comments

@sxl1993
Copy link

sxl1993 commented Aug 1, 2023

软件环境

- paddlepaddle:2.5.0
- paddlepaddle-xpu: 2.5.0
- paddlenlp: 2.6.0rc0.post0

重复问题

  • I have searched the existing issues

错误描述

调用fleet.meta_parallel.get_rng_state_tracker().get_states_tracker()保存rng状态到字典结构中,通过paddle.save保存报错
TypeError: cannot pickle 'paddle.fluid.libpaddle.Generatorstate'object
原因是:Generatorstate是c++的struct结构,无法通过pickle进行序列化。

稳定复现步骤 & 代码

export PYTHONPATH="../../PaddleNLP/"

log_dir="log"
rm -rf $log_dir

python3 -m paddle.distributed.launch
--xpus "0"
--log_dir ${log_dir}
finetune_generation.py
--model_type "gpt"
--model_name_or_path gpt2-medium-en
--output_dir "output/$task_name"
--per_device_train_batch_size 2
--per_device_eval_batch_size 1
--tensor_parallel_degree 1
--pipeline_parallel_degree 1
--scale_loss 1024
--learning_rate 0.00001
--max_steps 10000
--save_steps 5000
--weight_decay 0.01
--warmup_ratio 0.01
--max_grad_norm 1.0
--logging_steps 1
--dataloader_num_workers 1
--sharding "stage2"
--max_evaluate_steps 1000
--eval_steps 1000
--report_to "visualdl"
--disable_tqdm true
--recompute 1
--gradient_accumulation_steps 2
--do_train
--do_eval
--device "xpu"

@sxl1993 sxl1993 added the bug Something isn't working label Aug 1, 2023
@github-actions github-actions bot added the triage label Aug 1, 2023
@w5688414
Copy link
Contributor

w5688414 commented May 7, 2024

您好,可以先升级到最新版本试一下,另外我们还没有计划支持xpu,需要内部讨论一下,欢迎开发者贡献哈。

@paddle-bot paddle-bot bot closed this as completed May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants