ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

Add two features which supports training PPO in one graphic card for large model and ChatGLM-6B model support

Open yynil opened this issue 2 years ago • 5 comments

📌 Checklist before creating the PR

  • [ x] I have created an issue for this PR for traceability
  • [ x] The title follows the standard format: [doc/gemini/tensor/...]: A concise description
  • [ x] I have added relevant tags if possible for us to better distinguish different PRs

🚨 Issue number

Link this PR to your issue with words like fixed to automatically close the linked issue upon merge

e.g. fixed #1234, closed #1234, resolved #1234 'Implement ##3566', 'Implement #3565'

📝 What does this PR do?

  1. Add model support for ChatGLM-6B.
  2. Add a video ram friendly trainer when training PPO model. One 3090ti with 24GB vram can finish the PPO training.
  3. Add Peft reward model, so all stage-3 models are peft.
  4. Add a support to preprocess texts to binary datasets to save the data process time.

💥 Checklist before requesting a review

  • [x ] I have linked my PR to an issue (instruction)
  • [ x] My issue clearly describes the problem/feature/proposal, with diagrams/charts/table/code if possible
  • [x ] I have performed a self-review of my code
  • [x ] I have added thorough tests.
  • [ x] I have added docstrings for all the functions/methods I implemented

⭐️ Do you enjoy contributing to Colossal-AI?

  • [x ] 🌝 Yes, I do.
  • [ ] 🌚 No, I don't.

Tell us more if you don't enjoy contributing to Colossal-AI.

yynil avatar Apr 14 '23 10:04 yynil

@yynil hello, if you want to support more models, can you add all models class in https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/coati/models? you can make a dir glm in https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/coati/models/glm

Fazziekey avatar Apr 17 '23 05:04 Fazziekey

I think this PR changes too many things, I think you can split it into three PR:

  • add glm models: including Reward model, actor model, critic model and LMmodels;
  • add datasets preprocess in https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/coati/dataset
  • add community example in https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/examples/community

Fazziekey avatar Apr 17 '23 06:04 Fazziekey

@yynil hello, if you want to support more models, can you add all models class in https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/coati/models? you can make a dir glm in https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/coati/models/glm

I'll create another branch to separate these changes.

yynil avatar Apr 17 '23 07:04 yynil

I add how to support your own model in this PR, https://github.com/hpcaitech/ColossalAI/pull/3579, please refer to it @yynil

Fazziekey avatar Apr 17 '23 07:04 Fazziekey

Since the ChatGLM is not willing to release a smaller model to public to train a reward model, I'm suspending the support to ChatGLM. My Branch will then move to bloom because bloom has a very good small model to allow us train reward model much easier.

yynil avatar Apr 25 '23 07:04 yynil

Since the ChatGLM is not willing to release a smaller model to public to train a reward model, I'm suspending the support to ChatGLM. My Branch will then move to bloom because bloom has a very good small model to allow us train reward model much easier.

Thanks, you are welcome to share and update your PR.

binmakeswell avatar May 05 '23 03:05 binmakeswell