ULTR-Community / ULTRA_pytorch

Unbiased Learning To Rank Algorithms (ULTRA)
https://ultr-community.github.io/ULTRA_pytorch/
Apache License 2.0
93 stars 8 forks source link

Memory Leakage in DLA implementation #6

Closed rowedenny closed 2 years ago

rowedenny commented 2 years ago

https://github.com/ULTR-Community/ULTRA_pytorch/blob/ec4fe329e4239b588a940cb4bcdd6a321aade679/ultra/learning_algorithm/dla.py#L266

Refer to https://discuss.pytorch.org/t/cpu-ram-usage-increasing-for-every-epoch/24475/9

When I run DLA for 10k steps, the CPU memory will be used up. A simple fixation is to modify it as self.loss.item().

A similar issue also occurs in regression_EM, pdgd, nsgd, etc.