Skip to content

Ways to clear memory. #513

Answered by njroussel
maxfrei750 asked this question in Q&A
Jan 31, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hi

The path integrator has a significant memory/efficiency cost to it when used in AD settings. I'd strongly recommend using prb instead, take a look at figure 6 of the Path Replay Backpropagation paper.
The wrap_ad function has some caveats to it but they rather have to do with runtime than memory consumption usually.

I can't find the thread about it anymore, but typically torch also likes to reserve a huge chuck of your VRAM. So that might also be an avenue to look into.

The clean_up() method you found is very "strict". Because it's used between unit tests, it practically flushes the entire JIT's state which is rarely something you want. Anyway, this should not be a significant amount o…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@maxfrei750
Comment options

@njroussel
Comment options

@njroussel
Comment options

@maxfrei750
Comment options

Answer selected by maxfrei750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants