sktime / sktime/pytorch-forecasting

Multi GPU Memory keeps increasing while training TFT

Open
#486 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
5k
Forks
912
Avg merge
3d 13h
Merged PRs (30d)
12

Description

  • PyTorch-Forecasting version: 0.8.4
  • PyTorch version: 1.8.1+cu102
  • Python version: Python 3.6.11
  • Operating System: Linux
Expected behavior

I follow the tft tutorial but want to train on multiple GPUs.

Actual behavior

RAM usage increase drastically over time until we get a memory error (Cannot allocate memory ...)

Changing to log_interval=-1 gets rid of the problem.
Also training on one GPU only doesn't increase RAM usage.

Code to reproduce the problem

Steps that differ from the tutorial:

  1. Omit the "learning rate finder" part
  2. add/replace these two lines in the pl.Trainer.
    gpus=[0, 1], accelerator='ddp',
  3. Increase max_epochs and early stopping such that it doesn't stop early

/edit: For clarification: RAM usage keeps increasing, not VRAM (which is okay).

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.

Research direction

Use the TFT tutorial with PyTorch 0.8.4, PyTorch 1.8.1+cu102, and the reported multi-GPU Trainer settings. Compare DDP and single-GPU runs with log_interval enabled, watching host RAM rather than VRAM, then verify the log_interval=-1 workaround. Done means repeated multi-GPU training no longer grows RAM until allocation fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.