deepspeedai / deepspeedai/DeepSpeed
Commenting out loss=None causes much higher GPU memory usage in bing_bert.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
I found that if I comment out loss = None in https://github.com/microsoft/DeepSpeedExamples/blob/fa1d1a71c48623db8a091d9cf636a5fe3b8f43c7/bing_bert/deepspeed_train.py#L176, the GPU memory usage increases significantly. It seems the GPU memory is accumulated with the next batch without manually dereferencing the object but I don't recall that we need this line in pure pytorch training code.
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 at bing_bert/deepspeed_train.py line 176 and reproduce the GPU memory difference with and without loss = None across batches. Trace the loss object and batch lifecycle to determine why memory is retained, then verify that the training run no longer accumulates GPU memory while preserving its existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100