deepspeedai / deepspeedai/DeepSpeed
[BUG] Unexpected GPU memory consumption when using transformers PEFT in Zero3
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
Description
Llama30B with Lora adapters cannot fit into 8 x A100 (80GB).
Suspected Cause
The possible reason for this issue might be that Zero3 does not partition non-trainable weights across GPUs. The basis for this assumption is:
- The memory consumption is consistent with predicted values when Lora is not used.
- When training the model with both Zero2 and Zero3 using Lora, I observe nearly the same memory consumption.
- A code examination of the Zero Runtime sources also suggests this could be the case.
Demonstration of Problem and Experiment Setups
I will illustrate this issue using various experiment setups on smaller models:
- 7b+lora+stage 3
All other parameters remain consistent in the experiments below.
Question
Is it accurate that in Zero3, only trainable parameters are partitioned? If so, why is it designed this way?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading deepspeed/runtime/zero/stage3.py around the linked line and compare the reported Zero2 and Zero3 setups with and without LoRA. Reproduce the four experiment variants described in the issue, then verify whether non-trainable weights are partitioned and document the observed behavior and design rationale.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems, machine-learning, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100