deepspeedai / deepspeedai/DeepSpeed

[BUG] a bug in get_instantiation_memory_required_per_gpu; memory cal error

Open
#3,442 0 comments 0 reactions 1 assignee View on GitHub

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

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.