deepspeedai / deepspeedai/DeepSpeed
[BUG] a bug in get_instantiation_memory_required_per_gpu; memory cal error
Open
Nobody has claimed this yet.
bug
training
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
There is a gpu memory calculation error in this function of
https://github.com/microsoft/DeepSpeed/blob/0a61d5d66462d51c6d867ab58479adf94f59de97/deepspeed/autotuning/autotuner.py#L278
# assume the model uses Adam optimizer
# ZeroStageEnum.disabled:
params_mem = num_params * (2 if fp16_enabled else 4)
gradients_mem = num_params * (2 if fp16_enabled else 4)
optimizer_mem = num_params * (16 if fp16_enabled else 8)
When use fp16, total_memory = num_params * 20 ; When fp16=False, total_memory = num_params*16, this is a bug, Because the memory will be used less when using fp16 ; if you use fp16=False optimizer_mem = num_params * 12.
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.
Assessment
This issue has not been assessed yet.