Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove autograd temporary simulation files #2032

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

yaugenst-flex
Copy link
Collaborator

Currently, autograd temp files are being created but not removed in upload_sim_fields_keys and get_vjp_traced_fields. This causes /tmp to eventually run out of space, especially when running longer optimizations.
Right now, the file is being created, deleted, and then re-created with the name of the temp file in the .to_file() and download_file() calls, respectively.
Ideally we would be able to use a context manager here, but since we are overwriting the file handle, that approach doesn't work. We should probably be passing around file handles instead of names internally.

@yaugenst-flex yaugenst-flex added the 2.8 will go into version 2.8.* label Oct 23, 2024
@yaugenst-flex yaugenst-flex self-assigned this Oct 23, 2024
Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious why no except logic here? Is it worth adding

@yaugenst-flex
Copy link
Collaborator Author

good idea to add some, done

@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/fix-tempfile branch from 9f6f5ae to 34c9bfc Compare October 23, 2024 11:43
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/fix-tempfile branch from 34c9bfc to 0f68973 Compare October 24, 2024 08:41
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/fix-tempfile branch from 0f68973 to 2687193 Compare October 24, 2024 08:42
@yaugenst-flex
Copy link
Collaborator Author

@momchil-flex can we merge this?

@yaugenst-flex yaugenst-flex added 2.7 will go into version 2.7.* and removed 2.8 will go into version 2.8.* labels Oct 24, 2024
@momchil-flex momchil-flex merged commit 9a33406 into develop Oct 24, 2024
15 checks passed
@momchil-flex momchil-flex deleted the yaugenst-flex/fix-tempfile branch October 24, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.7 will go into version 2.7.*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants