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

Remove pytest cache clearing #375

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Remove pytest cache clearing #375

wants to merge 5 commits into from

Conversation

cpjordan
Copy link
Contributor

@cpjordan cpjordan commented Oct 17, 2024

  • This was updated in Firedrake PR #3730

@cpjordan cpjordan changed the title Update TSFC caching Remove pytest cache clearing Oct 17, 2024
@cpjordan
Copy link
Contributor Author

Firedrake PR #3370 and PyOP2 PR #724 updated the caching mechanisms which caused the hooks in test/conftest.py and test_adjoint/conftest.py to fail. These hooks were originally introduced in PR #2 to reduce memory usage and also prevent errors caused by inter-test dependencies.

With the recent caching updates in Firedrake and PyOP2, these issues should be resolved, so the cache-clearing hooks are no longer necessary, or at least until further issues arise.

@cpjordan cpjordan requested a review from tkarna October 17, 2024 15:15
@cpjordan cpjordan marked this pull request as ready for review October 17, 2024 15:15
@stephankramer
Copy link
Contributor

This looks good wrt tsfc/pyop2 cache but I would leave the clearing of the adjoint tape in place as it is. If you don't clear the tape between tests that use the adjoint then the model annotated in each tests just gets appended. This is a massive memory hole as you end up having the annotated forward model of each test in memory simultaneously. It potentially also slows down things, as a replay/backward pass may (depending on how clever pyadjoint is being) end up going through the entire tape including all operations of previous tests.

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.

2 participants