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

Training with Deepspeed ZeRO-3 #97

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TheBlackHacker
Copy link

@TheBlackHacker TheBlackHacker commented Nov 25, 2023

Hello, I know a lot of people want to train OpenChat model but accessing modern GPUs like A100s or H100s is seem difficult. So I tried using ZeRO-3 to train on a cheaper GPU system, 8xA10G with 24GB VRAM.

What I added in this pull request:

ochat/training_deepspeed/deepspeed_config_zero3.json

- Change ZeRO-2 strategy to ZeRO-3.
- Offload to CPU (If you want to use nvme, please edit in the config file).

ochat/training_deepspeed/train_zero3.py

- Change optimizer from torch.optim.AdamW to deepspeed.ops.adam.DeepSpeedCPUAdam
- Save model (in 16bit) on all rank.

README.md

- Added instructions for training with ZeRO-3.

Copy link

@Gaivoronsky Gaivoronsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants