deepspeedai / deepspeedai/DeepSpeed

[BUG] Deepspeed multi-GPU Inference

Open
#4,526 1 comment 0 reactions 1 assignee View on GitHub

@mrwyattii is already working on this.

Since Nov 8, 2023.

bug inference
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Describe the bug

I'm using transformers.Trainer with deepspeed. During training, Zero 2 is adopted. For evaluation, I just want to accelerate with multi-GPU inference like in normal DDP, while deepspeed raises ValueError: "ZeRO inference only makes sense with ZeRO Stage 3 - please adjust your config".
I find that in evaluation it works, but direct calling "trainer.predict" after initialize the trainer would cause the above error.

I understand the error, that means optimizer and scheduler of ZeRO 2 is not optimized during train, but is there an approach that allows multiple-GPUs inference given configure of ZeRO 2?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.