Skip to content

[OPT] Avoid keeping differentiable graph if detach=True#342

Open
f-dangel wants to merge 1 commit intomasterfrom
improve-matfree
Open

[OPT] Avoid keeping differentiable graph if detach=True#342
f-dangel wants to merge 1 commit intomasterfrom
improve-matfree

Conversation

@f-dangel
Copy link
Copy Markdown
Owner

This optimization improves BackPACK's JVPs, HVPs, and GGNVPs whenever detach=True by setting create_graph=False, which will immediately discard the associated compute graph, instead of discarding it when the computation results are detached. This reduces peak memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant