FastGen icon indicating copy to clipboard operation
FastGen copied to clipboard

[BUG] Massive System Memory Leak in WanT2V DDP Training on 8x A800 (1.8TB RAM Exhausted)

Open csy2077 opened this issue 9 months ago • 3 comments

Description: I am experiencing a critical system memory leak during training using FastGen with the WanT2V config. Despite having 1875GiB of system RAM, the training process consumes 100% of the memory and is terminated by the OOM Killer after approximately 14.5 hours (at iteration 400).

Hardware Environment:

  • GPUs: 8x NVIDIA A800-SXM4-80GB

  • CPU: 105 vCPUs

  • System RAM: 1875GiB (1.8TB)

Command Used: torchrun --nproc_per_node=8 train.py
--config fastgen/configs/experiments/WanT2V/config_dmd2.py \

  • trainer.ddp=True dataloader_train.datatags='["WDS:/path/to/dataset/"]' trainer.batch_size_global=64

Observed Behavior:

Memory Growth: System RAM utilization starts at ~20% (~375GB) and climbs linearly to ~96% (~1.8TB) over 14 hours.

Crash Logs: The debug-core log shows: server: parent process exited, terminating service process at 10:05 AM.

Performance: Iteration 400 finished at 10:01 AM, but the average iteration time was 128.39s, while the actual compute (forward+backward+opt) only totaled ~19.3s. This indicates massive overhead from memory swapping or thrashing.

csy2077 avatar Feb 10 '26 00:02 csy2077

Thanks for raising the issue!

  1. The total iteration time seems to be mainly due to the 8 accumulation steps per iteration (batch-size 2 per GPU and target batch_size_global of 64).
  2. You can try setting dataloader_train.shuffle_size=100 (or lower) and/or dataloader_train.num_workers=2 (or lower) to drastically reduce memory usage (in particular, the number of workers defaults to min(os.cpu_count() // world_size(), 16) and shuffling thus requires 16 workers to keep a buffer of 1000 videos in your current setting).

juliusberner avatar Feb 10 '26 01:02 juliusberner

Thanks for your timely reply, I would try the new setup 👍

csy2077 avatar Feb 10 '26 01:02 csy2077

currently it runs pretty smoothly. Thanks for the answer 💯

csy2077 avatar Feb 10 '26 21:02 csy2077