[BUG] Massive System Memory Leak in WanT2V DDP Training on 8x A800 (1.8TB RAM Exhausted)
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.
Thanks for raising the issue!
- The total iteration time seems to be mainly due to the
8accumulation steps per iteration (batch-size2per GPU and targetbatch_size_globalof64). - You can try setting
dataloader_train.shuffle_size=100(or lower) and/ordataloader_train.num_workers=2(or lower) to drastically reduce memory usage (in particular, the number of workers defaults tomin(os.cpu_count() // world_size(), 16)and shuffling thus requires16workers to keep a buffer of1000videos in your current setting).
Thanks for your timely reply, I would try the new setup 👍
currently it runs pretty smoothly. Thanks for the answer 💯