Skip to content

load_state_dict creates reference cycle, is there a python garbage collect operation before raise CUDA out-of-memory error? #20199

@Stonesjtu

Description

@Stonesjtu

🐛 Bug

Python's garbage collection invokes every 700 object creations (by default), so there should be a situation when the object is not referred but still occupies the CUDA memory (when reference cycles happen), so I'm asking for an additional garbage collecting operation if the CUDA memory is out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNot as big of a feature, but technically not a bug. Should be easy to fixmodule: cudaRelated to torch.cuda, and CUDA support in generalmodule: memory usagePyTorch is using more memory than it should, or it is leaking memorytriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions