Skip to content
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

请问有没有 GPT2-ML 预训练模型,希望结合 DTR 进行微调 #100

Open
NLPIG opened this issue Jun 22, 2021 · 4 comments
Open
Labels
question Further information is requested

Comments

@NLPIG
Copy link

NLPIG commented Jun 22, 2021

请求

实现MegEngine实现GPT2-ML(https://github.com/imcaspar/gpt2-ml)

任务描述

实验项目微调GPT2-ML,由于GPU资源不足(RTX 3060-12GB)无法调试,通过【机器之心】得知MegEngine1.4 DTR技术解决了动态图显存优化的问题,想请问有没有参考教程让我们能通过DTR实现对GPT2-ML的微调

目标

采用MegEngine实现的GPT2-ML模型,通过DTR进行微调

@qq332982511
Copy link

可以先参考DTR教程试一试 https://megengine.org.cn/doc/stable/zh/user-guide/dtr.html

@ChaiByte
Copy link

ChaiByte commented Jun 23, 2021

我的理解是你的问题有两个:

  1. 如何使用 DTR
  2. GPT2-ML pre-trained model

第一个问题楼上已经回答了,对于第二个问题,目前没有提供 GPT2-ML 的模型复现和预训练好的参数。 可以参考的解决思路是,尝试在 MegEngine 上对比其它框架的实现代码进行复现(MegEngine API 学习/迁移成本很低),比如你这里提到的 https://github.com/imcaspar/gpt2-ml/blob/master/train/modeling.py . 只要模型结构一致,参数可以通过读取其他框架预训练模型的 model.state_dict() 来进行微调,本质上都是 OrderedDict.

如果你利用 MegEngine 复现了经典模型,也欢迎和 Models 的库开发者联系调优,看能否成为 Contributor.

@NLPIG
Copy link
Author

NLPIG commented Jun 23, 2021

可以先参考DTR教程试一试 https://megengine.org.cn/doc/stable/zh/user-guide/dtr.html

好的

@NLPIG
Copy link
Author

NLPIG commented Jun 23, 2021

我的理解是你的问题有两个:

  1. 如何使用 DTR
  2. GPT2-ML pre-trained model

第一个问题楼上已经回答了,对于第二个问题,目前没有提供 GPT2-ML 的模型复现和预训练好的参数。 可以参考的解决思路是,尝试在 MegEngine 上对比其它框架的实现代码进行复现(MegEngine API 学习/迁移成本很低),比如你这里提到的 https://github.com/imcaspar/gpt2-ml/blob/master/train/modeling.py . 只要模型结构一致,参数可以通过读取其他框架预训练模型的 model.state_dict() 来进行微调,本质上都是 OrderedDict.

如果你利用 MegEngine 复现了经典模型,也欢迎和 Models 的库开发者联系调优,看能否成为 Contributor.

GPT2-ML也是基与bert,部分代码做了优化,我来试试,谢谢指导!

@ChaiByte ChaiByte changed the title Help-wanted Issue 请问有没有 GPT2-ML 预训练模型,希望结合 DTR 进行微调 Jun 23, 2021
@ChaiByte ChaiByte added the question Further information is requested label Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants